PDF production with SVG having hot spots


Pierre Attar
 

Hi,

I have a technical documentation with a lot of SVG files having hot spots.
Hotspots are managed using a javascript function call on g/@onmouseover attributes.
The function itself changes some opacity attributes of the graphic.
The HTML production works fine and all hotspots are active.

Using the same SVG, with the standard DITA-OT PDF (XSL-FO) plugin, the hotspots are no more active and all images are flats.

So, does someone foud a solution, a workaround, for keeping these kind SVG hotspots actives ?
Is there an other way to code SVG for being able to make them interactive both on PDF and HTML ?

Thanks for sharing any idea, solution,

Pierre


David Hollis
 

Hi Pierre,

Are you sure that the PDF format properly renders a SVG file with a hot spot, and that the Reader displays it as a hot spot?

David

Hi,

I have a technical documentation with a lot of SVG files having hot spots.
Hotspots are managed using a javascript function call on g/@onmouseover attributes.
The function itself changes some opacity attributes of the graphic.
The HTML production works fine and all hotspots are active.

Using the same SVG, with the standard DITA-OT PDF (XSL-FO) plugin, the hotspots are no more active and all images are flats.

So, does someone foud a solution, a workaround, for keeping these kind SVG hotspots actives ?
Is there an other way to code SVG for being able to make them interactive both on PDF and HTML ?

Thanks for sharing any idea, solution,

Pierre


Radu Coravu
 

Hi Pierre,

I also don't think there is a way to have the PDF interpret Javascript code inside SVG images.
Maybe you can pre-process the SVG images at publishing time and convert the Javascript code to actual svg circle or rectangle elements which would render the hotspots over the content (but they would always be there, they would not appear when hovering over the image and disappear afterwards.
Nicolas Delobel from Amplexor created support to render DITA image maps in PDF using an SVG layer over the original binary image:

https://github.com/Amplexor/com.amplexor.imagemap-pdf

Regards,
Radu

Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

On 1/25/2021 3:27 PM, David Hollis wrote:
Hi Pierre,
Are you sure that the PDF format properly renders a SVG file with a hot spot, and that the Reader displays it as a hot spot?
David

Hi,

I have a technical documentation with a lot of SVG files having hot spots.
Hotspots are managed using a javascript function call on g/@onmouseover attributes.
The function itself changes some opacity attributes of the graphic.
The HTML production works fine and all hotspots are active.

Using the same SVG, with the standard DITA-OT PDF (XSL-FO) plugin, the hotspots are no more active and all images are flats.

So, does someone foud a solution, a workaround, for keeping these kind SVG hotspots actives ?
Is there an other way to code SVG for being able to make them interactive both on PDF and HTML ?

Thanks for sharing any idea, solution,

Pierre


Dan Caprioara
 

If you can switch from XSL-FO to CSS, please note that Oxygen XML Editor includes a DITA-OT plugin that outputs PDF based on a CSS customization (not XSL-FO) and it supports image map rendering and links in SVG images:

https://www.oxygenxml.com/doc/ug-ope/topics/dcpp_images.html#dcpp_how_to_use_image_maps

Many regards,

Dan

On 1/25/2021 1:28 PM, Pierre Attar wrote:
Hi,

I have a technical documentation with a lot of SVG files having hot spots.
Hotspots are managed using a javascript function call on g/@onmouseover attributes.
The function itself changes some opacity attributes of the graphic.
The HTML production works fine and all hotspots are active.

Using the same SVG, with the standard DITA-OT PDF (XSL-FO) plugin, the hotspots are no more active and all images are flats.

So, does someone foud a solution, a workaround, for keeping these kind SVG hotspots actives ?
Is there an other way to code SVG for being able to make them interactive both on PDF and HTML ?

Thanks for sharing any idea, solution,

Pierre