internal PageRefs(PageRefs other, PdfReader reader) { this.reader = reader; this.sizep = other.sizep; if (other.refsn != null) { refsn = new List<PRIndirectReference>(other.refsn); for (int k = 0; k < refsn.Count; ++k) { refsn[k] = (PRIndirectReference)DuplicatePdfObject(refsn[k], reader); } } else this.refsp = (IntHashtable)other.refsp.Clone(); }
/** Creates an independent duplicate. * @param reader the <CODE>PdfReader</CODE> to duplicate */ public PdfReader(PdfReader reader) { this.appendable = reader.appendable; this.consolidateNamedDestinations = reader.consolidateNamedDestinations; this.encrypted = reader.encrypted; this.rebuilt = reader.rebuilt; this.sharedStreams = reader.sharedStreams; this.tampered = reader.tampered; this.password = reader.password; this.pdfVersion = reader.pdfVersion; this.eofPos = reader.eofPos; this.freeXref = reader.freeXref; this.lastXref = reader.lastXref; this.newXrefType = reader.newXrefType; this.tokens = new PRTokeniser(reader.tokens.SafeFile); if (reader.decrypt != null) this.decrypt = new PdfEncryption(reader.decrypt); this.pValue = reader.pValue; this.rValue = reader.rValue; this.xrefObj = new List<PdfObject>(reader.xrefObj); for (int k = 0; k < reader.xrefObj.Count; ++k) { this.xrefObj[k] = DuplicatePdfObject(reader.xrefObj[k], this); } this.pageRefs = new PageRefs(reader.pageRefs, this); this.trailer = (PdfDictionary)DuplicatePdfObject(reader.trailer, this); this.catalog = trailer.GetAsDict(PdfName.ROOT); this.rootPages = catalog.GetAsDict(PdfName.PAGES); this.fileLength = reader.fileLength; this.partial = reader.partial; this.hybridXref = reader.hybridXref; this.objStmToOffset = reader.objStmToOffset; this.xref = reader.xref; this.cryptoRef = (PRIndirectReference)DuplicatePdfObject(reader.cryptoRef, this); this.ownerPasswordUsed = reader.ownerPasswordUsed; }
virtual protected internal void ReadPages() { catalog = trailer.GetAsDict(PdfName.ROOT); if(catalog == null) throw new InvalidPdfException(MessageLocalization.GetComposedMessage("the.document.has.no.catalog.object")); rootPages = catalog.GetAsDict(PdfName.PAGES); if(rootPages == null) throw new InvalidPdfException(MessageLocalization.GetComposedMessage("the.document.has.no.page.root")); pageRefs = new PageRefs(this); }
virtual protected internal void ReadPages() { catalog = trailer.GetAsDict(PdfName.ROOT); if(catalog == null) throw new InvalidPdfException(MessageLocalization.GetComposedMessage("the.document.has.no.catalog.object")); rootPages = catalog.GetAsDict(PdfName.PAGES); if (rootPages == null || !PdfName.PAGES.Equals(rootPages.Get(PdfName.TYPE))) { if (debugmode ) { if (LOGGER.IsLogging(Level.ERROR)) { LOGGER.Error(MessageLocalization.GetComposedMessage("the.document.has.no.page.root")); } } else { throw new InvalidPdfException(MessageLocalization.GetComposedMessage("the.document.has.no.page.root")); } } pageRefs = new PageRefs(this); }
protected internal void ReadPages() { catalog = trailer.GetAsDict(PdfName.ROOT); rootPages = catalog.GetAsDict(PdfName.PAGES); pageRefs = new PageRefs(this); }
internal PageRefs(PageRefs other, PdfReader reader) { this.reader = reader; this.sizep = other.sizep; if (other.refsn != null) { refsn = new ArrayList(other.refsn); for (int k = 0; k < refsn.Count; ++k) { refsn[k] = DuplicatePdfObject((PdfObject)refsn[k], reader); } } else this.refsp = (IntHashtable)other.refsp.Clone(); }