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

Tilman Hausherr edited comment on PDFBOX-5214 at 9/1/21, 6:29 PM:
------------------------------------------------------------------

I'm getting fails / differences rendering annotations.

AnnotationSample.Standard.pdf (NPE)
CTAN-example-Annotations.pdf (NPE)
pdf_commenting_new.pdf p5 (differences)
PDFJS-1973-Annotations-pdfcomment.pdf (differences)

1.
Standard14Fonts.getMappedFont() will sometimes return null because put() 
returns the previous value. That is easy to fix.

2.
Less easy: 
{{Standard14Fonts.getMappedFont(FontName.HELVETICA_BOLD).getPath("question")}} 
will not return the correct path for me with the file 
AnnotationSample.Standard.pdf .
{code}
FontBoxFont font1 = Standard14Fonts.getMappedFont(FontName.HELVETICA_BOLD);
FontBoxFont font2 = Standard14Fonts.getMappedFont(FontName.ZAPF_DINGBATS);
{code}
Helvetica is a org.apache.fontbox.ttf.TrueTypeFont, Zapf Dingbats is a 
org.apache.fontbox.type1.Type1Font. Helvetica won't work because the Windows 10 
default fonts don't have a postscript table. I suspect that 
{{Standard14Fonts.getMappedFont()}} can't be used in 
{{PDTextAppearanceHandler}} at all, we need to use PDType1Font directly.


was (Author: tilman):
I'm getting fails / differences rendering annotations.

1.
Standard14Fonts.getMappedFont() will sometimes return null because put() 
returns the previous value. That is easy to fix.

2.
Less easy: 
{{Standard14Fonts.getMappedFont(FontName.HELVETICA_BOLD).getPath("question")}} 
will not return the correct path for me with the file 
AnnotationSample.Standard.pdf .
{code}
FontBoxFont font1 = Standard14Fonts.getMappedFont(FontName.HELVETICA_BOLD);
FontBoxFont font2 = Standard14Fonts.getMappedFont(FontName.ZAPF_DINGBATS);
{code}
Helvetica is a org.apache.fontbox.ttf.TrueTypeFont, Zapf Dingbats is a 
org.apache.fontbox.type1.Type1Font. Helvetica won't work because the Windows 10 
default fonts don't have a postscript table. I suspect that 
{{Standard14Fonts.getMappedFont()}} can't be used in 
{{PDTextAppearanceHandler}} at all, we need to use PDType1Font directly.

> File generated differently depending on test call
> -------------------------------------------------
>
>                 Key: PDFBOX-5214
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5214
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Tilman Hausherr
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>             Fix For: 3.0.0 PDFBox
>
>         Attachments: AnnotationSample.Standard.pdf, 
> EmptySignatureForm_FullPackageTest.pdf, EmptySignatureForm_SingleClassTest.pdf
>
>
> Something weird is happening in {{TestCreateSignature.testPDFBox3978}}. The 
> file {{EmptySignatureForm.pdf}} that is generated has different object 
> streams depending on whether it is generated within a full test of the 
> examples package, or if the {{TestCreateSignature}} class is tested. The two 
> files should be identical except for the ID.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to