Guest User

Untitled

a guest
Jul 16th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. List<PDPage> pages = pdDoc.getDocumentCatalog().getAllPages();
  2.  
  3. if(pages.size() > 0){
  4. PDJpeg img = new PDJpeg(pdDoc, in);
  5. PDPageContentStream stream = new PDPageContentStream(pdDoc,pages.get(0));
  6. stream.drawImage(img, 60, 60);
  7. stream.close();
  8. }
  9.  
  10. PDPageContentStream stream = new PDPageContentStream( pdDoc, pages.get(0));
  11.  
  12. PDPageContentStream stream = new PDPageContentStream( pdDoc, pages.get(0), true, true);
  13.  
  14. doc = PDDocument.load( inputFileName );
  15. PDXObjectImage ximage = null;
  16. ximage = new PDJpeg(doc, new FileInputStream( image )
  17. PDPage page = (PDPage)doc.getDocumentCatalog().getAllPages().get(0);
  18. PDPageContentStream contentStream = new PDPageContentStream(doc, page, true, true);
  19. contentStream.drawImage( ximage, 425, 675 );
  20. contentStream.close();
  21.  
  22. PDPage page = new PDPage();
  23. outputdocument.addPage(page);
  24. PDPageContentStream contentStream = new PDPageContentStream(outputdocument, page, AppendMode.APPEND, true);
  25. PDImageXObject pdImageXObject = JPEGFactory.createFromImage(outputdocument, out);
  26. contentStream.drawImage(pdImageXObject, 5, 2, 600, 750);
  27. contentStream.close();
Add Comment
Please, Sign In to add comment