Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having trouble setting PrintParameter values. The following code runs, and the PrintSetup saves, but the PageOrientation value never changes to Portrait. What am I missing? Thanks.
Document activeDoc = commandData.Application.ActiveUIDocument.Document;
var trans = new Transaction(activeDoc, "PrintSettings");
trans.Start();
activeDoc.PrintManager.PrintSetup.CurrentPrintSetting.PrintParameters.PageOrientation = PageOrientationType.Portrait;
activeDoc.PrintManager.PrintSetup.SaveAs("MyPrintSettings");
PrintSetting myPs = activeDoc.GetPrintSettingIds(). Select(activeDoc.get_Element). Cast<PrintSetting>(). FirstOrDefault(printSetting => printSetting.Name == "MyPrintSettings");
activeDoc.PrintManager.PrintSetup.CurrentPrintSetting = myPs; trans.Commit();
--
Bobby C. Jones
Bobby C. Jones
Solved! Go to Solution.