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

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?

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



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)
Multi-page.pdf (1.4 MB)
Single-page.pdf (179 KB)

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 :question:


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

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:

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
Paper_size_defined.pdf (1.4 MB)
No_options.pdf (1.4 MB)

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. :unamused:

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

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.