/** * Use this method to reorder the pages in the document. * A <CODE>null</CODE> argument value only returns the number of pages to process. * It is advisable to issue a <CODE>Document.newPage()</CODE> before using this method. * @return the total number of pages * @param order an array with the new page sequence. It must have the * same size as the number of pages. * @throws DocumentException if all the pages are not present in the array */ public int reorderPages(int[] order) throws DocumentException { return root.reorderPages(order); }
/** * Use this method to make sure the page tree has a linear structure * (every leave is attached directly to the root). * Use this method to allow page reordering with method reorderPages. */ public void setLinearPageMode() { root.setLinearMode(null); }
/** * Adds a blank page. * @param rect The page dimension * @param rotation The rotation angle in degrees * @since 2.1.5 */ public void addPage(Rectangle rect, int rotation) { PdfRectangle mediabox = new PdfRectangle(rect, rotation); PageResources resources = new PageResources(); PdfPage page = new PdfPage(mediabox, new HashMap(), resources.getResources(), 0); page.put(PdfName.TABS, getTabs()); root.addPage(page); ++currentPageNumber; }
PdfDictionary dic = reader.getPageN(page); PdfIndirectReference pageRef = getNewReference(reader.getPageOrigRef(page)); PdfIndirectReference parent = root.addPageRef(pageRef); dic.put(PdfName.PARENT, parent); propagate(dic, pageRef, false);
addSharedObjectsToBody(); PdfIndirectReference rootRef = root.writePageTree();
/** * Adds a blank page. * @param rect The page dimension * @param rotation The rotation angle in degrees * @since 2.1.5 */ public void addPage(Rectangle rect, int rotation) { PdfRectangle mediabox = new PdfRectangle(rect, rotation); PageResources resources = new PageResources(); PdfPage page = new PdfPage(mediabox, new HashMap(), resources.getResources(), 0); page.put(PdfName.TABS, getTabs()); root.addPage(page); ++currentPageNumber; }
PdfDictionary dic = reader.getPageN(page); PdfIndirectReference pageRef = getNewReference(reader.getPageOrigRef(page)); PdfIndirectReference parent = root.addPageRef(pageRef); dic.put(PdfName.PARENT, parent); propagate(dic, pageRef, false);
addSharedObjectsToBody(); PdfIndirectReference rootRef = root.writePageTree();
/** * Adds a blank page. * * @param rect The page dimension * @param rotation The rotation angle in degrees * @since 2.1.5 */ public void addPage(Rectangle rect, int rotation) { PdfRectangle mediabox = new PdfRectangle(rect, rotation); PageResources resources = new PageResources(); PdfPage page = new PdfPage(mediabox, new HashMap<>(), resources.getResources(), 0); page.put(PdfName.TABS, getTabs()); root.addPage(page); ++currentPageNumber; }
/** * Use this method to reorder the pages in the document. * A <CODE>null</CODE> argument value only returns the number of pages to process. * It is advisable to issue a <CODE>Document.newPage()</CODE> before using this method. * @return the total number of pages * @param order an array with the new page sequence. It must have the * same size as the number of pages. * @throws DocumentException if all the pages are not present in the array */ public int reorderPages(int order[]) throws DocumentException { return root.reorderPages(order); }
/** * Use this method to make sure the page tree has a linear structure * (every leave is attached directly to the root). * Use this method to allow page reordering with method reorderPages. */ public void setLinearPageMode() { root.setLinearMode(null); }
PdfDictionary dic = reader.getPageN(page); PdfIndirectReference pageRef = getNewReference(reader.getPageOrigRef(page)); PdfIndirectReference parent = root.addPageRef(pageRef); dic.put(PdfName.PARENT, parent); propagate(dic, pageRef, false);
addSharedObjectsToBody(); PdfIndirectReference rootRef = root.writePageTree();
/** * 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; }
/** * Use this method to reorder the pages in the document. * A <CODE>null</CODE> argument value only returns the number of pages to process. * It is advisable to issue a <CODE>Document.newPage()</CODE> before using this method. * @return the total number of pages * @param order an array with the new page sequence. It must have the * same size as the number of pages. * @throws DocumentException if all the pages are not present in the array */ public int reorderPages(int order[]) throws DocumentException { return root.reorderPages(order); }
/** * Use this method to make sure the page tree has a linear structure * (every leave is attached directly to the root). * Use this method to allow page reordering with method reorderPages. */ public void setLinearPageMode() { root.setLinearMode(null); }
/** * 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 = 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; }
page.put(PdfName.GROUP, pp); root.addPage(page); currentPageNumber++; return null;
page.put(PdfName.GROUP, pp); root.addPage(page); currentPageNumber++; return null;