/** * Translate a PRIndirectReference to a PdfIndirectReference * In addition, translates the object numbers, and copies the * referenced object to the output file. * NB: PRIndirectReferences (and PRIndirectObjects) really need to know what * file they came from, because each file has its own namespace. The translation * we do from their namespace to ours is *at best* heuristic, and guaranteed to * fail under some circumstances. */ protected PdfIndirectReference copyIndirect(PRIndirectReference in) throws IOException, BadPdfFormatException { return copyIndirect(in, false, false); }
/** * Translate a PRIndirectReference to a PdfIndirectReference * In addition, translates the object numbers, and copies the * referenced object to the output file. * NB: PRIndirectReferences (and PRIndirectObjects) really need to know what * file they came from, because each file has its own namespace. The translation * we do from their namespace to ours is *at best* heuristic, and guaranteed to * fail under some circumstances. */ protected PdfIndirectReference copyIndirect(PRIndirectReference in) throws IOException, BadPdfFormatException { return copyIndirect(in, false, false); }
private void addKid(PdfObject obj) throws IOException, BadPdfFormatException { if (!obj.isIndirect()) return; PRIndirectReference currRef = (PRIndirectReference)obj; RefKey key = new RefKey(currRef); if (!writer.indirects.containsKey(key)) { writer.copyIndirect(currRef, true, false); } PdfIndirectReference newKid = writer.indirects.get(key).getRef(); if (writer.updateRootKids) { addKid(structureTreeRoot, newKid); writer.structureTreeRootKidsForReaderImported(reader); } }
private void addKid(PdfObject obj) throws IOException, BadPdfFormatException { if (!obj.isIndirect()) return; PRIndirectReference currRef = (PRIndirectReference)obj; RefKey key = new RefKey(currRef); if (!writer.indirects.containsKey(key)) { writer.copyIndirect(currRef, true, false); } PdfIndirectReference newKid = writer.indirects.get(key).getRef(); if (writer.updateRootKids) { addKid(structureTreeRoot, newKid); writer.structureTreeRootKidsForReaderImported(reader); } }
if (!keepStruct && !directRootKids) return copyIndirect((PRIndirectReference)in); else return copyIndirect((PRIndirectReference)in, keepStruct, directRootKids); case PdfObject.ARRAY: return copyArray((PdfArray)in, keepStruct, directRootKids);
if (!keepStruct && !directRootKids) return copyIndirect((PRIndirectReference)in); else return copyIndirect((PRIndirectReference)in, keepStruct, directRootKids); case PdfObject.ARRAY: return copyArray((PdfArray)in, keepStruct, directRootKids);