You can convert dwg to pdf document with the command line application VeryPDF AutoCAD to PDF Converter Command Line which can realize different kinds of functions.
You can download the application AutoCAD to PDF Converter to your computer and then double click the installer to install it on your computer until you successfully install it.
In the installation folder, you can see the executable file dwg2pdf.exe which is the called program in the conversion from dwg to pdf. It is the most important element in this conversion.
If you don’t know how to use this command line application and want to know its usage, please drag the executable file dwg2pdf.exe and drop it into MS-DOS interface and hit Enter button on the keyboard. Please see the usage of the application in Figure 1.
Figure 1
By following the example template shown in the command line usage, you can write down your own command line to convert dwg to pdf. Please see the following example:
dwg2pdf -i C:\input.dwg -o C:\output.pdf
dwg2pdf -b 3 -a "Author" -i C:\input.dwg -o C:\output.pdf
The first command line is to convert the input file C:\input.dwg to output file C:\output.pdf by calling the executable file dwg2pdf.exe. The second command line is to convert the input file C:\input.dwg to output file C:\output.pdf by calling the executable file dwg2pdf.exe and create 256 color pdf file with the option –b 3, set pdf author as Author.
Please remember that you need to input the path of each file used in the command line and hit Enter button to run the conversion from dwg to pdf when you write done the command line.
If you want to see how to convert dwg to pdf by GUI application, you can read this article. If you want to know more information about AutoCAD to PDF Converter, please visit its homepage.
You can also use VeryDOC DWG to Vector Converter Command Line to convert from DWG and DXF files to PDF files from command line,
https://www.verydoc.com/dwg-to-vector.html