First off, in my case the annotations are not widgets, so the if is not necessary. The annotations I am most interested in are rectangles to either highlight or white to block out content visually.
But removing the if still did not allow it to work because I think I need to have the annotation take into account the matrix transformations applied at the time of adding the page. The annotations have rectangle relative to the original page, which and not relative to the transformed page. Looks like it will be a bit of work to track the many matrix transformations applied and reversed with restoring graphics state but it is doable. I will try that and see if it works On Wed, Nov 15, 2017 at 2:11 PM, Tilman Hausherr <[email protected]> wrote: > Please try this and tell if it works as wished. It copies all annotations > except those from Acroform. > > List<PDAnnotation> annotations = page.getAnnotations(); > for (PDAnnotation ann : doc.getPage(sourcePage - 1).getAnnotations()) > { > if (ann instanceof PDAnnotationWidget) > { > annotations.add(ann); > } > } > > Tilman > > Am 15.11.2017 um 00:47 schrieb Dale King: > >> I am doing PDF imposition following the SuperImpose example ( >> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main >> /java/org/apache/pdfbox/examples/pdmodel/SuperimposePage.java?view=markup >> ) >> and the content is appearing. What doesn't appear on the superimposed page >> however are the annotations on the original page. >> >> Is it possible to do superimpostion including the annotations? >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Dale King

