int[] structParentMarkPoint = pdf.getStructParentIndexAndNextMarkPoint(getCurrentPage()); int structParent = structParentMarkPoint[0]; int mark = structParentMarkPoint[1]; if (ar.getAsNumber(0) != null) { PdfDictionary dic = new PdfDictionary(PdfName.MCR); dic.put(PdfName.PG, getCurrentPage()); dic.put(PdfName.MCID, new PdfNumber(mark)); ar.add(dic); struc.setPageMark(pdf.getStructParentIndex(getCurrentPage()), -1); struc.put(PdfName.PG, getCurrentPage());
int[] structParentMarkPoint = pdf.getStructParentIndexAndNextMarkPoint(getCurrentPage()); int structParent = structParentMarkPoint[0]; int mark = structParentMarkPoint[1]; if (ar.getAsNumber(0) != null) { PdfDictionary dic = new PdfDictionary(PdfName.MCR); dic.put(PdfName.PG, getCurrentPage()); dic.put(PdfName.MCID, new PdfNumber(mark)); ar.add(dic); struc.setPageMark(pdf.getStructParentIndex(getCurrentPage()), -1); struc.put(PdfName.PG, getCurrentPage());
void addAnnotation(final PdfAnnotation annot) { boolean needToTag = isTagged() && annot.getRole() != null && (!(annot instanceof PdfFormField) || ((PdfFormField)annot).getKids() == null); if (needToTag) { openMCBlock(annot); } writer.addAnnotation(annot); if (needToTag) { PdfStructureElement strucElem = pdf.getStructElement(annot.getId()); if (strucElem != null) { int structParent = pdf.getStructParentIndex(annot); annot.put(PdfName.STRUCTPARENT, new PdfNumber(structParent)); strucElem.setAnnotation(annot, getCurrentPage()); writer.getStructureTreeRoot().setAnnotationMark(structParent, strucElem.getReference()); } closeMCBlock(annot); } }
void addAnnotation(final PdfAnnotation annot) { boolean needToTag = isTagged() && annot.getRole() != null && (!(annot instanceof PdfFormField) || ((PdfFormField)annot).getKids() == null); if (needToTag) { openMCBlock(annot); } writer.addAnnotation(annot); if (needToTag) { PdfStructureElement strucElem = pdf.getStructElement(annot.getId()); if (strucElem != null) { int structParent = pdf.getStructParentIndex(annot); annot.put(PdfName.STRUCTPARENT, new PdfNumber(structParent)); strucElem.setAnnotation(annot, getCurrentPage()); writer.getStructureTreeRoot().setAnnotationMark(structParent, strucElem.getReference()); } closeMCBlock(annot); } }