Message 1 of 8
PrinterManager PrintSetup do not apply settings

Not applicable
10-28-2012
04:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi.
I creatint Revit Addin and need print pdf files. I Use PDFCreator virtual printer. And faced with problem when i set parameters to print manager, for example :
printer.SelectNewPrintDriver(printerNames.FirstOrDefault(g=>g.Contains("PDFCreator"))); printer.PrintToFileName = sPath+fileName; printer.PrintSetup.CurrentPrintSetting.PrintParameters.PaperSize = a4Ps; printer.PrintSetup.CurrentPrintSetting.PrintParameters.PageOrientation = PageOrientationType.Landscape; printer.PrintSetup.InSession.PrintParameters.PageOrientation = PageOrientationType.Landscape; printer.Apply();
when i call SubmitPrint a get pdf with Portrait orientation. All parameters get from print dialog. If i print from print dialog (Ctrl+P) and check Landscape orientation,scale 100% and Center position. Everythig printed correct. And after that i can use ,y PDFCreator from code and they printed correct too.
I suppese that Apply() method didn't work correctly. My PArameters didn't save and passed to PDFCreator from macros.
Does anybody get such problems?
Thanks in advance.
P.S.Sorry for bad english.