[
https://issues.apache.org/jira/browse/PDFBOX-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910195#comment-13910195
]
Dominic Tubach commented on PDFBOX-1928:
----------------------------------------
It's OK for me if it is fixed in 2.0, though 1.8.3 changes the behavior of
prior versions
{code}
PDResources resources = ...;
COSBase fontDictionary1 =
resources.getCOSDictionary().getDictionaryObject(COSName.FONT);
// PDFBox <= 1.8.2: an empty COSDictionary is set at COSName.FONT if it is null,
// otherwise nothing is changed
// PDFBox >= 1.8.3: a new COSDictionary with same content is set at COSName.FONT
resources.getFonts();
COSBase fontDictionary2 =
resources.getCOSDictionary().getDictionaryObject(COSName.FONT);
if (fontDictionary1 == fontsDictionary2) {
// PDFBox <= 1.8.2 if fontDictionary1 is not null
} else {
// PDFBox >= 1.8.3
// PDFBox <= 1.8.2 if fontDictionary1 is null
}
{code}
> PDResources.getFonts() and PDresources.getXObjects() change underlying
> COSDictionary
> ------------------------------------------------------------------------------------
>
> Key: PDFBOX-1928
> URL: https://issues.apache.org/jira/browse/PDFBOX-1928
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 1.8.3, 1.8.4
> Reporter: Dominic Tubach
> Assignee: John Hewson
> Labels: Breaking-Change
> Fix For: 2.0.0
>
> Attachments: PDResources.diff
>
>
> The methods getFonts() and getXObjects() in PDResources change the underlying
> COSDictionary.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)