liuchangliang wrote:
> I could not set the orientation of paper when printing,

That's normal: PDF is the PORTABLE Document Format,
and printer settings are device dependent.
There isn't a way to define printer settings in PDF.

However, since PDF 1.7 (Adobe Reader 8.0 and later),
some viewer preferences were introduced that allow
you to prefill some settings in the print dialog.

Maybe this one can help (p580 if the PDF Reference):

PickTrayByPDFSize boolean
(Optional; PDF 1.7) A flag specifying whether the PDF page
size is used to select the input paper tray. This setting
influences only the preset values used to populate the print
dialog presented by a PDF viewer application.

If PickTrayByPDFSize is true, the check box in the print dialog
associated with input paper tray is checked.

Note: This setting has no effect on Mac OS systems, which do
not provide the ability to pick the input tray by size.

Default value: as defined by the PDF viewer application

> Would you tell me how to set it using itext.

writer.addViewerPreference(
  PdfName.PICKTRAYBYPDFSIZE, PdfBoolean.PDFTRUE);

If this doesn't work as expected, your question is
unanswerable. Actually: you could probably try using
a PS XObject, but that's discouraged by Adobe for a
very good reason, so please don't ask any further.

best regards,
Bruno

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to