Printsetup Papersize

Printsetup Papersize

Anonymous
Not applicable
1,148 Views
1 Reply
Message 1 of 2

Printsetup Papersize

Anonymous
Not applicable

Hello,

 

I'm trying to create some sort of PDF printing app and it's working quite okay, except there is one issue. I cannot find how to change the PaperSize.

 

Example:

PrintManager pm = activeDoc.PrintManager;
                    pm.PrintSetup.CurrentPrintSetting.PrintParameters.PaperPlacement = PaperPlacementType.Center;
                    pm.PrintSetup.CurrentPrintSetting.PrintParameters.ZoomType = ZoomType.Zoom;
                    pm.PrintSetup.CurrentPrintSetting.PrintParameters.PaperSize = ????;

 How can I set my PaperSize? Is it possible to use an Equals string function?

 

Thank you in advance.

0 Likes
Accepted solutions (1)
1,149 Views
1 Reply
Reply (1)
Message 2 of 2

Joe.Ye
Alumni
Alumni
Accepted solution

You can get all available paper size for the current PrintManager by PrintManager.PaperSizes. Then go through the collection of the returned PaperSize objects, find your target one. 

Then assign the target PaperSize object to PaperSize property.

pm.PrintSetup.CurrentPrintSetting.PrintParameters.PaperSize


Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes