Package org.apache.pdfbox.pdmodel.edit

Examples of org.apache.pdfbox.pdmodel.edit.PDPageContentStream.fillRect()


            doc.addPage( page );

            PDPageContentStream contentStream = new PDPageContentStream(doc, page);
            //first fill the entire background with cyan
            contentStream.setNonStrokingColor( Color.CYAN );
            contentStream.fillRect( 0,0, page.getMediaBox().getWidth(), page.getMediaBox().getHeight() );

            //then draw a red box in the lower left hand corner
            contentStream.setNonStrokingColor( Color.RED );
            contentStream.fillRect( 10, 10, 100, 100 );
View Full Code Here


            contentStream.setNonStrokingColor( Color.CYAN );
            contentStream.fillRect( 0,0, page.getMediaBox().getWidth(), page.getMediaBox().getHeight() );

            //then draw a red box in the lower left hand corner
            contentStream.setNonStrokingColor( Color.RED );
            contentStream.fillRect( 10, 10, 100, 100 );

            contentStream.close();
            doc.save( file );
        }
        finally
View Full Code Here

        PDDocument srcDoc = new PDDocument();
        PDPage pdPage = new PDPage();
        srcDoc.addPage(pdPage);
        PDPageContentStream pdPageContentStream1 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream1.setNonStrokingColor(Color.black);
        pdPageContentStream1.fillRect(100, 600, 300, 100);
        pdPageContentStream1.close();
        PDPageContentStream pdPageContentStream2 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream2.setNonStrokingColor(Color.red);
        pdPageContentStream2.fillRect(100, 500, 300, 100);
        pdPageContentStream2.close();
View Full Code Here

        pdPageContentStream1.setNonStrokingColor(Color.black);
        pdPageContentStream1.fillRect(100, 600, 300, 100);
        pdPageContentStream1.close();
        PDPageContentStream pdPageContentStream2 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream2.setNonStrokingColor(Color.red);
        pdPageContentStream2.fillRect(100, 500, 300, 100);
        pdPageContentStream2.close();
        PDPageContentStream pdPageContentStream3 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream3.setNonStrokingColor(Color.yellow);
        pdPageContentStream3.fillRect(100, 400, 300, 100);
        pdPageContentStream3.close();
View Full Code Here

        pdPageContentStream2.setNonStrokingColor(Color.red);
        pdPageContentStream2.fillRect(100, 500, 300, 100);
        pdPageContentStream2.close();
        PDPageContentStream pdPageContentStream3 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream3.setNonStrokingColor(Color.yellow);
        pdPageContentStream3.fillRect(100, 400, 300, 100);
        pdPageContentStream3.close();

        srcDoc.save(TESTDIR + CLONESRC);
        PDFMergerUtility merger = new PDFMergerUtility();
        PDDocument dstDoc = new PDDocument();
View Full Code Here

        PDDocument srcDoc = new PDDocument();
        PDPage pdPage = new PDPage();
        srcDoc.addPage(pdPage);
        PDPageContentStream pdPageContentStream1 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream1.setNonStrokingColor(Color.black);
        pdPageContentStream1.fillRect(100, 600, 300, 100);
        pdPageContentStream1.close();
        PDPageContentStream pdPageContentStream2 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream2.setNonStrokingColor(Color.red);
        pdPageContentStream2.fillRect(100, 500, 300, 100);
        pdPageContentStream2.close();
View Full Code Here

        pdPageContentStream1.setNonStrokingColor(Color.black);
        pdPageContentStream1.fillRect(100, 600, 300, 100);
        pdPageContentStream1.close();
        PDPageContentStream pdPageContentStream2 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream2.setNonStrokingColor(Color.red);
        pdPageContentStream2.fillRect(100, 500, 300, 100);
        pdPageContentStream2.close();
        PDPageContentStream pdPageContentStream3 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream3.setNonStrokingColor(Color.yellow);
        pdPageContentStream3.fillRect(100, 400, 300, 100);
        pdPageContentStream3.close();
View Full Code Here

        pdPageContentStream2.setNonStrokingColor(Color.red);
        pdPageContentStream2.fillRect(100, 500, 300, 100);
        pdPageContentStream2.close();
        PDPageContentStream pdPageContentStream3 = new PDPageContentStream(srcDoc, pdPage, true, false);
        pdPageContentStream3.setNonStrokingColor(Color.yellow);
        pdPageContentStream3.fillRect(100, 400, 300, 100);
        pdPageContentStream3.close();

        srcDoc.save(TESTDIR + CLONESRC);
        PDFMergerUtility merger = new PDFMergerUtility();
        PDDocument dstDoc = new PDDocument();
View Full Code Here

            doc.addPage( page );

            PDPageContentStream contentStream = new PDPageContentStream(doc, page);
            //first fill the entire background with cyan
            contentStream.setNonStrokingColor( Color.CYAN );
            contentStream.fillRect( 0,0, page.findMediaBox().getWidth(), page.findMediaBox().getHeight() );

            //then draw a red box in the lower left hand corner
            contentStream.setNonStrokingColor( Color.RED );
            contentStream.fillRect( 10, 10, 100, 100 );
View Full Code Here

            contentStream.setNonStrokingColor( Color.CYAN );
            contentStream.fillRect( 0,0, page.findMediaBox().getWidth(), page.findMediaBox().getHeight() );

            //then draw a red box in the lower left hand corner
            contentStream.setNonStrokingColor( Color.RED );
            contentStream.fillRect( 10, 10, 100, 100 );

            contentStream.close();
            doc.save( file );
        }
        finally
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.