Pages: 1
Print
Author Topic: svg graphics support in XMetal  (Read 6599 times)
topi70
Member

Posts: 7


« on: March 22, 2012, 05:58:49 AM »

Is there still any easy way to render svg graphics in XMetal editor?
I'm currently using Xmetal 6, DITA, windows 7 32 bit version, CMS (content management) is siemens teamcenter.
I have heard that you can do some customization with . ctm files. Sadly i'm not the only one who is using XMetal in our organization. So customization is not easy solution. We have 4 users in Finland and 4 in India. So it is quite hard to customize everyones XMetal. besides i might not be able to do it. Any new or fresh ideas.
I have the third party activeX plugin so i can see those svg images in explorer 8. (company is still using the old version). We currently publish in pdf and html our documents.
Logged
rosskoa
Member

Posts: 2


WWW
« Reply #1 on: April 04, 2012, 05:21:56 AM »

Is there still any easy way to render svg graphics in XMetal editor?
I'm currently using Xmetal 6, DITA, windows 7 32 bit version, CMS (content management) is siemens teamcenter.
I have heard that you can do some customization with . ctm files. Sadly i'm not the only one who is using XMetal in our organization. So customization is not easy solution. We have 4 users in Finland and 4 in India. So it is quite hard to customize everyones XMetal. besides i might not be able to do it. Any new or fresh ideas.
I have the third party activeX plugin so i can see those svg images in explorer 8. (company is still using the old version). We currently publish in pdf and html our documents.

You're saying you can't get the images to display in the XMetaL edit pane?

I am using Windows 7, IE 8 and the Adobe SVG Viewer plugin for IE (version 3.0.3 Build 94) and SVG displays in my XMetaL edit pane.  Right clicking on the image in the edit pane brings up the Adobe context menu rather than XMetaL's so I know it is using that to display the graphic.

Here's the markup I used to load the image:
<p><image id="image_AD5F5DBA177E449EA8F39C6783BB60AC"
      href="file:///C:/Temp/drawing.svg"></image>
    </p>


If you're using Adobe's plugin I don't know why this wouldn't work for you too (although I've told IE to trust this ActiveX control so that it loads SVG without prompting in IE, perhaps you need to do that).

Having the SVG pictures appear in the output is another matter - if you've cracked that nut I'd be interested in hearing how.

The link for the SVG Viewer is: http://download.adobe.com/pub/adobe/magic/svgviewer/win/3.x/3.03/en/SVGView.exe

Good luck,

Ross McPhee
Senior Software Engineer
www.koalapub.co.uk


* svgview.png (115.68 KB, 752x734 - viewed 614 times.)
« Last Edit: April 04, 2012, 05:25:59 AM by rosskoa » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #2 on: April 04, 2012, 10:53:52 AM »

I think the issue here might be the CMS integration. You might see different results while authoring in XMetaL Author Enterprise depending on which you are using (the old integration created by Siemens or the new Teamcenter "connector" created by JustSystems).

I'm not sure if we've tested ours specifically with the DITA SVG rendering support, but since it uses "XMetaL Connector" (which is our standard layer for interfacing with all CMS systems) there is a far higher chance that it will function as it does work when used with integrations with other CMS systems (I have seen that).
« Last Edit: April 04, 2012, 10:59:12 AM by Derek Read » Logged
topi70
Member

Posts: 7


« Reply #3 on: April 12, 2012, 05:21:47 AM »


Having the SVG pictures appear in the output is another matter - if you've cracked that nut I'd be interested in hearing how.

Ross McPhee
Senior Software Engineer
www.koalapub.co.uk
[/quote]

Do you mean that can i allready publish on pdf and html format with svg graphics?
Logged
rosskoa
Member

Posts: 2


WWW
« Reply #4 on: April 16, 2012, 02:42:56 AM »

Do you mean that can i allready publish on pdf and html format with svg graphics?

Yes, that what I was asking.  Can you get the SVG graphics to appear in the output as well as the edit interface?

Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #5 on: April 17, 2012, 06:41:47 PM »

Totally possible...

HTML:
You are dependent on browser support for SVG if you want to embed SVG into your HTML pages. Here's a page that tries to list support in a meaningful way: http://caniuse.com/#cats=SVG
That means either assuming the people reading your content have a browser capable of natively rendering SVG or that they install a plug-in that can do that. See attached screen capture of the current version of FireFox (without plug-in). The content being displayed is standard output from the DITA OT 1.4.2.1 (the version that ships with XMetaL Author Enterprise 6.0) without any changes. See attached DITA_and_SVG_sample.zip (link after this post) for the example used to generate the FireFox screen capture.

If you can't count on the people reading your content to meet those requirements then you need to select an image format that most browsers can support. All browsers capable of rendering images can probably render JPG and GIF. Most can also render PNG (a browser has to be pretty old not to support PNG). So, you then need to decide when to transform your SVG into one of these supported formats.

1) Modify the DITA OT to generate alternate image types during output generation and linking to them instead (potentially a lot of work).

