Package org.axsl.galley

Examples of org.axsl.galley.PageCollection


    /**
     * If necessary, creates a new page label range entry in the PDF document.
     * @param page The new area tree page being processed.
     */
    private void checkPageLabels(final Page page) {
        final PageCollection currentCollection = page.getParent();
        final PositiveIntegerFormatter currentFormatter =
                currentCollection.getPageNumberFormatter();
        final PdfPageLabelStyle labelStyle = PDFRenderer
                .convertPageLabelStyle(currentFormatter.getType());

        /* Handle special case of the first page. */
        if (this.currentAreaTreePage == null) {
            this.pdfDoc.addPageLabelRange(0, labelStyle,
                    currentCollection.getPageNumberPrefix(), page.getNumber());
            return;
        }

        /* In all other cases, we are looking for changes from the last page. */
        final PageCollection previousCollection =
                this.currentAreaTreePage.getParent();
        if (currentCollection == previousCollection) {
            /* The pages are in the same PageCollection. No new page label range
             * entry is needed. */
            return;
        }
        final PositiveIntegerFormatter previousFormatter =
            previousCollection.getPageNumberFormatter();
        if (currentFormatter.getType() == previousFormatter.getType()
                && currentCollection.getPageNumberPrefix()
                        .equals(previousCollection.getPageNumberPrefix())
                && page.getNumber() == this.pageCount) {
            return;
        }
        this.pdfDoc.addPageLabelRange(this.pageCount - 1, labelStyle,
                currentCollection.getPageNumberPrefix(), page.getNumber());
View Full Code Here

TOP

Related Classes of org.axsl.galley.PageCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.