dwg2pdf: printing multiple blocks with "-auto-orientation"

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
User avatar
marek.jansa
Newbie Member
Posts: 6
Joined: Thu Feb 04, 2021 9:57 pm
Location: Czech Republic

dwg2pdf: printing multiple blocks with "-auto-orientation"

Post by marek.jansa » Wed Oct 22, 2025 12:32 pm

Hello,
I have an issue when using command line tool dwg2pdf.
When I print one layout/block, the -auto-orientation and -page switches seem to work fine.
When I change the command by using regexp in the block, so that I can print multiple pages into one PDF, then the orientation is always portrait and page settings is reset to A4.

What am I doing wrong, please?

Code: Select all

C:\Program Files\QCAD>dwg2pdf.bat -o "C:\Users\mjansa\Dropbox\Kadlín\Plány\Moje výkresy\Single-page.pdf" -f -auto-orientation -auto-fit -color-correction -p="ISO A3 (297x420)" -block="Stávající_Energie" "C:\Users\mjansa\Dropbox\Kadlín\Plány\Moje výkresy\Tepelná obálka.dxf"
QCAD version  3.32.4
13:30:16: Debug:    loading plugins...
13:30:16: Debug:    RHelpPlugin::init
13:30:16: Debug:    RPolygonPlugin::init
13:30:16: Debug:    RProScriptsPlugin::init
13:30:16: Debug:    RProxiesPlugin::init
13:30:16: Debug:    RTracePlugin::init
13:30:16: Debug:    RDwgPlugin::init
13:30:16: Debug:    loading static plugins...
13:30:17: Debug:    var: "WorkingSet/AttributeIds"
13:30:17: Debug:        val: QVariant(QString, "")
Warning:  old and new property values for property  "Arrow block"  have different types: QString  vs.  int
Converting
  from: C:\Users\mjansa\Dropbox\Kadlín\Plány\Moje výkresy\Tepelná obálka.dxf
  to  : C:\Users\mjansa\Dropbox\Kadlín\Plány\Moje výkresy\Single-page.pdf
13:30:23: Debug:    exporting layout: St?vaj?c?_Energie (*Paper_Space4) [5]
Warning:  RGraphicsViewImage::paintOverlay: no workers

Code: Select all

C:\Program Files\QCAD>dwg2pdf.bat -o "C:\Users\mjansa\Dropbox\Kadlín\Plány\Moje výkresy\Multi-page.pdf" -f -auto-orientation -auto-fit -color-correction -p="ISO A3 (297x420)" -block="Stávající_.*" "C:\Users\mjansa\Dropbox\Kadlín\Plány\Moje výkresy\Tepelná obálka.dxf"
QCAD version  3.32.4
13:29:42: Debug:    loading plugins...
13:29:42: Debug:    RHelpPlugin::init
13:29:42: Debug:    RPolygonPlugin::init
13:29:42: Debug:    RProScriptsPlugin::init
13:29:42: Debug:    RProxiesPlugin::init
13:29:42: Debug:    RTracePlugin::init
13:29:42: Debug:    RDwgPlugin::init
13:29:42: Debug:    loading static plugins...
13:29:43: Debug:    var: "WorkingSet/AttributeIds"
13:29:43: Debug:        val: QVariant(QString, "")
Warning:  old and new property values for property  "Arrow block"  have different types: QString  vs.  int
Converting
  from: C:\Users\mjansa\Dropbox\Kadlín\Plány\Moje výkresy\Tepelná obálka.dxf
  to  : C:\Users\mjansa\Dropbox\Kadlín\Plány\Moje výkresy\Multi-page.pdf
13:29:54: Debug:    exporting layout: St?vaj?c?_Energie (*Paper_Space4) [5]
Warning:  RGraphicsViewImage::paintOverlay: no workers
13:29:54: Debug:    exporting layout: St?vaj?c?_?ezy (*Paper_Space5) [6]
Warning:  RGraphicsViewImage::paintOverlay: no workers
13:29:56: Debug:    exporting layout: St?vaj?c?_P?dorysy (*Paper_Space6) [7]
Warning:  RGraphicsViewImage::paintOverlay: no workers
13:29:58: Debug:    exporting layout: St?vaj?c?_Zateplen? (*Paper_Space) [8]
Warning:  RGraphicsViewImage::paintOverlay: no workers
Thank you,
Regards,
Marek

Windows 11 24H2 64-bit
QCAD Pro 3.32.4.0 (3.32.4)
Attachments
Multi-page.pdf
(1.4 MiB) Downloaded 39 times
Single-page.pdf
(178.85 KiB) Downloaded 39 times
Last edited by marek.jansa on Thu Oct 23, 2025 12:19 pm, edited 1 time in total.

CVH
Premier Member
Posts: 4958
Joined: Wed Sep 27, 2017 4:17 pm

Re: dwg2pdf: printing multiple blocks with "-auto-orientation"

Post by CVH » Wed Oct 22, 2025 2:44 pm

Hi,

The page orientation and size are already defined for each layout block ...
... We might then expect that these are respected.

What happens when you omit: -auto-orientation -auto-fit :?:


There is indeed a known bug with the page orientation for printing directly in combination with the OS native printer driver.
Exporting to PDF and printing the PDF is then a solution for a single or more pages in the same orientation.
Using another printer diver under LINUX is also reported as a possible fix.
See topic: Printing Orientation Issue
But this is a printing issue ...

Regards,
CVH

User avatar
marek.jansa
Newbie Member
Posts: 6
Joined: Thu Feb 04, 2021 9:57 pm
Location: Czech Republic

Re: dwg2pdf: printing multiple blocks with "-auto-orientation"

Post by marek.jansa » Wed Oct 22, 2025 2:57 pm

Dear CVH,

Thank you for looking into this.

I tried what you suggest initially, because I expected the GUI-settings to be respected.
I attach results of the following commands:

Code: Select all

dwg2pdf -o Paper_size_defined.pdf -p="ISO A3 (297x420)" -f -block="Stávající.*" "Tepelná obálka.dxf"
dwg2pdf -o No_options.pdf -f -block="Stávající.*" "Tepelná obálka.dxf"
The result is the same, paper is A4, orientation portrait.

Regards,
Marek
Attachments
Paper_size_defined.pdf
(1.4 MiB) Downloaded 25 times
No_options.pdf
(1.4 MiB) Downloaded 39 times
Windows 11 24H2 64-bit
QCAD Pro 3.32.4.0 (3.32.4)

CVH
Premier Member
Posts: 4958
Joined: Wed Sep 27, 2017 4:17 pm

Re: dwg2pdf: printing multiple blocks with "-auto-orientation"

Post by CVH » Wed Oct 22, 2025 3:09 pm

marek.jansa wrote:
Wed Oct 22, 2025 2:57 pm
because I expected the GUI-settings to be respected.
dwg2pdf does not respect these global preferences that are stored in the drawing file after creating a new file (Drawing Preferences).
And it doesn't use those listed under Application Preferences for a new drawing.
Kinda logical ... :wink:

But we might expect that the Layout preferences per layout are respected. :roll:

Your best option is to report this as a bug in QCAD Bugtracker.
There you need to have or apply for a new account, unrelated to the forum account.

Regards,
CVH

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

Re: dwg2pdf: printing multiple blocks with "-auto-orientation"

Post by andrew » Fri Oct 24, 2025 1:08 pm

marek.jansa: -auto-orientation cannot be used in combination with a block list as the orientation is based on the main drawing (model space).
We will support -auto-orientation on a per block basis for the next release.

Post Reply

Return to “QCAD Troubleshooting and Problems”