Skip to content

Commit

Permalink
Make sure /Open for popups reflects XFDF
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasValvekens committed Mar 2, 2022
1 parent 8e5d358 commit 82c1ff4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/itextpdf/research/xfdfmerge/XfdfMerge.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ private void addCommonAnnotationAttributes(PdfAnnotation annotation, AnnotObject
private void addPopupAnnotation(int page, PdfMarkupAnnotation parent, AnnotObject popup) {
if(popup != null) {
PdfPopupAnnotation pdfPopupAnnot = new PdfPopupAnnotation(readAnnotRect(popup));
// TODO set Open based on value in XFDF
pdfPopupAnnot.setOpen(false)
String openProp = popup.getAttributeValue("open");
boolean open = "yes".equals(openProp);
pdfPopupAnnot.setOpen(open)
.setFlags(XfdfObjectReadingUtils.convertFlagsFromString(popup.getAttributeValue(XfdfConstants.FLAGS)));
parent.setPopup(pdfPopupAnnot);
pdfDocument.getPage(page).addAnnotation(pdfPopupAnnot);
Expand Down

0 comments on commit 82c1ff4

Please sign in to comment.