2) Or perform a batch conversion from time to time that converts from SVG to a supported format. This might be easier as there are many tools available that will do this.

3) Or have the person that creates your SVG provide you with alternative forms of the image that are in a supported format. They might do this when they save the SVG as most graphics applications allow saving to multiple forms.

For #1 you might have someone hook Apache Batik up (or a similar tool) so that it transforms your SVG files while the DITA OT is producing output.

For #2 or #3 you could always link to the alternate form (probably JPG, PNG or GIF) in your DITA <image> elements (and never include references to the SVG files at all). Or if you wish to still use SVG for some outputs for some reason then you could use conditional text something like the following:

<p>
<image href="myimage.svg" otherprops="imgSVG"></image>
<image href="myimage.jpg" otherprops="imgOther"></image>
</p>


In this case when you produce output you would need to use the conditional text feature, or provide a DITAVAL file with pre-configured settings for each output type you wish to produce (those that support SVG would use a DITAVAL with otherprops="imgSVG" and those that do not would use the other one).

PDF:
The PDF standard itself does not support embedding SVG inside PDF files. RenderX XEP has the ability to transform SVG into an appropriate form and will embed that into PDF files and it will do this automatically if you reference an SVG file in your DITA content. This means you must be producing PDF using a deliverable type that uses RenderX XEP ("XMetaL Enhanced PDF via RenderX XEP" for example). The missing piece (which is why you may not see such images embedded in your PDF even if using this deliverable) is that the DITA OT only copies files it considers to be "images" into the appropriate folder for RenderX XEP to find them and these image types may not include SVG. To work around this you can try the following:

1) Include an @href reference to your SVG image in an <image> tag (see attached DITA_and_SVG_sample.zip -- link after this post)

2) Generate output using the deliverable "XMetaL Enhanced PDF via RenderX XEP".

3) Locate the folder where the PDF file was generated in and copy your SVG images into that folder into the appropriate subfolder (if any). The folder structure should match that of the original @href value (to simplify things to start with you may wish to avoid using subfolders).

4) Generate output once more. This time RenderX will locate your SVG images, transform and embed them into the PDF. Note that this can add to the length of time needed to generate a PDF compared to the same DITA topic referencing a JPG and I assume that is dependent on the complexity of the SVG being transformed.

If you still don't see images in your PDF check that the path from the XML file to the original SVG is the same relative path in the PDF output folder (the path from the PDF to the SVG). If you search the topic.fo file in the zip I have attached for ".svg" it may become clearer what the path should be (the path is actually relative to this .fo file). See following page as well to check that the SVG image itself is supported by XEP as there are some limits as to what it can handle: http://www.renderx.com/reference.html#SVG

* DITA_and_SVG_sample.zip (32.27 KB - downloaded 244 times.)

* xmetal_author_enterprise_6_svg.jpg (99.51 KB, 881x707 - viewed 629 times.)

* firefox_html_svg.jpg (50.56 KB, 895x588 - viewed 595 times.)

* adobe_reader_pdf_svg.jpg (35.55 KB, 564x716 - viewed 577 times.)
« Last Edit: April 17, 2012, 07:07:50 PM by Derek Read » Logged
Pages: 1
Print
Jump to: