问题
Can any one tell me how to override page orientation selection in pdf print dialog using iTextSharp.
I am using these lines to override scaling and "Choose paper source by PDF page size"
writer.AddViewerPreference(PdfName.PRINTSCALING,PdfName.NONE);
writer.AddViewerPreference(PdfName.PICKTRAYBYPDFSIZE, PdfBoolean.PDFFALSE);
回答1:
Please check table 150, entitled "Entries in a viewer preferences dictionary", in ISO-32000-1 (you can download a copy from the Adobe web site). It contains all the viewer preferences you can define in a PDF document, including PrintScaling and PickTrayByPDFSize, but you won't find any setting to override the page orientation selection.
In other words: you're asking something that isn't defined in the PDF specification, and as a result, it isn't implemented in any PDF library (as far as I know).
来源:https://stackoverflow.com/questions/19856671/how-can-i-override-pdf-print-dialog-settings-with-itextsharp