Rendering SVG Images in PDF

Post here questions and problems related to editing and publishing DITA content.
Mario
Posts: 3
Joined: Wed Jul 26, 2023 7:45 pm

Rendering SVG Images in PDF

Post 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
good-equation.png (4.54 KiB) Viewed 789 times
bad-equation.png
bad-equation.png (3.45 KiB) Viewed 789 times
Does this look familiar to anyone?
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: Rendering SVG Images in PDF

Post 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
Mario
Posts: 3
Joined: Wed Jul 26, 2023 7:45 pm

Re: Rendering SVG Images in PDF

Post by Mario »

I'm not using a transformation scenario but a custom XML FO plugin. I've attached the SVG below.
equation_3.zip
(4.18 KiB) Downloaded 96 times
Please note that this is loaded into the target XML as an externl image, not inline.
Last edited by Mario on Thu Jul 27, 2023 2:54 pm, edited 1 time in total.
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: Rendering SVG Images in PDF

Post 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):
  1. The image is inserted as follows:

    Code: Select all

    <image placement="break" href="equation_3.svg"/>
    
  2. 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
(4.24 KiB) Downloaded 87 times
But the result is correctly rendered:
image.png
image.png (9.97 KiB) Viewed 669 times
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
Mario
Posts: 3
Joined: Wed Jul 26, 2023 7:45 pm

Re: Rendering SVG Images in PDF

Post 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.
Mario
Posts: 3
Joined: Wed Jul 26, 2023 7:45 pm

Re: Rendering SVG Images in PDF

Post 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.
Post Reply