PDF Export in Java
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/11413173/java-pdf-export-print">Java PDF Export / Print</a>  </p>
</blockquote>



<p>I have a code that gathers data together extracting those from input fields (Java) and then uses the data to export to a PDF Document. As soon as i click on my export button, it just pops up a window whether i want to open or save the document.</p>

<p>What i am trying to do now is to have a print button, as soon as i click on there, it should just send that document whatever the export button would generate to the printer. is there a way to define that specific temp file?</p>

<p>my code for the export button is as follows:</p>

<pre><code>    form.add(new Button("Ausführen") {
        private static final long serialVersionUID = 1L;

        public void onSubmit() {

            if(role.getValue().equals("2")) {
                    try {
                        ManagerModel manager = managerDao.getManager(person);
                        PictureModel picture = new PictureModel();
                        if (person.getPhotoId() != null)
                            picture = new PictureModel(pictureDao.findPictureById(person.getPhotoId()));
                        getRequestCycle().setRequestTarget( new FileRequestTarget(Exporter.exportFile(person, manager, picture), person.getPdfName()));
                    } catch (Exception e) {
                        Log.warn(e);
                    }
</code></pre>
