Exemple #1
0
        /**
         * convenience method. Given an importedpage, set our "globals"
         */
        protected int SetFromIPage(PdfImportedPage iPage)
        {
            int pageNum            = iPage.PageNumber;
            PdfReaderInstance inst = currentPdfReaderInstance = iPage.PdfReaderInstance;

            reader = inst.Reader;
            SetFromReader(reader);
            return(pageNum);
        }
Exemple #2
0
 internal PdfImportedPage(PdfReaderInstance readerInstance, PdfWriter writer, int pageNumber)
 {
     this.readerInstance = readerInstance;
     this.pageNumber     = pageNumber;
     this.writer         = writer;
     bBox = readerInstance.Reader.GetPageSize(pageNumber);
     SetMatrix(1, 0, 0, 1, -bBox.Left, -bBox.Bottom);
     type = TYPE_IMPORTED;
 }
Exemple #3
0
        /**
         * Signals that the <CODE>Document</CODE> was closed and that no other
         * <CODE>Elements</CODE> will be added.
         * <P>
         * The pages-tree is built and written to the outputstream.
         * A Catalog is constructed, as well as an Info-object,
         * the referencetable is composed and everything is written
         * to the outputstream embedded in a Trailer.
         */

        public override void Close()
        {
            if (open)
            {
                PdfReaderInstance ri = currentPdfReaderInstance;
                pdf.Close();
                base.Close();
                if (ri != null)
                {
                    try {
                        ri.Reader.Close();
                        ri.ReaderFile.Close();
                    }
                    catch (IOException) {
                        // empty on purpose
                    }
                }
            }
        }