Hi,

AFAIK when printing via PDFBox the Viewer Preference is not evaluated. But you 
can set the duplex option on the print job. Have a look at PrintPDF [1] how 
that can be done.

Maruan Sahyoun

[1] 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/PrintPDF.java?view=markup


Am 15.03.2013 um 11:46 schrieb <[email protected]>:

> Hello everyone,
>  
> I’m trying to figure out how to do a duplex print.
> I did something like this:
> PDViewerPreferences _vp = _doc.getDocumentCatalog().getViewerPreferences();
>        if (_vp == null)
>               _vp = new 
> PDViewerPreferences(_doc.getDocumentInformation().getDictionary());
>        _vp.setDuplex(PDViewerPreferences.DUPLEX.DuplexFlipLongEdge);
>        _doc.getDocumentCatalog().setViewerPreferences(_vp);
> On my PDDocument with two pages but when I do a print() or silentPrint() it 
> comes out as two pages.
> Although if I save the pdf-file and open it in Adobe Reader and print it from 
> there it is printed as duplex.
>  
> Can anybody help me with this problems?
>  
> Greetings and thanks
> Yannic
>  
> Yannic Ramm
> J. Müller Aktiengesellschaft
> 26919 Brake, Germany
> 
> Phone: +49 4401 914136
> Mail to: [email protected]
> Visit us on www.jmueller.de
> 
> J. Müller Aktiengesellschaft
> Aktiengesellschaft mit dem Sitz in 26919 Brake/Unterweser
> eingetragen Amtsgericht Oldenburg HRB 202523
> Vorsitzender des Aufsichtsrates: Norbert Schmelzle
> Vorstand: Jan Müller (Vors.), Thomas Bielefeld, Jürgen Huntgeburth, Martin 
> Pieper
>  
> Aufträge übernehmen wir nur zu unseren Allgemeinen Geschäfts- und 
> Betriebsbedingungen neuester Fassung, die wir auf Anforderung gerne zusenden 
> bzw. die über unsere Internetpräsenz www.jmueller.de abgefragt werden können.
>  
> Diese E-Mail und alle damit übertragenen Dateien sind nur für den Empfänger 
> bestimmt. Wenn Sie diese E-Mail erhalten haben, obwohl sie nicht an Sie 
> gerichtet ist, informieren Sie bitte den Absender und vernichten Sie diese 
> E-Mail - vielen Dank.
> This email and any files transmitted with it are intended solely for the use 
> of the individual or entity to whom they are addressed. If you have received 
> this email in error please notify the sender and delete the message - thank 
> you.
>  Please consider the environment before printing this e-mail.

Reply via email to