Followup on my own post:

I have managed to write a small sample program that create a 'corrupt' pdf file. I have used iText-1.01 to write the pdf and are using full Acrobat 5.0.5 to edit the document fields.

It appears that the problem goes away (at least in the cases I have tested so far) if a /P entry is added to the annotations dicts. The PDF reference doc says that the /P entry is optional but it seems to help.


The patch (against CVS) I've used to test with is attached. Maybe the /P should be added for all annotations, not just for formfields?

regards,
finn
Index: PdfDocument.java
===================================================================
RCS file: /cvsroot/itext/src/com/lowagie/text/pdf/PdfDocument.java,v
retrieving revision 1.173
diff -u -r1.173 PdfDocument.java
--- PdfDocument.java    1 Oct 2003 11:28:05 -0000       1.173
+++ PdfDocument.java    6 Oct 2003 15:22:35 -0000
@@ -713,8 +713,10 @@
                         acroForm.addFieldTemplates(templates);
                 }
                 PdfFormField field = (PdfFormField)dic;
-                if (field.getParent() == null)
+                if (field.getParent() == null) {
+                    field.put(PdfName.P, writer.getCurrentPage());
                     acroForm.addDocumentField(field.getIndirectReference());
+                }
             }
             if (dic.isAnnotation()) {
                 array.add(dic.getIndirectReference());

Reply via email to