dwg2pdf command line auto detetecd page orientation

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
Post Reply
User avatar
regnete
Junior Member
Posts: 13
Joined: Tue Dec 03, 2019 12:34 pm
Location: Germany

dwg2pdf command line auto detetecd page orientation

Post by regnete » Wed Dec 04, 2019 8:19 am

Hi,

we are evaluating qcad to automatically convert dwg files to pdf. Works like a charm in most scenarios, but we are missing a command line flag to let qcad auto detect the page orientation. Pdf files are alwys generated in portrait unless we specify the -l flag for landscape output.

Is there a hidden feature to achieve auto detection for proper page orientation? Are me missing someting in the docs? Would you be willing to implement such a feature?

I guess, the feature has to implemeneted in scripts\Pro\Tools\Dwg2Pdf\Dwg2Pdf.js, but I cannot find the source of this file on github.

Platforms: Linux & Windows
QCad: 3.23.0-trial
Last edited by regnete on Wed Dec 04, 2019 8:38 am, edited 1 time in total.

User avatar
regnete
Junior Member
Posts: 13
Joined: Tue Dec 03, 2019 12:34 pm
Location: Germany

Re: dwg2pdf command line auto detetecd page orientation

Post by regnete » Wed Dec 04, 2019 8:36 am

I guess, the feature has to implmeneted in scripts\Pro\Tools\Dwg2Pdf\Dwg2Pdf.js, but I cannot find the source of this file on github.

User avatar
andrew
Site Admin
Posts: 6480
Joined: Fri Mar 30, 2007 6:07 am

Re: dwg2pdf command line auto detetecd page orientation

Post by andrew » Wed Dec 04, 2019 8:38 am

That sounds like a good idea. I've created a feature request at:
https://www.qcad.org/bugtracker/index.p ... sk_id=2006

For now, you could use the bbox tool first and based on the output decide whether to pass the -l flag to dwg2pdf or not.

User avatar
andrew
Site Admin
Posts: 6480
Joined: Fri Mar 30, 2007 6:07 am

Re: dwg2pdf command line auto detetecd page orientation

Post by andrew » Wed Dec 04, 2019 8:38 am

regnete wrote:
Wed Dec 04, 2019 8:36 am
in scripts\Pro\Tools\Dwg2Pdf\Dwg2Pdf.js, but I cannot find the source of this file on github.
dwg2pdf is part of the QCAD Professional plugin (i.e. proprietary, not open source).

User avatar
regnete
Junior Member
Posts: 13
Joined: Tue Dec 03, 2019 12:34 pm
Location: Germany

Re: dwg2pdf command line auto detetecd page orientation

Post by regnete » Wed Dec 04, 2019 8:48 am

Thank you for the quick reply. Didn't know about bbox. I will give it a try.

User avatar
regnete
Junior Member
Posts: 13
Joined: Tue Dec 03, 2019 12:34 pm
Location: Germany

Re: dwg2pdf command line auto detetecd page orientation

Post by regnete » Fri Dec 06, 2019 9:50 am

bbox works. I use it now to read the size of dwg and then to dynamically build the "-p <width>x<height>"flag for dwg2pdf. This way I get an auto sized pdf for any dwg which always fits. Great!

Post Reply

Return to “QCAD 'How Do I' Questions”