/** * Translate a PR-object to a Pdf-object */ protected PdfObject copyObject(PdfObject in) throws IOException,BadPdfFormatException { return copyObject(in, false, false); }
/** * Translate a PR-object to a Pdf-object */ protected PdfObject copyObject(PdfObject in) throws IOException,BadPdfFormatException { return copyObject(in, false, false); }
/** * Translate a PRArray to a PdfArray. Also translate all of the objects contained * in it */ protected PdfArray copyArray(PdfArray in, boolean keepStruct, boolean directRootKids) throws IOException, BadPdfFormatException { PdfArray out = new PdfArray(in.size()); for (Iterator<PdfObject> i = in.listIterator(); i.hasNext();) { PdfObject value = i.next(); parentObjects.put(value, in); PdfObject res = copyObject(value, keepStruct, directRootKids); if (res != null) out.add(res); } return out; }
/** * Translate a PRArray to a PdfArray. Also translate all of the objects contained * in it */ protected PdfArray copyArray(PdfArray in, boolean keepStruct, boolean directRootKids) throws IOException, BadPdfFormatException { PdfArray out = new PdfArray(in.size()); for (Iterator<PdfObject> i = in.listIterator(); i.hasNext();) { PdfObject value = i.next(); parentObjects.put(value, in); PdfObject res = copyObject(value, keepStruct, directRootKids); if (res != null) out.add(res); } return out; }
/** * Translate a PRStream to a PdfStream. The data part copies itself. */ protected PdfStream copyStream(PRStream in) throws IOException, BadPdfFormatException { PRStream out = new PRStream(in, null); for (Object element : in.getKeys()) { PdfName key = (PdfName) element; PdfObject value = in.get(key); parentObjects.put(value, in); PdfObject res = copyObject(value); if (res != null) out.put(key, res); } return out; }
/** * Translate a PRStream to a PdfStream. The data part copies itself. */ protected PdfStream copyStream(PRStream in) throws IOException, BadPdfFormatException { PRStream out = new PRStream(in, null); for (Object element : in.getKeys()) { PdfName key = (PdfName) element; PdfObject value = in.get(key); parentObjects.put(value, in); PdfObject res = copyObject(value); if (res != null) out.put(key, res); } return out; }
page.mergedFields.add(copyObject(ref));
page.mergedFields.add(copyObject(ref));
PdfObject res = copyObject(obj, keepStructure, directRootKids); if (disableIndirects.contains(obj)) iRef.setNotCopied();
PdfObject res = copyObject(obj, keepStructure, directRootKids); if (disableIndirects.contains(obj)) iRef.setNotCopied();
if (!key.equals(PdfName.B) && !key.equals(PdfName.PARENT)) { parentObjects.put(value, in); PdfObject res = copyObject(value, keepStruct, directRootKids); if (res != null) out.put(key, res); res = structureTreeRoot.getReference(); } else { res = copyObject(value, keepStruct, directRootKids);
if (!key.equals(PdfName.B) && !key.equals(PdfName.PARENT)) { parentObjects.put(value, in); PdfObject res = copyObject(value, keepStruct, directRootKids); if (res != null) out.put(key, res); res = structureTreeRoot.getReference(); } else { res = copyObject(value, keepStruct, directRootKids);
structureTreeRoot.setPageMark(newArrayNumber, nullReference); } else { PdfObject res = writer.copyObject(numObj, true, false); if (firstNotNullKid == null) firstNotNullKid = res; structureTreeRoot.setPageMark(newArrayNumber, (PdfIndirectReference) res); if (k == null) return returnType.NOTFOUND; PdfObject res = writer.copyObject(obj1, true, false); structureTreeRoot.setAnnotationMark(newArrayNumber, (PdfIndirectReference)res); } else
structureTreeRoot.setPageMark(newArrayNumber, nullReference); } else { PdfObject res = writer.copyObject(numObj, true, false); if (firstNotNullKid == null) firstNotNullKid = res; structureTreeRoot.setPageMark(newArrayNumber, (PdfIndirectReference) res); if (k == null) return returnType.NOTFOUND; PdfObject res = writer.copyObject(obj1, true, false); structureTreeRoot.setAnnotationMark(newArrayNumber, (PdfIndirectReference)res); } else