When creating PDFs from AutoCAD drawings with powerJobs a lot of the time the paper size is incorrect with the default configuration.
The reason for this is that the paper size needs to be set in the PDF.dwg that is used by powerJobs to get some of the export settings. The file is located at "C:\ProgramData\coolOrange\powerJobs\Modules\Export".
Which setup DWG is used is defined in the script in the -Options parameter of the Export-Document cmdlet. In order to handle differently sized drawings you have to create multiple setup DWGs. One for each paper size. A setup dwg is just a normal DWG with configured page setup. The attached powershell script demonstrates one way to handle this in a job.
- In order for this approach to work you will need a Vault property that contains the paper size
- The function GetAutoCADSetupFile builds a path to the matching setup DWG, based on the paper size that is passed into it. For demonstration purposes A4 portrait and A3 landscape are defined
If your drawing contains multiple layouts with different paper sizes the best solution is to not define a setup DWG. In that case the page setup from the drawing will be taken for the PDF.
You can use the Vault property mappings to get the paper size into Vault. Then you can either fill it manually or change your template files so they contain the drawing size.