Page 1 of 1
Rendering SVG Images in PDF
Posted: Wed Jul 26, 2023 7:54 pm
by Mario
Hello. I am regularly seeing issues where embedded SVG images are being rendered slightly incorrectly in PDF. Nothing major, but slightly distorted lines. I've attached examples of both good (from a web browser) and bad for reference.
good-equation.png
bad-equation.png
Does this look familiar to anyone?
Re: Rendering SVG Images in PDF
Posted: Thu Jul 27, 2023 10:18 am
by julien_lacour
Hello,
Could you attach the SVG file too? I will try to reproduce the problem on our side.
Could you also indicate which Oxygen version and which transformation scenario you are using?
Regards,
Julien
Re: Rendering SVG Images in PDF
Posted: Thu Jul 27, 2023 2:52 pm
by Mario
I'm not using a transformation scenario but a custom XML FO plugin. I've attached the SVG below.
equation_3.zip
Please note that this is loaded into the target XML as an externl image, not inline.
Re: Rendering SVG Images in PDF
Posted: Wed Aug 16, 2023 3:58 pm
by julien_lacour
Hello,
I've tested using <oXygen/> XML Editor 25.1, build 2023070306, with the following scenario (as I don't have your plugin, it's the closest I've found):
- The image is inserted as follows:
Code: Select all
<image placement="break" href="equation_3.svg"/>
- The DITA Map PDF - based on XSL-FO transformation is launched
But this scenario fails, it seems that the width="35.869ex" height="5.343ex" values aren't compatible.
So I modified these values in a new file and try to run again the transformation:
equation_3_bis.zip
But the result is correctly rendered:
image.png
Could you try to use the equation_3_bis.svg image in your scenario? Is the problem still present?
Could you indicate which Oxygen version you are using? And if you are using the built-in Engine or an external DITA-OT?
Side Note: Using the DITA Map PDF - based on HTML5 & CSS scenario, both SVGs are rendered correctly.
Regards,
Julien
Re: Rendering SVG Images in PDF
Posted: Mon Aug 21, 2023 8:36 pm
by Mario
I've tested with the new SVG, and it looks the same. I am not rendering PDF in Oxygen, but using a custom DITA-OT plugin using Ant & RenderX. I strongly suspect it's the latter tool that's the issue.
Re: Rendering SVG Images in PDF
Posted: Thu Aug 31, 2023 7:46 pm
by Mario
It turns out that the problem was internal to XEP. I've been given a patch, but for various reasons we cannot use it in our environment.
Thanks for looking at this.