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

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

{quote} do I need to go down and build FDF objects for these items and/or 
working with a COSDictionary directly
{quote}
Yes, there is a whole structure (possibly nested) that has to be decoded 
flexibly - you can't be sure how many levels there are. With patterns, 
shadings, etc. I didn't notice that before that this was nested.
  
 You can flexible create elements with COSDictionary.setItem(). 
{color:#333333}You should probably ignore the "Length" entries, because these 
are automatically set when saving a COSStream.{color}

When saving raw data to a COSStream, use createRawOutputStream.

 
 After looking at the XML again I see that the types can be identified, so you 
could check them and then create a COSReal, COSBoolean, COSInteger, COSArray, 
COSDictionary depending on the type.
  
 Re "Hex": there is a utility "Hex" class in PDFBox, what you need is 
{{Hex.getBytes(child.getTextContent().getBytes())}}.
 Re base64: to test, please use java.util.Base64 for your development, assuming 
that you use jdk8 or higher (you have to change "java17" to "java18" in the 
animal sniffer segment of the parent pom so that your build works). At a later 
time we'll have to use reflection, because the first is for jdk8 and higher, 
the second works up to jdk7.
 I have some (unfinished) reflection code for this, so don't spend time with it.

 

> 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, 
> Stamp_appearance_decoded.txt, 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