Posted By

markt22 on 09/27/17


Tagged

PDFBox


Versions (?)

PDFBox: Add author to PDF Document


 / Published in: Java
 

Creates a new PDF Document with a single page, sets the author and then saves.

  1. /**
  2.  * @param args the command line arguments
  3.  * @throws java.io.IOException
  4.  */
  5. public static void main(String[] args) throws IOException {
  6. PDDocument document = new PDDocument();
  7. PDPage blankPage = new PDPage();
  8.  
  9. document.addPage(blankPage);
  10.  
  11. PDDocumentInformation info = document.getDocumentInformation();
  12. info.setAuthor("Mark");
  13.  
  14. document.save("");
  15. document.close();
  16. }

Report this snippet  

You need to login to post a comment.