- Knowledge base
- powerJobs Processor
- Troubleshooting
Export-Document: No PDF from AutoCAD drawings is created for non existing config file passed in the -Options parameter
Issue
When creating a PDF file from an AutoCAD drawing and passing a non existing config DWG file to the -Options parameter of the Export-Document Cmdlet, the PDF is not created and there are no errors in the log file.
Cause
Currently under investigation
Solution
Make sure to pass an existing config file in the -Options parameter of the Export-Document Cmdlet. Additionally you can use Test-Path to check if the PDF file exists in the localPdfFileLocation:
# Make sure the PDF.dwg file exists in "C:\programData\coolOrange\powerJobs\Modules\Export"
$configFile = "$($env:POWERJOBS_MODULESDIR)Export\PDF.dwg"
$exportResult = Export-Document -Format 'PDF' -To $localPDFfileLocation -Options $configFile
if (-not (Test-Path $localPDFfileLocation)) {
throw("PDF Export failed")
}