Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set media (papaer) name when plotting to PDF/DWF

20 REPLIES 20
SOLVED
Reply
Message 1 of 21
norman.yuan
8223 Views, 20 Replies

How to set media (papaer) name when plotting to PDF/DWF

I am building a tool to plot layout content of drawing to PDF/DWF file. The issue I have is that the required output paper size is not a standard paper size (i.e. the paper size does not exists in paper list when the "DWG To PDF.pc3" is selected.

 

In order to plot programmatically, we have to create a PlotSettingsValidator and call

 

PlotSettingsValidator.SetPlotConfigurationName(plotSettings, plotDeviceName, mediaName)

 

For the 3 required arguments:

 

plotSettings: it is copied from current Layout

plotDeviceNameL it will be "DWG To PDF.pc3"

mediaName: ? this is the one I could not decide, because with the available paper list there isn't one that matches the paper size required by the layout.

 

When doing plot to PDF manually in AutoCAD, user would get prompted for using the selected device (PDF.pc3)'s default paper or use a cutom paper size. If choosing to use custom paper size, AutoCAD add a custom paper size into PDF.pc3 in memory. Here is what I could not find: the corresponding API of adding custom paper size to PDF/DWF pc3 device to match required layout paper size.

 

All the PDF plotting samples I can find online (such as Kean's posts on plotting) use a know paper size when SetPlotConfigurationName() is called, thus, not helpful.

 

Does anyone have clue on this?

 

Norman Yuan

Drive CAD With Code

EESignature

20 REPLIES 20
Message 21 of 21
dana.troushinsky
in reply to: fieldguy

Can you please elaborate on your workaround solution?

I would to try it but don't know where to start

Thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report