Examples of PDFGoTo


Examples of org.apache.fop.pdf.PDFGoTo

     * @param objectNumber
     * the number to be assigned to the new object
     */
    protected void createInternalLinkGoTo(int objectNumber) {
        if (internalLinkGoToPageReference == null) {
            internalLinkGoTo = new PDFGoTo(objectNumber, null);
        } else {
            internalLinkGoTo = new PDFGoTo(objectNumber,
                                           internalLinkGoToPageReference);
        }

        if (xPosition
                != 0)    // if the position is known (if x is known, then y is known)
View Full Code Here

Examples of org.apache.fop.pdf.PDFGoTo

        int count = unfinishedGoTos.size();
        if (count > 0) {
            // TODO : page height may not be the same for all targeted pages
            Point2D.Float defaultPos = new Point2D.Float(0f, pageHeight / 1000f)// top-o-page
            while (!unfinishedGoTos.isEmpty()) {
                PDFGoTo gt = (PDFGoTo) unfinishedGoTos.get(0);
                finishIDGoTo(gt, defaultPos);
            }
            boolean one = count == 1;
            String pl = one ? ""    : "s";
            String ww = one ? "was" : "were";
View Full Code Here

Examples of org.apache.fop.pdf.PDFGoTo

        if (targetID != null && targetID.length() > 0) {
            PageViewport pv = dd.getPageViewport();
            if (pv == null) {
                log.warn("Unresolved destination item received: " + dd.getIDRef());
            }
            PDFGoTo gt = getPDFGoToForID(targetID, pv.getKey());
            pdfDoc.getFactory().makeDestination(
                    dd.getIDRef(), gt.makeReference());
        } else {
            log.warn("DestinationData item with null or empty IDRef received.");
        }
    }
View Full Code Here

Examples of org.apache.fop.pdf.PDFGoTo

        String targetID = bookmarkItem.getIDRef();
        if (targetID != null && targetID.length() > 0) {
            PageViewport pv = bookmarkItem.getPageViewport();
            if (pv != null) {
                String pvKey = pv.getKey();
                PDFGoTo gt = getPDFGoToForID(targetID, pvKey);
                // create outline object:
                PDFOutline parent = parentBookmarkItem != null
                    ? parentBookmarkItem
                    : pdfDoc.getOutlineRoot();
                pdfOutline = pdfDoc.getFactory().makeOutline(parent,
View Full Code Here

Examples of org.apache.fop.pdf.PDFGoTo

     *
     * @return the PDFGoTo that was found or created
     */
    protected PDFGoTo getPDFGoToForID(String targetID, String pvKey) {
        // Already a PDFGoTo present for this target? If not, create.
        PDFGoTo gt = (PDFGoTo) idGoTos.get(targetID);
        if (gt == null) {
            String pdfPageRef = (String) pageReferences.get(pvKey);
            Point2D.Float position = (Point2D.Float) idPositions.get(targetID);
            // can the GoTo already be fully filled in?
            if (pdfPageRef != null && position != null) {
                // getPDFGoTo shares PDFGoTo objects as much as possible.
                // It also takes care of assignObjectNumber and addTrailerObject.
                gt = pdfDoc.getFactory().getPDFGoTo(pdfPageRef, position);
            } else {
                // Not complete yet, can't use getPDFGoTo:
                gt = new PDFGoTo(pdfPageRef);
                pdfDoc.assignObjectNumber(gt);
                // pdfDoc.addTrailerObject() will be called later, from finishIDGoTo()
                unfinishedGoTos.add(gt);
            }
            idGoTos.put(targetID, gt);
View Full Code Here

Examples of org.apache.fop.pdf.PDFGoTo

                                        int relativeIPP, int relativeBPP, AffineTransform tf) {
        Point2D.Float position = new Point2D.Float(relativeIPP / 1000f, relativeBPP / 1000f);
        tf.transform(position, position);
        idPositions.put(id, position);
        // is there already a PDFGoTo waiting to be completed?
        PDFGoTo gt = (PDFGoTo) idGoTos.get(id);
        if (gt != null) {
            finishIDGoTo(gt, pdfPageRef, position);
        }
/*
        // The code below auto-creates a named destination for every id in the document.
View Full Code Here

Examples of org.apache.fop.pdf.PDFGoTo

     * @param objectNumber
     * the number to be assigned to the new object
     */
    protected void createInternalLinkGoTo(int objectNumber) {
        if (internalLinkGoToPageReference == null) {
            internalLinkGoTo = new PDFGoTo(objectNumber, null);
        } else {
            internalLinkGoTo = new PDFGoTo(objectNumber,
                                           internalLinkGoToPageReference);
        }

        if (xPosition
                != 0)    // if the position is known (if x is known, then y is known)
View Full Code Here

Examples of org.apache.fop.pdf.PDFGoTo

        int count = unfinishedGoTos.size();
        if (count > 0) {
            // TODO : page height may not be the same for all targeted pages
            Point2D.Float defaultPos = new Point2D.Float(0f, pageHeight / 1000f)// top-o-page
            while (!unfinishedGoTos.isEmpty()) {
                PDFGoTo gt = (PDFGoTo) unfinishedGoTos.get(0);
                finishIDGoTo(gt, defaultPos);
            }
            boolean one = count == 1;
            String pl = one ? ""    : "s";
            String ww = one ? "was" : "were";
View Full Code Here

Examples of org.apache.fop.pdf.PDFGoTo

        if (targetID != null && targetID.length() > 0) {
            PageViewport pv = dd.getPageViewport();
            if (pv == null) {
                log.warn("Unresolved destination item received: " + dd.getIDRef());
            }
            PDFGoTo gt = getPDFGoToForID(targetID, pv.getKey());
            pdfDoc.getFactory().makeDestination(
                    dd.getIDRef(), gt.makeReference());
        } else {
            log.warn("DestinationData item with null or empty IDRef received.");
        }
    }
View Full Code Here

Examples of org.apache.fop.pdf.PDFGoTo

        String targetID = bookmarkItem.getIDRef();
        if (targetID != null && targetID.length() > 0) {
            PageViewport pv = bookmarkItem.getPageViewport();
            if (pv != null) {
                String pvKey = pv.getKey();
                PDFGoTo gt = getPDFGoToForID(targetID, pvKey);
                // create outline object:
                PDFOutline parent = parentBookmarkItem != null
                    ? parentBookmarkItem
                    : pdfDoc.getOutlineRoot();
                pdfOutline = pdfDoc.getFactory().makeOutline(parent,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.