Am 13.06.2016 um 09:49 schrieb Croe.David:
hi,
i would like to add headers/footers to each page of a pdf file. footers may 
contain dynamic data like page numbers. current approach is to copy those 
headers/footers from a template pdf file, but then the font is missing.
As far as I've understood each page has its own font resources , is that 
correct ? or is it possible to embed fonts for a whole file and reference them?
Does pdfbox offer a way to embed only a subset of a font to decrease the file 
size?

You can direct PDFBox to subset a font:

PDFont font = PDType0Font.load(doc, new File("c:/windows/fonts/simhei.ttf"));

You can use that font object for several pages of a document, i.e. you don't have to call load() again. Note that all released 2.0 versions have a bug which may occur with fonts that are partially or completely monotype. (You'll see it when it happens, glyphs will appear in wrong positions) This will be fixed in the next release.

Tilman

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

Reply via email to