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

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

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

MPN
Active Member
Posts: 34
Joined: Sun Oct 27, 2019 3:33 pm

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

Post by MPN » Wed Nov 13, 2019 8:33 am

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').

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

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

Post by andrew » Wed Nov 13, 2019 11:02 am

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

MPN
Active Member
Posts: 34
Joined: Sun Oct 27, 2019 3:33 pm

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

Post by MPN » Wed Nov 13, 2019 11:11 am

Splendid! Thank you for the quick response.

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

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

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

Post by andrew » 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.

MPN
Active Member
Posts: 34
Joined: Sun Oct 27, 2019 3:33 pm

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

Post by MPN » Thu Nov 14, 2019 10:40 am

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.

MPN
Active Member
Posts: 34
Joined: Sun Oct 27, 2019 3:33 pm

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

Post by MPN » Fri Nov 15, 2019 11:33 am

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

drf5n
Registered Member
Posts: 2
Joined: Mon Sep 28, 2020 5:11 am

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

Post by drf5n » Mon Sep 28, 2020 9:51 pm

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.

Post Reply

Return to “QCAD 'How Do I' Questions”