You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "beat weisskopf (JIRA)" <ji...@apache.org> on 2018/12/04 11:23:00 UTC

[jira] [Comment Edited] (PDFBOX-4303) Helv and ZaDb overridden

    [ https://issues.apache.org/jira/browse/PDFBOX-4303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16707130#comment-16707130 ] 

beat weisskopf edited comment on PDFBOX-4303 at 12/4/18 11:22 AM:
------------------------------------------------------------------

We are hitting this issue too on upgrading from 2.0.5 to 2.0.12. To fix the issue one should get the "Font"-Dictionary and check the existence there:

e.g.
{code}
    COSDictionary fontDict = (COSDictionary) defaultResources.getCOSObject().getDictionaryObject(COSName.FONT);
    if (!fontDict.containsKey("Helv"))
        {
            defaultResources.put(COSName.getPDFName("Helv"), PDType1Font.HELVETICA);
        }
{code}

What is missing for this to be fixed? 

I added a small git diff to fix the issue. I am unsure if my observed behaviour should be another issue: if one calls getLastSignatureDictionary, the AcroFrom is populated with the defaults.

For example:
{code}
            PDDocument pdfDocument = PDDocument.load(pdfBytes);
            pdfDocument.getLastSignatureDictionary();
{code}
This calls the verifyOrCreateDefaults() method.


was (Author: weisskopf):
We are hitting this issue too on upgrading from 2.0.5 to 2.0.12. To fix the issue one should get the "Font"-Dictionary and check the existence there:

e.g.
{code}
    COSDictionary fontDict = (COSDictionary) defaultResources.getCOSObject().getDictionaryObject(COSName.FONT);
    if (!fontDict.containsKey("Helv"))
        {
            defaultResources.put(COSName.getPDFName("Helv"), PDType1Font.HELVETICA);
        }
{code}

What is missing for this to be fixed?

> Helv and ZaDb overridden
> ------------------------
>
>                 Key: PDFBOX-4303
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4303
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.11
>            Reporter: simon steiner
>            Assignee: Maruan Sahyoun
>            Priority: Major
>              Labels: Appearance
>         Attachments: PDFBOX-4303-2.0.12.diff, ReaderModifiedForm.pdf
>
>
> Due to change:
> PDFBOX-3943: create /Helv and /ZaDb entries if they don't exist, regardless if /DR existed or not
>  
> was working ok in 2.0.7, in 2.0 branch
> PDAcroForm
> verifyOrCreateDefaults():
> is:
> {color:#000080}if {color}(!defaultResources.getCOSObject().containsKey({color:#008000}"Helv"{color}))
> should be checking key in the font dictionary before calling defaultResources.put



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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