Hi Tilman, I've tested removing CP as suggested with
PDAnnotation annot = PDAnnotation.createAnnotation(dict); if ("Line".equalsIgnoreCase(annot.getSubtype()) && annot.getCOSObject().containsKey(COSName.CP) && !annot.getCOSObject().containsKey(COSName.CAP)) { annot.getCOSObject().removeItem(COSName.CP); } ("dict" is the COSDictionary of the FDFAnnotation) This appears to work for all the cases I've found with a given "caption-style" but no other caption related attributes. So for the time being, I'll use this and revisit this once 2.0.30 is released. Thanks again for the fixes and suggestions ! All the best, Kai -----Ursprüngliche Nachricht----- Von: Tilman Hausherr <thaush...@t-online.de> Gesendet: Donnerstag, 3. August 2023 19:37 An: users@pdfbox.apache.org Betreff: Re: Adding annotations to PDFs - "expected a name object" CAUTION - External Sender I've fixed the issues I mentioned and a few more, I'm not sure if this will help you or not. https://issues.apache.org/jira/browse/PDFBOX-5644 https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.30-SNAPSHOT/ Tilman --------------------------------------------------------------------- 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