0
votes

I created a fillable PDF using Adobe Acrobat pro and tagged the input fields. Tagged Content, Tagged annotations, Tagged Form Fields passed in the Accessibility check for the document I am trying to fill using itext. I am getting this error when i am trying to fill the document from java code using itext library.

ERROR com.itextpdf.kernel.pdf.PdfDocument - Tag structure initialization failed, tag structure is ignored, it might be corrupted.
com.itextpdf.kernel.PdfException: StructParent index not found in tagged object.
              at com.itextpdf.kernel.pdf.tagging.ParentTreeHandler.registerMcr(ParentTreeHandler.java:182)
              at com.itextpdf.kernel.pdf.tagging.ParentTreeHandler.registerAllMcrs(ParentTreeHandler.java:266)
              at com.itextpdf.kernel.pdf.tagging.ParentTreeHandler.<init>(ParentTreeHandler.java:104)
              at com.itextpdf.kernel.pdf.tagging.PdfStructTreeRoot.<init>(PdfStructTreeRoot.java:82)
              at com.itextpdf.kernel.pdf.PdfDocument.tryInitTagStructure(PdfDocument.java:1937)
              at com.itextpdf.kernel.pdf.PdfDocument.open(PdfDocument.java:1709)
              at com.itextpdf.kernel.pdf.PdfDocument.<init>(PdfDocument.java:293)
              at com.itextpdf.kernel.pdf.PdfDocument.<init>(PdfDocument.java:261)

pdf link: https://drive.google.com/file/d/1KO772GQbolJ0oNMAzsdGPrLqfUtRcKbs/view?usp=sharing

1
Please share the PDF in question. - mkl
Which iText 7 version exactly do you use? I tested opening it with the current 7.1.14 and could do so without any problem. - mkl
I am using 7.0.7 - user3373325
Have you tried updating? Probably itext meanwhile has been hardened against such problem pdfs. - mkl
I did try using the latest version(7.1.14 too), but still had the same problem. - user3373325

1 Answers

0
votes

I removed all the field tags and retagged the whole documents using "Autotag form fields" in the "Accessibility" menu. This fixed the issue.