Package org.apache.pdfbox.pdmodel.edit

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


        doc.addPage( page );

        PDJpeg xImage = new PDJpeg( doc, img );

        PDPageContentStream contentStream = new PDPageContentStream( doc, page );
        contentStream.drawImage( xImage, ( pdRect.getWidth() - w ) / 2, ( pdRect.getHeight() - h ) / 2 );
        contentStream.close();
    }

    private void writePage( ApplicationDetailDescriptor descriptor )
    {
View Full Code Here


                //ximage = new PDPixelMap(doc, awtImage);
                throw new IOException( "Image type not supported:" + image );
            }
            PDPageContentStream contentStream = new PDPageContentStream(doc, page);

            contentStream.drawImage( ximage, 20, 20 );

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

                //ximage = new PDPixelMap(doc, awtImage);
                throw new IOException( "Image type not supported:" + image );
            }
            PDPageContentStream contentStream = new PDPageContentStream(doc, page, true, true);

            contentStream.drawImage( ximage, 20, 20 );

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