We have discovered what we believe to be 2 bugs in Spire.PDF related to saving PDFs to SVG. It's also possible that it's a single bug that is manifesting itself in different ways.
Bug #1 (the main one): We can't give a simple reproduction. We have a long running Windows Service that does many things, but among these things it converts PDFs to SVG and occasionally the generated SVG files are incorrect. The attached zip contains a TestFiles\ActualBug folder with examples. The folder contains a good SVG file and a bad one. Both were generated from TestFiles\Original.pdf. The resulting SVG files differ by a few things, but the font tables seem key. This bug occurs for us almost daily, but is intermittent and we can't give a simple method to reproduce. Our code simply loads a PDF and saves as SVG so there's nothing interesting. The attached zip contains code that is identical to what our service is doing.
A few more things about Bug #1
- Once it starts happening, every PDF->SVG operation thereafter exhibits the problem and the fonts within the SVG are incorrect.
- It typically takes about a day or more of processing before the problem occurs.
- Restarting the service clears things up, for a while until it happens again.
Bug #2: This one is easy to reproduce, and the attached zip contains a Console app that exhibits the problem. The first time an SVG is created from PDF the SVG is ok. However, if the same PdfDocument is used to generate another SVG, the second SVG is incorrect and is completely missing a font table. See TestFiles\Bad.svg and TestFiles\Good.svg for example output or simply run the attached program. Note that saving to HTML is similar since internally PdfDocument seems to use SVG for creating HTML.
Since both bugs are related to the SVG font table we are hoping that addressing the 2nd one might somehow help with the first. To be clear, we are really interested in Bug#1, we just discovered Bug#2 while researching this issue.
We are using Spire.PDF 10.12.4 but have seen this for older versions as well.
We are running on Windows 11 and Windows Server 2022 and both exhibit the issue