Hello Kai,

Am Mittwoch, dem 02.08.2023 um 07:56 +0000 schrieb Kai Keggenhoff:
> 
> 
> 
> Hi Tilman,
>  
> thank you for the suggestion. Turns out, it's “Line” annotations.
> When I import
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <xfdf xmlns="http://ns.adobe.com/xfdf/"; xml:space="preserve">
>                 <annots>
>                                <line width="3" color="#FF0000"
> caption-style="Inline"
>                                               
> creationdate="D:20230526112815+02'00'" flags="print"
>                                               
> start="1770.007568,1614.721436" end="1791.373535,1658.575195"
>                                               date="D:20230526112815+
> 02'00'" page="0"
>                                               
> rect="1764.007568,1608.721436,1797.373535,1664.575195"
>                                               subject="Linie"
> title="John Doe">
>                                                <popup
> flags="print,nozoom,norotate" open="no"
>                                                               
> page="0" rect="1780.690552,-92.000000,1964.690552,0.000000"/>
>                                </line>
>                 </annots>
> </xfdf>
> 

how was the xfdf generated. Can you compare to an xfdf generated when
exporting using Adobe Acrobat?

BR
Maruan


>  
> into either its original source or just a fresh, DIN A4 PDF with a
> single line of text created with PDFBox, Adobe Reader will complain.
> At this point, I switched from 2.0.29 to 3.0.0beta1 and the result
> was the same.
>  
> In the resulting PDF, PDFDebugger shows what is in the attachment –
> an empty “NM” entry.
> I then tried to set either “Name” or “NM” (and ultimately both) in
> dictionary of the PDAnnotation to “Line” with
>  
> PDAnnotation a =
> PDAnnotation.createAnnotation(xfdfAnnotation.getCOSObject());
> a.getCOSObject().setItem(COSName.NM, new COSString("Line"));
> a.getCOSObject().setItem(COSName.NAME, new COSString("Line"));
>  
> but while these values show up fine in PDFDebugger,
> Adobe Reader will still complain.
>  
> Would you happen to have more suggestions how I could work around
> this please ?
>  
> Thanks in advance,
>  
> Kai
>  
> -----Ursprüngliche Nachricht-----
> Von: Tilman Hausherr <thaush...@t-online.de>
> Gesendet: Dienstag, 1. August 2023 19:41
> An: users@pdfbox.apache.org
> Betreff: Re: Adding annotations to PDFs - "expected a name object"
>  
> CAUTION - External Sender
>  
>  
> Try to edit the xfdf file so that it has less annotations until you
> know
> which one is the culprit. Then tell what names were in the xfdf file.
> Or
> make a screenshot in PDFDebugger of that annotation, without the text
> content.
>  
> Tilman
>  
> On 01.08.2023 10:15, Kai Keggenhoff wrote:
> >  
> > Hello everyone,
> >  
> > we’re using PDFBox to import annotations from XFDF files and add
> > them
> > to existing PDF files.
> >  
> > First we create a FDFDocument from the XFDF, then we fetch the list
> > of
> > FDFAnnotations from it via
> >  
> > < FDFDocument>.getCatalog().getFDF().getAnnotations()
> >  
> > Then we iterate over this list, create PDAnnotations from the COS
> > objects of the FDFAnnotation with PDAnnotation.createAnnotation()
> >  
> > and add the PDAnnotation to the list of page annotations we got
> > from
> > PDPage.getAnnotations()
> >  
> > For most PDFs and most XFDF files, this works without any issues.
> >  
> > However, some PDF files with merged annotations, when opened in
> > Adobe
> > Reader, produce a huge number of popups with the message
> >  
> > “Expected a name object” / “Namensobjekt wurde erwartet”
> >  
> > before the PDF is fully rendered, while the original file does not
> > show such a behaviour.
> >  
> > When such PDF files are opened in Foxit PDF Reader or PDFDebugger,
> > they are rendered just fine without errors.
> >  
> > We saw this happen every now and then over the years, with all
> > PDFBox
> > V2 versions, including 2.0.29,
> >  
> > but it appears to have become more frequent recently, so user
> > complaints are becoming more frequent too.
> >  
> > As I’m unable to share sample PDFs/XFDFs due to compliance reasons,
> > I
> > just have the question if anyone happens to have some hints
> >  
> > what I could look for in an affected PDF (preferably using
> > PDFDebugger) to find out what Adobe Reader doesn’t like ?
> >  
> > Ideally, I then can try to compare it with the original and find
> > the
> > part of the process which “breaks” the result.
> >  
> > Thanks in advance,
> >  
> > Kai
> >  
> > <
> > https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fth
> > inkproject.com%2Fde%2F&data=05%7C01%7CKai.Keggenhoff%40thinkproject
> > .com%7Cc2c7a48b704a43b51b5108db92b67c7e%7C066d0cfbe2e648f093a415c5c
> > 8979a86%7C0%7C0%7C638265084694491778%7CUnknown%7CTWFpbGZsb3d8eyJWIj
> > oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000
> > %7C%7C%7C&sdata=F%2FQ4yYRr1Rv%2BwLcEM5cmp%2FW0uhVDtG8c9Xez%2FbXbBmo
> > %3D&reserved=0>
> >  
> > *Kai Keggenhoff* / Senior Software Developer
> >  
> > *thinkproject.com***
> > <https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> > thinkproject.com%2Fde&data=05%7C01%7CKai.Keggenhoff%40thinkproject.
> > com%7Cc2c7a48b704a43b51b5108db92b67c7e%7C066d0cfbe2e648f093a415c5c8
> > 979a86%7C0%7C0%7C638265084694491778%7CUnknown%7CTWFpbGZsb3d8eyJWIjo
> > iMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
> > 7C%7C%7C&sdata=S%2BJ3yc8r9jXgFmH0tJ5zdielpbhIBkWXoL25FeyKhhU%3D&res
> > erved=0>
> >  
> > <
> > https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fthinkproject-dach%2Fposts%2F%3FfeedVie
> > w%3Dall&data=05%7C01%7CKai.Keggenhoff%40thinkproject.com%7Cc2c7a48b
> > 704a43b51b5108db92b67c7e%7C066d0cfbe2e648f093a415c5c8979a86%7C0%7C0
> > %7C638265084694649022%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL
> > CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata
> > =x%2F1HZ%2BHA4n9ftlBokoUWzEa5ubanynP%2B1CLSd4MlDUU%3D&reserved=0><h
> > ttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftw
> > itter.com%2Fthinkproject_&data=05%7C01%7CKai.Keggenhoff%40thinkproj
> > ect.com%7Cc2c7a48b704a43b51b5108db92b67c7e%7C066d0cfbe2e648f093a415
> > c5c8979a86%7C0%7C0%7C638265084694649022%7CUnknown%7CTWFpbGZsb3d8eyJ
> > WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3
> > 000%7C%7C%7C&sdata=w%2B4rE4F0udUxARyFQUa4EKbbjv7g%2F%2BK4IAubAmcBQz
> > k%3D&reserved=0>
> >  
> > Read our legal information (imprint) here
> > <
> > https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fth
> > inkproject.com%2Fde%2Fimpressum%2F&data=05%7C01%7CKai.Keggenhoff%40
> > thinkproject.com%7Cc2c7a48b704a43b51b5108db92b67c7e%7C066d0cfbe2e64
> > 8f093a415c5c8979a86%7C0%7C0%7C638265084694649022%7CUnknown%7CTWFpbG
> > Zsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6M
> > n0%3D%7C3000%7C%7C%7C&sdata=ZkWeKQuBmYmR1pRBcPIpdc5bo%2B8NWU9u8UlBW
> > O26nao%3D&reserved=0>.
> >  
> 
> ---------------------------------------------------------------------
> 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

Reply via email to