Page 2 of 2

Re: How to print multiple Layout blocks to one PDF file

Posted: Wed Nov 13, 2019 8:33 am
by MPN
Hi Andrew

Thinking more about this problem I would prefer that when specifying a comma separated list of blocks for the command line then that explicit ordering would be used when printing.
This would support having multiple 'printing sets'. E.g from the same drawing (dxf file) I sometimes need to print two different pdf's:

3Layout,1Layout,2Layout (in this order)

and

1Layout,Layout2,Layout3,Layout4 (in this order)

To achieve this I would create two .bat scripts with these explicit definitions.

I hope this is achievable in some way while still supporting regular expressions. Or by a new parameter for the command line (e.g 'layout-order').

Re: How to print multiple Layout blocks to one PDF file

Posted: Wed Nov 13, 2019 11:02 am
by andrew
I've settled for:

Code: Select all

      -block=BLOCK_NAMES  Comma-separated list of block(s) or 
                          layout(s) to export
                          List may include regular expressions
                          List defines order of export unless
                          -block-sort is used
                          A block may be exported more than once
                          unless -block-unique is used
      -block-sort         Sort blocks in natural order
                          Layouts are sorted by tab order
                          and exported before blocks
                          Blocks are ordered alphanumerically
      -block-unique       Export every matching block only once

Re: How to print multiple Layout blocks to one PDF file

Posted: Wed Nov 13, 2019 11:11 am
by MPN
Splendid! Thank you for the quick response.

Let me know when you want me to test it out.

Re: How to print multiple Layout blocks to one PDF file

Posted: Thu Nov 14, 2019 9:06 am
by andrew
The latest dwg2pdf included in QCAD Snapshot 3.23.0.6 contains these switches if you wish to test them.

Re: How to print multiple Layout blocks to one PDF file

Posted: Thu Nov 14, 2019 10:40 am
by MPN
andrew wrote:
Thu Nov 14, 2019 9:06 am
The latest dwg2pdf included in QCAD Snapshot 3.23.0.6 contains these switches if you wish to test them.
Thanks, I will test it tomorrow.

Re: How to print multiple Layout blocks to one PDF file

Posted: Fri Nov 15, 2019 11:33 am
by MPN
Andrew,
It works perfectly. I'm now able to print different pdf's from the same dxf file, with blocks in the order I want. Christmas came early this year.
Thank you for implementing this.

Cheers,
Mads

Re: [solved] How to print multiple Layout blocks to one PDF file

Posted: Mon Sep 28, 2020 9:51 pm
by drf5n
The dwg2pds supports printing multiple layout blocks into one PDF file on Mac as well:

Code: Select all

drf$  /Applications/QCAD-Pro.app/Contents/Resources/dwg2pdf  -a -f -block="Layout1,Layout2" -m 5 -landscape -p "A4"  2020/qcad_test1.dxf 
QCAD version  3.25.2
Warning:  RPropertyTypeId::generateId: property already initialized:  7RObject : "" : "Invisible"
12:24:25: Debug:    calling odInitialize
12:24:25: Debug:    dropped global XDATA (no res buf):  "ViewportCenter"
Converting
  from: /Users/drf/2020/qcad_test1.dxf
  to  : /Users/drf/2020/qcad_test1.pdf
12:24:26: Debug:    exporting layout: Layout1 (*Paper_Space0) [0]
12:24:26: Debug:    exporting layout: Layout2 (*Paper_Space) [2]
drf$ open 2020/qcad_test1.pdf 
It took me a bit to realize how to create multiple layouts or multiple paper spaces with the Block/Add Layout Block(BL) with the documentation at https://qcad.org/en/tutorial-working-wi ... -viewports -- The tutorial does show images listing multiple layouts, and it does mention the creating layouts, but it doesn't demonstrate the process.