Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9238839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:51:12+00:00 2026-06-18T07:51:12+00:00

I am working with PDFBOX and the documentation on it seems sparse so I’ve

  • 0

I am working with PDFBOX and the documentation on it seems sparse so I’ve come here for some help. I am trying to print out a pdf form that I’ve created, with fields populated dynamically by eclipse. I can get it to import and print, but when I do print, the fields I’ve set don’t show up (although they do when I save it to HDD). Can someone point me to the settings to set visible when printing? I saw itext had something similar, and I’m hoping that PDFBox does too.

Here is my current code.

PDDocument doc = null;

   try{
        doc = PDDocument.load("resources/orderForm.pdf");
        PDDocumentCatalog docCatalog = doc.getDocumentCatalog();
        PDAcroForm acroForm = docCatalog.getAcroForm();
        PDField field = acroForm.getField("Orderer");
        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);
}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:51:13+00:00Added an answer on June 18, 2026 at 7:51 am

    found my answer, can’t use pdfbox to do it, although the alternative is just as simple. Use the desktop to print the file! example code as follows

        public void printOrder(){
        try {
            File myFile = new File(finished);
            //Desktop.getDesktop().open(myFile);
            Desktop.getDesktop().print(myFile);
            doc.close();
        } catch (IOException ex) {
            // no application registered for PDFs
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on some check-in functionality for an application, and trying to figure out the
Working on a project using Entity Framework (4.3.1.0). I'm trying to figure out how
I am trying to extract text with all information from the pdf using pdfbox.
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
Working on game where plates will be falling from top to bottom. Some plates
Working on OSX 10.8.2 After a fresh install of CocoaPods. I'm trying to $
Working on a new project in Laravel 4 (a.k.a Illuminate) I'm trying to create
Working on MVC 3 application with some CRUD operations with jQuery ajax. I post
Working on something and having problems with some code. The scenario is that an
Working with hibernate and spring social, I am trying to query the database by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.