You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by ya...@jmueller.de on 2013/03/15 11:46:55 UTC

duplex print

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: yannic.ramm@jmueller.de<ma...@jmueller.de>
Visit us on www.jmueller.de<http://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<http://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.
[cid:00a5-0001@01ce216a.69a2c036] Please consider the environment before printing this e-mail.

AW: duplex print

Posted by ya...@jmueller.de.
Hello Maruan,

thank you for your help. That worked for me.
Didn't realize that the Viewer Preferences are not evaluated.

Greetings
Yannic Ramm
Yannic Ramm

J. Müller Aktiengesellschaft
26919 Brake, Germany

Phone: +49 4401 914136
Mail to: yannic.ramm@jmueller.de
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.

-----Ursprüngliche Nachricht-----
Von: Maruan Sahyoun [mailto:sahyoun@fileaffairs.de]
Gesendet: Freitag, 15. März 2013 12:18
An: users@pdfbox.apache.org
Betreff: Re: duplex print

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 <ya...@jmueller.de>:

> 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: yannic.ramm@jmueller.de
> 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.



Re: duplex print

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
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 <ya...@jmueller.de>:

> 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: yannic.ramm@jmueller.de
> 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.