/** * Creates a document from a {@link PdfDocument}. Initializes the first page * with the {@link PdfDocument}'s current default {@link PageSize}. * * @param pdfDoc the in-memory representation of the PDF document */ public Document(PdfDocument pdfDoc) { this(pdfDoc, pdfDoc.getDefaultPageSize()); }
/** * Creates a document from a {@link PdfDocument}. Initializes the first page * with the {@link PdfDocument}'s current default {@link PageSize}. * * @param pdfDoc the in-memory representation of the PDF document */ public Document(PdfDocument pdfDoc) { this(pdfDoc, pdfDoc.getDefaultPageSize()); }
protected PdfPage(PdfDocument pdfDocument) { this(pdfDocument, pdfDocument.getDefaultPageSize()); }
/** * Creates and inserts new page to the document. * * @param index position to addPage page to * @return inserted page * @throws PdfException in case {@code page} is flushed */ public PdfPage addNewPage(int index) { return addNewPage(index, getDefaultPageSize()); }
/** * Creates and adds new page to the end of document. * * @return added page */ public PdfPage addNewPage() { return addNewPage(getDefaultPageSize()); }
protected PageSize addNewPage(PageSize customPageSize) { if (customPageSize != null) { document.getPdfDocument().addNewPage(customPageSize); } else { document.getPdfDocument().addNewPage(); } return customPageSize != null ? customPageSize : document.getPdfDocument().getDefaultPageSize(); }
protected PageSize addNewPage(PageSize customPageSize) { if (customPageSize != null) { document.getPdfDocument().addNewPage(customPageSize); } else { document.getPdfDocument().addNewPage(); } return customPageSize != null ? customPageSize : document.getPdfDocument().getDefaultPageSize(); }