[
https://issues.apache.org/jira/browse/PDFBOX-919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
John Hewson updated PDFBOX-919:
-------------------------------
Description:
When writing generic code to change PDF documents (concatenate PDFs, add custom
text, etc.), some functions using a custom font can be called multiple times.
As it is not possible to simply cash the PDFont instances (see PDFBOX-809 =>
COSVisitorException) as they are probably hard linked to a document instance,
it should be possible to request the font from the document to re-use it.
Example: 2 documents use both the same custom font. When I concatenate them and
add additional text with my custom font, the result has 3 times this font
embedded! Instead of creating new instances of the custom font on every
(generic) call of an application method, it would be better to somehow "tell"
PDFBox, that the custom font is already in the PDF that I want to change. So a
method like
PDFont f = myPDDocument.getFont()
would be usefull to avoid multiple inclusions of the same font on a document.
was:
When writing generic code to change PDF documents (concatenate PDFs, add custom
text, etc.), some functions using a custom font can be called multiple times.
As it is not possible to simply cash the PDFont instances (see bug 809 =>
COSVisitorException) as they are probably hard linked to a document instance,
it should be possible to request the font from the document to re-use it.
Example: 2 documents use both the same custom font. When I concatenate them and
add additional text with my custom font, the result has 3 times this font
embedded! Instead of creating new instances of the custom font on every
(generic) call of an application method, it would be better to somehow "tell"
PDFBox, that the custom font is already in the PDF that I want to change. So a
method like
PDFont f = myPDDocument.getFont()
would be usefull to avoid multiple inclusions of the same font on a document.
> Make custom fonts reusable / get font reference from document.
> --------------------------------------------------------------
>
> Key: PDFBOX-919
> URL: https://issues.apache.org/jira/browse/PDFBOX-919
> Project: PDFBox
> Issue Type: Wish
> Components: Writing
> Affects Versions: 1.3.1
> Environment: Windows XP; 32 Bit; JDK 1.6.0_22.
> Reporter: MH
>
> When writing generic code to change PDF documents (concatenate PDFs, add
> custom text, etc.), some functions using a custom font can be called multiple
> times. As it is not possible to simply cash the PDFont instances (see
> PDFBOX-809 => COSVisitorException) as they are probably hard linked to a
> document instance, it should be possible to request the font from the
> document to re-use it.
> Example: 2 documents use both the same custom font. When I concatenate them
> and add additional text with my custom font, the result has 3 times this font
> embedded! Instead of creating new instances of the custom font on every
> (generic) call of an application method, it would be better to somehow "tell"
> PDFBox, that the custom font is already in the PDF that I want to change. So
> a method like
> PDFont f = myPDDocument.getFont()
> would be usefull to avoid multiple inclusions of the same font on a document.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)