I need to merge about a 100 PDF files into one where each file uses more or less the same unsubsetted fonts. All the options I have tried so far (pdfunite
, gs
, etc.) are not intelligent about font duplication and the merged PDF ends up with a 100 copies of the same font and is therefore much larger than it needs to be.
Is there a way to do any one of the following:
- Merge the PDFs without duplicating fonts?
- De-duplicate the fonts in the PDF later?
- Remove fonts from the PDF entirely?
The ideal solution will have a commercial friendly open source license (eg. not APGL).
Contrary to what you say, recent versions of Ghostscript have become quite efficient when it comes to merging multiple PDFs into a single one, and at the same time avoiding to embed an identical font multiple times.
Inputs
Here are the details about 3 input PDFs, which I'll merge into a single output:
Merging
Now merge these three PDF input files with the help of
pdftk
.Output
Now check the font status of the output merged.pdf:
Ok, not yet there...
Optimize with Ghostscript
Check font statuses and file sizes
Conclusion
I tested this with Ghostscript v9.25.
If this doesn't work for you, you'll need to...
I'm aware that this answer does not provide you with a solution that meets exactly your license requirements. -- But your false statement about Ghostscript prompted me to give this answer anyway, so other people interested in this topic can still benefit from it...