pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Change PDF Font type
Date Wed, 20 Dec 2017 12:18:49 GMT
Am 20.12.2017 um 12:20 schrieb Robson Peixoto:
> Hi guys,
>
> We are using PDFBox(1.x) and Itext(4.x) to split a PDF in multiples pages. The Itext
has a very useful class, UnembedFontPdfSmartCopy, that "Makes a copy of a PDF, unembedding
all embedded fonts. All font headers and descriptors are preserved and only the font file
is removed."
>
> How can I do it using PDFBox?
> Any ideas?

There is no such utility but yes it could be done, you'd have to access 
the resources (sometimes recursively, e.g. forms and patterns), then the 
fonts, then go through the font dictionaries (use PDFDebugger to see 
their structure, there are different ones), then find /FontFile or 
/FontFile2 or /FontFile3, and remove that entry.

However this is something that is undesirable IMHO, and my help will be 
minimal (I'll answer specific questions but won't write a full utility 
for that). The resulting file might not always be displayed properly. 
Embedding fonts is best practice, in PDF/A it is mandatory.

Tilman

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message