Re: Annotations + incrementalSave + specific PDF (pdfbox2) = no annotation displayed

2023-10-31 Thread Tilman Hausherr
Hi, I don't have time right now to test my theory, which would require setting update marks on the intermediate pagetree objects. In the meantime please try using the other saveIncremental call, where you pass COSDictionary objects. You'll probably need to only pass the page and your annotation

Re: Annotations + incrementalSave + specific PDF (pdfbox2) = no annotation displayed

2023-10-31 Thread Frédéric Ravetier
I added that : Get the COSObject of the new annotation (stamp), add it to the set of COSToWrite and pass this information to the saveIncremental. Set setCOSObjectToWrite = new HashSet() ; setCOSObjectToWrite.add(stamp.getCOSObject()); doc.saveIncremental(resultFile, setCOSObjectToWrite); And t

Re: Annotations + incrementalSave + specific PDF (pdfbox2) = no annotation displayed

2023-10-31 Thread Tilman Hausherr
I got it to work with the classic method by adding this code before saving:     COSDictionary parent = page.getCOSObject().getCOSDictionary(COSName.PARENT);     while (parent != null)     {     parent.setNeedToBeUpdated(true);     parent = parent