Hi Kai, there are several ways to look at it:
- is a value of 4294966971 permitted? - does something like <INT KEY="Ascent" VAL="1006"/> <INT KEY="CapHeight" VAL="716"/> <INT KEY="Descent" VAL="4294966971"/> make sense? For the first one it's a little unclear as one could argue that the integer data typeas it only states that this is a mathematical integer. There are som ehint about implementations: The (PDF 2.0) spec has this about it (Annex C - Architectural limits) "Integer values (such as object numbers) can often be expressed within 32 bits." The 1.7 spec has this (Annex C - Architectural limits) integer 2,147,483,647 Largest integer value; equal to 231 − 1. So from that perspective the values are too large. Do the values make sense? Looking at an Ascent of 1006 and the Descent of 4294966971 this would be a funny looking font. Same applies to the Lab color settings etc. So I think although one could make it work (e.g. by using long instead of int) in PDFBox I'm not sure that this is really something wanted. What are the values when you export the same data from Windows? As you are dealing with xml you could strip the data before doing the import as a solution for your case. BR Maruan Am Dienstag, dem 24.05.2022 um 11:48 +0000 schrieb Kai Keggenhoff: > Hi Maruan, > > unfortunately I cannot share neither the PDF nor the whole XFDF, but > I located the annotation that caused it and looked at its appearance > stream. > These large, unsigned INT values seem to appear in font (Descent, > FontBBox) and color space (Range) related entries. > Here are a few samples (incomplete XML) : > > <DICT KEY="Font"> > <DICT KEY="Arial"> > <NAME KEY="BaseFont" VAL="Arial"/> > <DICT KEY="Encoding"> > <NAME KEY="BaseEncoding" VAL="MacRomanEncoding"/> > <ARRAY KEY="Differences"> > <INT VAL="65"/> > <NAME VAL="A"/> > <INT VAL="219"/> > <NAME VAL="Euro"/> > </ARRAY> > <NAME KEY="Type" VAL="Encoding"/> > </DICT> > <INT KEY="FirstChar" VAL="0"/> > <DICT KEY="FontDescriptor"> > <INT KEY="Ascent" VAL="1006"/> > <INT KEY="CapHeight" VAL="716"/> > <INT KEY="Descent" VAL="4294966971"/> > <INT KEY="Flags" VAL="32"/> > <ARRAY KEY="FontBBox"> > <INT VAL="4294966631"/> > <INT VAL="4294966971"/> > <INT VAL="2000"/> > <INT VAL="1006"/> > </ARRAY> > > <DICT KEY="ColorSpace"> > <ARRAY KEY="CS0" DEFINE="" XFDFINDIRECTREF_0=""> > <NAME VAL="Separation"/> > <NAME VAL="PANTONE 5483 U"/> > <ARRAY> > <NAME VAL="Lab"/> > <DICT> > <ARRAY KEY="Range"> > <INT VAL="4294967168"/> > <INT VAL="127"/> > <INT VAL="4294967168"/> > <INT VAL="127"/> > </ARRAY> > <ARRAY KEY="WhitePoint"> > <FIXED VAL="0.964203"/> > <INT VAL="1"/> > <FIXED VAL="0.824905"/> > </ARRAY> > </DICT> > </ARRAY> > <STREAM DEFINE=""> > <INT KEY="BitsPerSample" VAL="8"/> > <ARRAY KEY="Domain"> > <INT VAL="0"/> > <INT VAL="1"/> > </ARRAY> > <NAME KEY="Filter" VAL="FlateDecode"/> > <INT KEY="FunctionType" VAL="0"/> > <INT KEY="Length" VAL="478"/> > <ARRAY KEY="Range"> > <INT VAL="0"/> > <INT VAL="100"/> > <INT VAL="4294967168"/> > <INT VAL="127"/> > <INT VAL="4294967168"/> > <INT VAL="127"/> > </ARRAY> > <ARRAY KEY="Size"> > <INT VAL="1365"/> > </ARRAY> > > <DICT KEY="Font"> > <DICT KEY="T1_0"> > <NAME KEY="BaseFont" VAL="AAAAAB+SofiaPro-Bold"/> > <NAME KEY="Encoding" VAL="MacRomanEncoding"/> > <INT KEY="FirstChar" VAL="32"/> > <DICT KEY="FontDescriptor"> > <INT KEY="Ascent" VAL="1121"/> > <INT KEY="AvgWidth" VAL="614"/> > <INT KEY="CapHeight" VAL="996"/> > <INT KEY="Descent" VAL="4294967036"/> > <INT KEY="Flags" VAL="32"/> > <ARRAY KEY="FontBBox"> > <INT VAL="4294966797"/> > <INT VAL="4294967005"/> > <INT VAL="1574"/> > <INT VAL="1152"/> > </ARRAY> > > <DICT KEY="T1_1"> > <NAME KEY="BaseFont" VAL="AAAAAC+SofiaPro-Regular"/> > <NAME KEY="Encoding" VAL="MacRomanEncoding"/> > <INT KEY="FirstChar" VAL="32"/> > <DICT KEY="FontDescriptor"> > <INT KEY="Ascent" VAL="1080"/> > <INT KEY="AvgWidth" VAL="238"/> > <INT KEY="CapHeight" VAL="960"/> > <INT KEY="Descent" VAL="4294967026"/> > <INT KEY="Flags" VAL="32"/> > <ARRAY KEY="FontBBox"> > <INT VAL="4294966835"/> > <INT VAL="4294966995"/> > <INT VAL="1500"/> > <INT VAL="1111"/> > </ARRAY> > > Thank you for looking into this ! > > Kai > > -----Ursprüngliche Nachricht----- > Von: sahy...@fileaffairs.de <sahy...@fileaffairs.de> > Gesendet: Dienstag, 24. Mai 2022 12:17 > An: users@pdfbox.apache.org > Betreff: Re: appearance stream from MacOS Adobe Reader > > CAUTION - External Sender > > > Hi Kai, > > could you either upload the XFDF to a public location or copy the XML > node of the annotation? I would be interested in the element which > has > that value to check if the range is permitted or not. > > BR > Maruan > > Am Dienstag, dem 24.05.2022 um 09:12 +0000 schrieb Kai Keggenhoff: > > Hi, > > > > we're seeing a problem with XFDF generated by MacOS Adobe Reader > > for > > stamp annotations. > > For some stamps, Adobe Reader generates appearance stream data that > > contain the number 4294967036 > > (The Windows version apparently does not !) > > > > When we try to process such XFDF, we get > > > > java.lang.NumberFormatException: For input string: "4294967036" > > at > > java.lang.NumberFormatException.forInputString(NumberFormatExceptio > > n. > > java:65) ~[?:1.8.0_332] > > at java.lang.Integer.parseInt(Integer.java:583) > > ~[?:1.8.0_332] > > at java.lang.Integer.parseInt(Integer.java:615) > > ~[?:1.8.0_332] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.parseDictElement(F > > DF > > AnnotationStamp.java:396) ~[pdfbox-app-2.0.25.jar:2.0.25] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.parseDictElement(F > > DF > > AnnotationStamp.java:380) ~[pdfbox-app-2.0.25.jar:2.0.25] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.parseDictElement(F > > DF > > AnnotationStamp.java:380) ~[pdfbox-app-2.0.25.jar:2.0.25] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.parseDictElement(F > > DF > > AnnotationStamp.java:380) ~[pdfbox-app-2.0.25.jar:2.0.25] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.parseStreamElement > > (F > > DFAnnotationStamp.java:234) ~[pdfbox-app-2.0.25.jar:2.0.25] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.parseStampAnnotati > > on > > AppearanceXML(FDFAnnotationStamp.java:174) ~[pdfbox-app- > > 2.0.25.jar:2.0.25] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.<init>(FDFAnnotati > > on > > Stamp.java:133) ~[pdfbox-app-2.0.25.jar:2.0.25] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFDictionary.<init>(FDFDictionary.ja > > va > > :211) ~[pdfbox-app-2.0.25.jar:2.0.25] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFCatalog.<init>(FDFCatalog.java:63) > > ~[pdfbox-app-2.0.25.jar:2.0.25] > > at > > org.apache.pdfbox.pdmodel.fdf.FDFDocument.<init>(FDFDocument.java:9 > > 0) > > ~[pdfbox-app-2.0.25.jar:2.0.25] > > > > Do I blame MacOS Adobe Reader for generating that number when its > > Windows brother does not ? > > Do I blame Java 8's Integer.parseInt for not being lenient enough ? > > Do I blame PDFBox for not using Long ? > > Do I blame myself for fudging the last release and not deploying > > 2.0.26 properly ? > > Is there any sensible way to correct such data before trying to > > process it ? > > > > All the best, > > > > Kai > > -- > -- > Maruan Sahyoun > > FileAffairs GmbH > Josef-Schappe-Straße 21 > 40882 Ratingen > > Tel: +49 (2102) 89497 88 > Fax: +49 (2102) 89497 91 > sahy...@fileaffairs.de > https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fileaffairs.de%2F&data=05%7C01%7CKai.Keggenhoff%40thinkproject.com%7Cb785e2acbaa648af495508da3d702b67%7C066d0cfbe2e648f093a415c5c8979a86%7C0%7C0%7C637889849248526873%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=qT53ntWkjy5fkf1lYy6kUTMgf7Id9U22zq0rp7qcW70%3D&reserved=0 > > Geschäftsführer: Maruan Sahyoun > Handelsregister: AG Düsseldorf, HRB 53837 > UST.-ID: DE248275827 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org > For additional commands, e-mail: users-h...@pdfbox.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org > For additional commands, e-mail: users-h...@pdfbox.apache.org > -- -- Maruan Sahyoun FileAffairs GmbH Josef-Schappe-Straße 21 40882 Ratingen Tel: +49 (2102) 89497 88 Fax: +49 (2102) 89497 91 sahy...@fileaffairs.de www.fileaffairs.de Geschäftsführer: Maruan Sahyoun Handelsregister: AG Düsseldorf, HRB 53837 UST.-ID: DE248275827 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org