Package org.apache.pdfbox.pdmodel.edit

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


                    {
                        throw new IOException( "Error:Expected non-null content stream." );
                    }
                    contentStream.moveTextPositionByAmount( 0, -height);
                    y -= height;
                    contentStream.drawString( nextLineToDraw.toString() );
                }


            }
View Full Code Here


            contentStream.beginText();

            int i = 0;
            // text scaling combined with rotation
            contentStream.setTextMatrix(12, 0, 0, 12, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.setTextMatrix(0, 18, -18, 0, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.setTextMatrix(-24, 0, 0, -24, centeredXPosition, centeredYPosition*1.5);
 
View Full Code Here

            // text scaling combined with rotation
            contentStream.setTextMatrix(12, 0, 0, 12, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.setTextMatrix(0, 18, -18, 0, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.setTextMatrix(-24, 0, 0, -24, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.setTextMatrix(0, -30, 30, 0, centeredXPosition, centeredYPosition*1.5);
 
View Full Code Here

            contentStream.setTextMatrix(0, 18, -18, 0, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.setTextMatrix(-24, 0, 0, -24, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.setTextMatrix(0, -30, 30, 0, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.endText();
View Full Code Here

            contentStream.setTextMatrix(-24, 0, 0, -24, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.setTextMatrix(0, -30, 30, 0, centeredXPosition, centeredYPosition*1.5);
            contentStream.drawString( message + " " +i++);

            contentStream.endText();
            contentStream.close();

            doc.save( outfile );
View Full Code Here

                PDPageContentStream contentStream = new PDPageContentStream(document, page);
                contentStream.beginText();
                contentStream.setFont( font, 18 );
                contentStream.moveTextPositionByAmount( inch, ph-inch-18);
                contentStream.drawString( "PDFBox" );
                contentStream.moveTextPositionByAmount( 0,-(inch/2));
                contentStream.drawString( "Click Here" );
                contentStream.endText();

                contentStream.close();
View Full Code Here

                contentStream.beginText();
                contentStream.setFont( font, 18 );
                contentStream.moveTextPositionByAmount( inch, ph-inch-18);
                contentStream.drawString( "PDFBox" );
                contentStream.moveTextPositionByAmount( 0,-(inch/2));
                contentStream.drawString( "Click Here" );
                contentStream.endText();

                contentStream.close();

                // Now add the markup annotation, a highlight to PDFBox text
View Full Code Here

            PDPageContentStream contentStream = new PDPageContentStream(doc, page);
            contentStream.beginText();
            contentStream.setFont( font, 12 );
            contentStream.moveTextPositionByAmount( 100, 700 );
            contentStream.drawString( message );
            contentStream.endText();
            contentStream.close();
            doc.save( file );
        }
        finally
View Full Code Here

            // counterclockwise rotation
            for (int i=0;i<8;i++)
            {
                contentStream.setTextRotation(i*Math.PI*0.25, centeredXPosition,
                        pageSize.getHeight()-centeredYPosition);
                contentStream.drawString( message + " " + i);
            }
            // clockwise rotation
            for (int i=0;i<8;i++)
            {
                contentStream.setTextRotation(-i*Math.PI*0.25, centeredXPosition, centeredYPosition);
View Full Code Here

            }
            // clockwise rotation
            for (int i=0;i<8;i++)
            {
                contentStream.setTextRotation(-i*Math.PI*0.25, centeredXPosition, centeredYPosition);
                contentStream.drawString( message + " " + i);
            }

            contentStream.endText();
            contentStream.close();

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.