Package org.apache.pdfbox.pdmodel.edit

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


                        }
                        contentStream = new PDPageContentStream(doc, page);
                        contentStream.setFont( font, fontSize );
                        contentStream.beginText();
                        y = page.getMediaBox().getHeight() - margin + height;
                        contentStream.moveTextPositionByAmount(
                            margin, y );

                    }
                    //System.out.println( "Drawing string at " + x + "," + y );
View Full Code Here


                    if( contentStream == null )
                    {
                        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();
            contentStream.setFont(fontHelveticaOblique, 11);
            contentStream.moveTextPositionByAmount(xpos, ypos);
            contentStream.drawString(footer);
            contentStream.endText();
        } finally {
            contentStream.close();
        }
View Full Code Here

            PDPage pg = new PDPage(PDPage.PAGE_SIZE_LETTER);
            PDPageContentStream contentStream = new PDPageContentStream(doc, pg);

            contentStream.beginText();
            contentStream.setFont(font, fontSize);
            contentStream.moveTextPositionByAmount(margin, top);

            for (String line : page) {
                contentStream.drawString(line);
                contentStream.moveTextPositionByAmount(0, -fontSize);
            }
View Full Code Here

            contentStream.setFont(font, fontSize);
            contentStream.moveTextPositionByAmount(margin, top);

            for (String line : page) {
                contentStream.drawString(line);
                contentStream.moveTextPositionByAmount(0, -fontSize);
            }

            contentStream.endText();
            contentStream.close();
            doc.addPage(pg);
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.