How can I override PDF print dialog settings with iTextSharp

左心房为你撑大大i 提交于 2020-01-05 04:50:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!