Results 1 to 1 of 1

Thread: PDFBox java

  1. #1
    baseball43v3r is offline Member
    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    Default PDFBox java

    Hey all, New user here so go easy, as I know this seems like a very specific question.

    I'm using pdfbox on a form I created and it's in eclipse. I can save the form with values I've set in it, but I cannot print the form with markup's (my set values). Does anyone know the correct way to do it? I've attached my code for peruse.

    Java Code:
    		PDDocument doc = null;
    		
    	   try{
                doc = PDDocument.load("resources/orderForm.pdf");
                PDDocumentCatalog docCatalog = doc.getDocumentCatalog();
                PDAcroForm acroForm = docCatalog.getAcroForm();
                PDField field = acroForm.getField("Qty1");
                field.setValue("JohnTest");
    
                
            } catch (IOException ie){
                System.out.println(ie);
            }
            //doc.addPage(new PDPage());
            try{
            	
                doc.save("Empty PDF.pdf");
            	//doc.silentPrint();
                doc.print();
                doc.close();
            } catch (Exception io){
                System.out.println(io);
            }
    
    	}
    Last edited by baseball43v3r; 01-26-2013 at 01:51 AM. Reason: edited code

Similar Threads

  1. PDFBox Problem
    By aliki_arg in forum Advanced Java
    Replies: 3
    Last Post: 11-30-2011, 12:23 PM
  2. PDFBox 1.6 and Java 1.4.2
    By apelleti in forum New To Java
    Replies: 0
    Last Post: 08-09-2011, 11:21 AM
  3. PDFBOX table
    By khenzi07 in forum Advanced Java
    Replies: 0
    Last Post: 07-23-2011, 06:46 AM
  4. Coordinates in PDFBox
    By arunsegar in forum Advanced Java
    Replies: 1
    Last Post: 05-16-2011, 09:41 AM
  5. PdfBox and barcode fonts
    By alexre2005 in forum New To Java
    Replies: 5
    Last Post: 12-03-2009, 02:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •