SVG-to-PDFKit icon indicating copy to clipboard operation
SVG-to-PDFKit copied to clipboard

Duplicate objects in PDF

Open mlgoff59 opened this issue 6 years ago • 2 comments

My use case requires me to produce documents that are PDf v1.4 or higher. PDFKit only produces v1.3 documents. To get around that, I've been working with another library that doesn't support SVG but does produce v.17 documents, called pdf-lib

The resulting documents are huge. While reviewing them for accuracy, using Acrobat Pro 2017, I discovered that saving them with Acrobat reduced the size by nearly 75%. I assumed the problem was with pdf-lib. It's starting to look like the issue might be with SVG-to-PDFKit.

The developer of pdf-lib cracked open the files and there are a lot of duplicate objects in final document.

I can provide you with the test files, but I would need to send them to in a private message. Our client is picky about who sees their data.

I've provided a link to the pdf-lib issue for background purposes. https://github.com/Hopding/pdf-lib/issues/9

PDFKit is the only library I've found that will convert SVG to PDF as EPS rather than rasterizing it. This is a critical feature for us. I'll do anything I can to help resolve this issue.

mlgoff59 avatar Aug 16 '18 11:08 mlgoff59

You can send the svg and the pdf with some of the duplicate objects highlighted to [email protected] I will check if this issue can be fixed in svg-to-pdfkit.

alafr avatar Aug 20 '18 19:08 alafr

To update on this issue, it is more difficult to solve than i initially thought. Duplicate objects are produced at numerous different points in the code. I currently don't have time to fix complicated issues like this one. However I can accept pull requests.

alafr avatar Sep 29 '18 20:09 alafr