Examples of PDFDocument


Examples of org.apache.fop.pdf.PDFDocument

        assertEquals(cal2.getTime(), info.getModDate());
    }

    @Test
    public void testXMPUpdate() throws Exception {
        PDFDocument doc = new PDFDocument("SuperFOP");
        PDFInfo info = doc.getInfo();
        info.setTitle("MyTitle");
        info.setSubject("MySubject");
        info.setAuthor("That's me");
        info.setKeywords("XSL-FO XML");
        //info.setProducer("SuperFOP");
View Full Code Here

Examples of org.apache.fop.pdf.PDFDocument

    @Test
    public void testSetupWithIndexColorModel() {
        IndexColorModel cm = mock(IndexColorModel.class);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        PDFDocument doc = mock(PDFDocument.class);
        PDFProfile profile = mock(PDFProfile.class);
        ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
        ImageSize is = RawPNGTestUtil.getImageSize();

        when(irpng.getColorModel()).thenReturn(cm);
        // when(cm.hasAlpha()).thenReturn(false);
        when(doc.getProfile()).thenReturn(profile);
        when(profile.getPDFAMode()).thenReturn(PDFAMode.PDFA_1A);
        when(irpng.getSize()).thenReturn(is);
        irpnga.setup(doc);
        FlateFilter filter = (FlateFilter) irpnga.getPDFFilter();
        assertEquals(1, filter.getColors());
View Full Code Here

Examples of org.apache.fop.pdf.PDFDocument

    @Test
    public void testSetupWithComponentColorModel() throws IOException {
        ComponentColorModel cm = mock(ComponentColorModel.class);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        PDFDocument doc = mock(PDFDocument.class);
        PDFProfile profile = mock(PDFProfile.class);
        ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
        ImageSize is = RawPNGTestUtil.getImageSize();

        when(irpng.getColorModel()).thenReturn(cm);
        when(cm.getNumComponents()).thenReturn(3);
        // when(cm.hasAlpha()).thenReturn(false);
        when(doc.getProfile()).thenReturn(profile);
        when(profile.getPDFAMode()).thenReturn(PDFAMode.PDFA_1A);
        when(irpng.getSize()).thenReturn(is);
        irpnga.setup(doc);
        FlateFilter filter = (FlateFilter) irpnga.getPDFFilter();
        assertEquals(3, filter.getColors());
View Full Code Here

Examples of org.apache.fop.pdf.PDFDocument

            throws IOException {
        int numColorComponents = gray > -1 ? 1 : 3;
        int numComponents = numColorComponents + (alpha > -1 ? 1 : 0);
        ComponentColorModel cm = mock(ComponentColorModel.class);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        PDFDocument doc = mock(PDFDocument.class);
        PDFProfile profile = mock(PDFProfile.class);
        ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
        ImageSize is = RawPNGTestUtil.getImageSize();

        when(irpng.getColorModel()).thenReturn(cm);
        when(cm.getNumComponents()).thenReturn(numComponents);
        // when(cm.hasAlpha()).thenReturn(false);
        when(doc.getProfile()).thenReturn(profile);
        when(profile.getPDFAMode()).thenReturn(PDFAMode.PDFA_1A);
        when(irpng.getSize()).thenReturn(is);
        irpnga.setup(doc);
        FlateFilter filter = (FlateFilter) irpnga.getPDFFilter();
        assertEquals(numColorComponents, filter.getColors());
View Full Code Here

Examples of org.apache.fop.pdf.PDFDocument

    private CrossReferenceObject crossReferenceObject;

    @Before
    public void setUp() throws UnsupportedEncodingException {
        pdfDocument = new PDFDocument("Apache FOP");
        Map<String, List<String>> filterMap = pdfDocument.getFilterMap();
        filterMap.put("default", Arrays.asList("null"));
        PDFRoot root = new PDFRoot(1, new PDFPages(10));
        PDFInfo info = new PDFInfo();
        info.setObjectNumber(2);
View Full Code Here

Examples of org.apache.fop.pdf.PDFDocument

     * using curves and not the font.
     */
    public PDFDocumentGraphics2D(boolean textAsShapes) {
        super(textAsShapes);

        this.pdfDoc = new PDFDocument("Apache FOP Version " + Version.getVersion()
                + ": PDFDocumentGraphics2D");
        this.pdfContext = new PDFContext();
        this.colorHandler = new PDFColorHandler(this.pdfDoc.getResources());
    }
View Full Code Here

Examples of org.apache.fop.pdf.PDFDocument

     * @throws ConfigurationException if an error occurs while configuring the object
     */
    public void configure(PDFDocumentGraphics2D graphics, Configuration cfg,
                          boolean useComplexScriptFeatures )
            throws ConfigurationException {
        PDFDocument pdfDoc = graphics.getPDFDocument();

        //Filter map
        pdfDoc.setFilterMap(
                PDFRendererConfigurator.buildFilterMapFromConfiguration(cfg));

        //Fonts
        try {
            FontInfo fontInfo = createFontInfo(cfg, useComplexScriptFeatures);
View Full Code Here

Examples of org.apache.fop.pdf.PDFDocument

        }

        String producer = userAgent.getProducer() != null ? userAgent.getProducer() : "";

        if (maxPDFVersion == null) {
            this.pdfDoc = new PDFDocument(producer);
        } else {
            VersionController controller
                    = VersionController.getFixedVersionController(maxPDFVersion);
            this.pdfDoc = new PDFDocument(producer, controller);
        }
        updateInfo();
        updatePDFProfiles();
        pdfDoc.setFilterMap(filterMap);
        pdfDoc.outputHeader(out);
View Full Code Here

Examples of org.apache.fop.pdf.PDFDocument

            FontSetup.setup(fontInfo, this.pdfContext.getFontList(), null);
            //FontState fontState = new FontState("Helvetica", "normal",
            //                          FontInfo.NORMAL, 12, 0);
        }

        this.pdfDoc = new PDFDocument("Apache FOP: SVG to PDF Transcoder");

        if (this.cfg != null) {
            this.pdfDoc.setFilterMap(
                PDFFilterList.buildFilterMapFromConfiguration(cfg));
        }
View Full Code Here

Examples of org.apache.fop.pdf.PDFDocument

    public void startRenderer(OutputStream stream) throws IOException {
        if (userAgent == null) {
            throw new IllegalStateException("UserAgent must be set before starting the renderer");
        }
        ostream = stream;
        this.pdfDoc = new PDFDocument(
                userAgent.getProducer() != null ? userAgent.getProducer() : "");
        this.pdfDoc.getProfile().setPDFAMode(this.pdfAMode);
        this.pdfDoc.getProfile().setPDFXMode(this.pdfXMode);
        this.pdfDoc.getInfo().setCreator(userAgent.getCreator());
        this.pdfDoc.getInfo().setCreationDate(userAgent.getCreationDate());
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.