/** * convenience method. Given a reader, set our "globals" */ protected void setFromReader(PdfReader reader) { this.reader = reader; indirects = indirectMap.get(reader); if (indirects == null) { indirects = new HashMap<>(); indirectMap.put(reader, indirects); PdfDictionary catalog = reader.getCatalog(); PRIndirectReference ref; PdfObject o = catalog.get(PdfName.ACROFORM); if (o == null || o.type() != PdfObject.INDIRECT) { return; } ref = (PRIndirectReference) o; if (acroForm == null) { acroForm = body.getPdfIndirectReference(); } indirects.put(new RefKey(ref), new IndirectReferences(acroForm)); } }
RefKey key = new RefKey(in); IndirectReferences iRef = indirects.get(key); if (iRef != null) {
RefKey key = new RefKey(in); IndirectReferences iRef = (IndirectReferences) indirects.get(key); if (iRef != null) {
RefKey key = new RefKey(in); IndirectReferences iRef = (IndirectReferences) indirects.get(key); if (iRef != null) {
RefKey key = new RefKey(in); IndirectReferences iRef = (IndirectReferences)indirects.get(key); if (iRef != null) {
return; // bugfix by John Englar RefKey key = new RefKey(hisRef); PdfIndirectReference myRef; IndirectReferences iRef = indirects.get(key);
RefKey key = new RefKey(in); IndirectReferences iRef = (IndirectReferences)indirects.get(key); if (iRef != null) {
hisRef = (PRIndirectReference)o; if (hisRef == null) return; // bugfix by John Englar RefKey key = new RefKey(hisRef); PdfIndirectReference myRef; IndirectReferences iRef = (IndirectReferences)indirects.get(key);
RefKey key = new RefKey(in); IndirectReferences iRef = indirects.get(key); if (iRef != null) {
hisRef = (PRIndirectReference)o; if (hisRef == null) return; // bugfix by John Englar RefKey key = new RefKey(hisRef); PdfIndirectReference myRef; IndirectReferences iRef = (IndirectReferences)indirects.get(key);
/** * Add an imported page to our output * * @param iPage an imported page * @throws IOException, BadPdfFormatException */ public void addPage(PdfImportedPage iPage) throws IOException, BadPdfFormatException { int pageNum = setFromIPage(iPage); PdfDictionary thePage = reader.getPageN(pageNum); PRIndirectReference origRef = reader.getPageOrigRef(pageNum); reader.releasePage(pageNum); RefKey key = new RefKey(origRef); PdfIndirectReference pageRef; IndirectReferences iRef = indirects.get(key); if (iRef != null && !iRef.getCopied()) { pageReferences.add(iRef.getRef()); iRef.setCopied(); } pageRef = getCurrentPage(); if (iRef == null) { iRef = new IndirectReferences(pageRef); indirects.put(key, iRef); } iRef.setCopied(); PdfDictionary newPage = copyDictionary(thePage); root.addPage(newPage); ++currentPageNumber; }
/** * Add an imported page to our output * @param iPage an imported page * @throws IOException, BadPdfFormatException */ public void addPage(PdfImportedPage iPage) throws IOException, BadPdfFormatException { int pageNum = setFromIPage(iPage); PdfDictionary thePage = reader.getPageN(pageNum); PRIndirectReference origRef = reader.getPageOrigRef(pageNum); reader.releasePage(pageNum); RefKey key = new RefKey(origRef); PdfIndirectReference pageRef; IndirectReferences iRef = (IndirectReferences)indirects.get(key); if (iRef != null && !iRef.getCopied()) { pageReferences.add(iRef.getRef()); iRef.setCopied(); } pageRef = getCurrentPage(); if (iRef == null) { iRef = new IndirectReferences(pageRef); indirects.put(key, iRef); } iRef.setCopied(); PdfDictionary newPage = copyDictionary(thePage); root.addPage(newPage); ++currentPageNumber; }
/** * Add an imported page to our output * @param iPage an imported page * @throws IOException, BadPdfFormatException */ public void addPage(PdfImportedPage iPage) throws IOException, BadPdfFormatException { int pageNum = setFromIPage(iPage); PdfDictionary thePage = reader.getPageN(pageNum); PRIndirectReference origRef = reader.getPageOrigRef(pageNum); reader.releasePage(pageNum); RefKey key = new RefKey(origRef); PdfIndirectReference pageRef; IndirectReferences iRef = (IndirectReferences)indirects.get(key); if (iRef != null && !iRef.getCopied()) { pageReferences.add(iRef.getRef()); iRef.setCopied(); } pageRef = getCurrentPage(); if (iRef == null) { iRef = new IndirectReferences(pageRef); indirects.put(key, iRef); } iRef.setCopied(); PdfDictionary newPage = copyDictionary(thePage); root.addPage(newPage); ++currentPageNumber; }
/** * convenience method. Given a reader, set our "globals" */ protected void setFromReader(PdfReader reader) { this.reader = reader; indirects = (HashMap)indirectMap.get(reader); if (indirects == null) { indirects = new HashMap(); indirectMap.put(reader,indirects); PdfDictionary catalog = reader.getCatalog(); PRIndirectReference ref = null; PdfObject o = catalog.get(PdfName.ACROFORM); if (o == null || o.type() != PdfObject.INDIRECT) return; ref = (PRIndirectReference)o; if (acroForm == null) acroForm = body.getPdfIndirectReference(); indirects.put(new RefKey(ref), new IndirectReferences(acroForm)); } } /**
/** * convenience method. Given a reader, set our "globals" */ protected void setFromReader(PdfReader reader) { this.reader = reader; indirects = (HashMap)indirectMap.get(reader); if (indirects == null) { indirects = new HashMap(); indirectMap.put(reader,indirects); PdfDictionary catalog = reader.getCatalog(); PRIndirectReference ref = null; PdfObject o = catalog.get(PdfName.ACROFORM); if (o == null || o.type() != PdfObject.INDIRECT) return; ref = (PRIndirectReference)o; if (acroForm == null) acroForm = body.getPdfIndirectReference(); indirects.put(new RefKey(ref), new IndirectReferences(acroForm)); } } /**