Package org.apache.fop.pdf

Examples of org.apache.fop.pdf.PDFDictionary


   
    /** {@inheritDoc} */
    public void setup(PDFDocument doc) {
        pdfFilter = new CCFFilter();
        pdfFilter.setApplied(true);
        PDFDictionary dict = new PDFDictionary();
        dict.put("Columns", this.image.getSize().getWidthPx());
        int compression = getImage().getCompression();
        switch (compression) {
        case TIFFImage.COMP_FAX_G3_1D :
            dict.put("K", 0);
            break;
        case TIFFImage.COMP_FAX_G3_2D :
            dict.put("K", 1);
            break;
        case TIFFImage.COMP_FAX_G4_2D :
            dict.put("K", -1);
            break;
        default:
            throw new IllegalStateException("Invalid compression scheme: " + compression);
        }
        ((CCFFilter)pdfFilter).setDecodeParms(dict);
View Full Code Here


            //Set up PageLabels
            pageLabels = this.pdfDoc.getFactory().makePageLabels();
            this.pdfDoc.getRoot().setPageLabels(pageLabels);
        }
        PDFNumsArray nums = pageLabels.getNums();
        PDFDictionary dict = new PDFDictionary(nums);
        dict.put("P", page.getPageNumberString());
        //TODO If the sequence of generated page numbers were inspected, this could be
        //expressed in a more space-efficient way
        nums.put(page.getPageIndex(), dict);
    }
View Full Code Here

            //Set up PageLabels
            pageLabels = this.pdfDoc.getFactory().makePageLabels();
            this.pdfDoc.getRoot().setPageLabels(pageLabels);
        }
        PDFNumsArray nums = pageLabels.getNums();
        PDFDictionary dict = new PDFDictionary(nums);
        dict.put("P", pageNumber);
        //TODO If the sequence of generated page numbers were inspected, this could be
        //expressed in a more space-efficient way
        nums.put(pageIndex, dict);
    }
View Full Code Here

     * must then be treated as an artifact.
     */
    MarkedContentInfo addTextContentItem(String structurePointer) {
        MarkedContentInfo mci = addToParentTree(structurePointer);
        if (mci != ARTIFACT) {
            PDFDictionary contentItem = new PDFDictionary();
            contentItem.put("Type", MCR);
            contentItem.put("Pg", this.currentPage);
            contentItem.put("MCID", mci.mcid);
            mci.parent.addKid(contentItem);
        }
        return mci;
    }
View Full Code Here

     */
    void addLinkContentItem(PDFLink link, String structurePointer) {
        int structParent = getNextParentTreeKey();
        link.setStructParent(structParent);
        parentTree.getNums().put(structParent, link);
        PDFDictionary contentItem = new PDFDictionary();
        contentItem.put("Type", OBJR);
        contentItem.put("Pg", this.currentPage);
        contentItem.put("Obj", link);
        PDFStructElem parent = (PDFStructElem) structTreeMap.get(structurePointer);
        parent.addKid(contentItem);
    }
View Full Code Here

public class TrailerDictionary {

    private final PDFDictionary dictionary;

    public TrailerDictionary(PDFDocument pdfDocument) {
        this.dictionary = new PDFDictionary();
        this.dictionary.setDocument(pdfDocument);
    }
View Full Code Here

    }

    private void writeTrailer(OutputStream stream) throws IOException {
        pdf.append("trailer\n");
        stream.write(PDFDocument.encode(pdf.toString()));
        PDFDictionary dictionary = trailerDictionary.getDictionary();
        dictionary.put("/Size", objectReferences.size() + 1);
        dictionary.output(stream);
    }
View Full Code Here

        PDFDocument.outputIndirectObject(helperStream, stream);
    }

    private void populateDictionary() throws IOException {
        int objectCount = objectReferences.size() + 1;
        PDFDictionary dictionary = trailerDictionary.getDictionary();
        dictionary.put("/Type", XREF);
        dictionary.put("/Size", objectCount + 1);
        dictionary.put("/W", new PDFArray(1, 8, 2));
    }
View Full Code Here

    MarkedContentInfo addTextContentItem(PDFStructElem structElem) {
        if (structElem == null) {
            return ARTIFACT;
        } else {
            MarkedContentInfo mci = addToParentTree(structElem);
            PDFDictionary contentItem = new PDFDictionary();
            contentItem.put("Type", MCR);
            contentItem.put("Pg", this.currentPage);
            contentItem.put("MCID", mci.mcid);
            mci.parent.addKid(contentItem);
            return mci;
        }
    }
View Full Code Here

     * @param structureTreeElement its parent structure element
     */
    void addLinkContentItem(PDFLink link, PDFStructElem structureTreeElement) {
        int structParent = getNextParentTreeKey();
        link.setStructParent(structParent);
        PDFDictionary contentItem = new PDFDictionary();
        contentItem.put("Type", OBJR);
        contentItem.put("Pg", this.currentPage);
        contentItem.put("Obj", link);
        parentTree.getNums().put(structParent, structureTreeElement);
        structureTreeElement.addKid(contentItem);
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.pdf.PDFDictionary

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.