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

Tilman Hausherr commented on PDFBOX-4437:
-----------------------------------------

Thanks I'll test that later today and will find out whether our Hex works or 
not for you, and also bring up the base64 thing.

However you didn't understand me when I wrote "{color:#333333}has to be decoded 
flexibly{color}", sorry about that. I mean that you should not look much for 
specific items, you should look for their types. So instead of

 

          if ("Interpolate".equals(childAttrKey)) 
          {
            LOG.debug(parentAttrKey + " => Set Interpolate: " + childAttrVal);
            stream.setBoolean(COSName.INTERPOLATE, 
Boolean.parseBoolean(childAttrVal));
          }
          else 
          {
            LOG.warn(parentAttrKey + " => Not handling element BOOL key: " + 
childAttrKey);
          }
 

just do this:


            stream.setItem(c{color:#333333}hildAttrKey{color}, 
Boolean.parseBoolean(childAttrVal));

This is just for a boolean. The same should be done for the other types.

So for array:

     stream.setItem({color:#333333}parentAttrKey{color}, 
parseArrayElement(child));

 

Names that require specific handling should be handled separately, for example 
"Length" should be ignored.

Your current code likely ignores the SMask component. That's why I warned 
"...{color:#333333}With patterns, shadings, etc.{color}..." These are all new 
keywords.

> Import XFDF stamp annotation loses appearance
> ---------------------------------------------
>
>                 Key: PDFBOX-4437
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4437
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.9, 2.0.10, 2.0.11, 2.0.12, 2.0.13
>            Reporter: Andrew Hung
>            Priority: Major
>         Attachments: A1.01 - MYLES - 2ND-4TH  FLOOR PLAN.pdf, 
> FDFAnnotationStamp.java, FDFAnnotationStamp2.java, 
> FDFAnnotationStampAppearance_final.java, FDFAnnotationStamp_final.java, 
> Stamp_appearance_decoded.txt, ap.xml, example.zip, stamp_annotation.xfdf, 
> xfdf stamp annotation to PDF.zip
>
>
> When loading an XFDF which has a stamp annotation which contains an 
> appearance element after added to the PDF in place of the annotation is an 
> box with an X.
> Reviewing the FDFAnnotationStamp class, it skips all internal elements.  Is 
> there any development being done to enhance this?
> I've attached "xfdf stamp annotation to PDF.zip" which has an example, if you 
> open the stamp_annot.xfdf it will show on the PDF.  While using PDFBox API 
> the only piece missing is the appearance of the stamp.



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

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

Reply via email to