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

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

norman.yuan
Mentor Mentor
9,435 Views
20 Replies
Message 1 of 21

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

norman.yuan
Mentor
Mentor

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

0 Likes
Accepted solutions (1)
9,436 Views
20 Replies
Replies (20)
Message 21 of 21

dana.troushinsky
Observer
Observer

Can you please elaborate on your workaround solution?

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

Thanks!

0 Likes