[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

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

Post by MPN » Sat Nov 09, 2019 5:08 pm

Hi,

I'm in a situation where I'm ready to print my architectural drawings. I have one master block and 4 layout blocks where I have layouted various viewports in different scales. I'm using A4 landscape in the Drawing Preferences -> Page. This all works really well. Great workflow.

I can select one Layout block at a time and print that layout (both to paper and to PDF).

Now I want to print my 4 layout blocks, but I can't find a way to print all 4 pages in to one PDF file or to print all 4 layout blocks to paper.
I can see the multi-page printing settings but that is not what I'm aiming for (I do not need to stitch drawings together; they are separate layouts).

Any help is appreciated.

Thanks.
Last edited by MPN on Fri Nov 15, 2019 11:38 am, edited 2 times in total.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

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

Post by Husky » Sat Nov 09, 2019 9:34 pm

Hi,
MPN wrote:
Sat Nov 09, 2019 5:08 pm
I can select one Layout block at a time and print that layout (both to paper and to PDF).
Correct - that is how the current QCAD version is indent to work.

MPN wrote:
Sat Nov 09, 2019 5:08 pm
Now I want to print my 4 layout blocks, but I can't find a way to print all 4 pages in to one PDF file or to print all 4 layout blocks to paper.
I can see the multi-page printing settings but that is not what I'm aiming for (I do not need to stitch drawings together; they are separate layouts).
You could use a workaround ....
To trigger an "all in one print" (pdf or paper) you could create an additional Layout Block. Name it e.g. "All layout blocks". Collect all content from the other Layout Blocks with the help of the clipboard (copy/paste). On this way you can create a multi page print which will print all paper prints or a pdf in one task.

Do I think that is a perfect solution? Nope - but the best what I can think of .....
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

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 » Sun Nov 10, 2019 12:59 pm

Thank you, will try that out and see how the workflow is.

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 » Sun Nov 10, 2019 1:29 pm

Yes that works for me. But it has some problems when I added more pages later.

I started out creating 1 column and 3 rows. Copy pasted my viewports and page headers. This worked well. I could now print to one file.

But then I wanted to add 2 extra pages for additional drawings. But the 2 extra pages was inserted _above_ my existing drawings so I had to move contents two pages up (by selecting and dragging them upwards).
I would expect new pages would be added after the existing ones. Should this be reported as a bug or is it by design?

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

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

Post by Husky » Sun Nov 10, 2019 9:01 pm

MPN wrote:
Sun Nov 10, 2019 1:29 pm
I would expect new pages would be added after the existing ones.
Yes, me too. It is counterproductive if you have to rearrange everything just because you added pages - especially if you print pdf's.
MPN wrote:
Sun Nov 10, 2019 1:29 pm
Should this be reported as a bug ...
Yes, I would second that.
MPN wrote:
Sun Nov 10, 2019 1:29 pm
... or is it by design?
I doubt that e_surprised


I encourage you also to file a "Feature request" to print multiple Layout Blocks at once. Yes I know that my workaround works but at the end of the day it is still a workaround.

To file a bug report or feature request please use this URL:

https://www.qcad.org/bugtracker

Note: You have to be registered for the bugtracker - your QCAD forum registration will not work there.
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

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

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

Post by andrew » Mon Nov 11, 2019 8:48 am

The multipage feature is intended to print large drawings 1:1 on multiple pages to be stuck together as a poster. There is no "before" or "after" when adding pages. Adding more pages vertically will indeed expand the available paper space toward the top (Y+) which you might perceive as "before", but really is just following the direction of the coordinate system (X+ -> right, Y+ -> top).

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

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

Post by Husky » Mon Nov 11, 2019 9:09 am

That is the kind of insider knowledge what I don't have. :wink:
andrew wrote:
Mon Nov 11, 2019 8:48 am
... ut really is just following the direction of the coordinate system (X+ -> right, Y+ -> top).
Question: If it just follow the coordinate system could a X+ -> right, Y- -> bottom cover the issue?
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

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 » Mon Nov 11, 2019 11:02 am

andrew wrote:
Mon Nov 11, 2019 8:48 am
The multipage feature is intended to print large drawings 1:1 on multiple pages to be stuck together as a poster. There is no "before" or "after" when adding pages. Adding more pages vertically will indeed expand the available paper space toward the top (Y+) which you might perceive as "before", but really is just following the direction of the coordinate system (X+ -> right, Y+ -> top).
Thanks that explains the behavior. I can probably work around this by using a horizontal layout instead. For example use 1 row and 5 columns. Then adding more columns would be added 'after' the other pages.

DougVW
Junior Member
Posts: 16
Joined: Mon Jan 08, 2018 5:03 pm

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

Post by DougVW » Mon Nov 11, 2019 4:43 pm

I don't know if command line printing to PDF would be another solution for you. Andrew added multi-page output to Dwg2Pdf for QCAD v3.22.

Here's an example of a 3-page PDF export from Linux command line:

/usr/share/httpd/opt/qcad-3.22.0-pro-linux-x86_64/dwg2pdf -platform offscreen -a -f -block="Layout2,Layout3,Layout4" -m 5 -landscape -p "A4" mydrawing.dxf

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 » Tue Nov 12, 2019 9:56 am

DougVW wrote:
Mon Nov 11, 2019 4:43 pm
Here's an example of a 3-page PDF export from Linux command line:
Hi Doug,
Thanks. That is great info as well! That is actually what I need since the the Multipage setup is too slow to work with when having lots of pages.

I created this .bat file (I'm on Windows) that does exactly what I need: I can keep using single layout files and print by executing the bat file.

This might be useful for other users so pasting my bat file here:

Code: Select all

@echo off
title Printing to PDF

rem This file can be placed in any folder but the following info needs to be set up for every drawing:
set file_to_print="C:/MyWork/CAD Drawings/QCAD/BuildingForCustomer.dxf"
set blocks_to_print="Layout1,Layout2,Layout3,SomeLayout4"
set qcad_installation_folder="C:\Program Files\QCAD\"

rem Set the working directory to the QCAD installation folder so qcad.exe can be found when running dwg2pdf.bat.
pushd %qcad_installation_folder%
call "dwg2pdf.bat" -block=%blocks_to_print% -f -k -landscape %file_to_print%
popd

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 » Tue Nov 12, 2019 12:04 pm

Hi Andrew,
What controls the order of the blocks written to the pdf when using dwg2pdf? It seem that the order specified in block="Layout1,Layout2,Layout3,SomeLayout4" gives the same result as block="Layout1,SomeLayout4,Layout2,Layout3"?

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

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

Post by andrew » Tue Nov 12, 2019 12:53 pm

Blocks are sorted by name alphanumerically (see natural sort order).

The order of names in the -block parameter is irrelevant. Note that the string passed to the -block argument may contain regular expressions in which case the argument could not be used to define the order.

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 » Tue Nov 12, 2019 2:17 pm

andrew wrote:
Tue Nov 12, 2019 12:53 pm
Blocks are sorted by name alphanumerically (see natural sort order).

The order of names in the -block parameter is irrelevant. Note that the string passed to the -block argument may contain regular expressions in which case the argument could not be used to define the order.
Thanks. This design makes sense. But it seems it uses an internal string for the natural sort and not my defined block name.
I have these blocks:
2_Facader (*Paper_Space0)
3_Planer (*Paper-Space1)
4_Bad (*Paper-Space2)
5_Situationsplan (*Paper-Space)

They are printet to the pdf in this order:
5_Situationsplan (*Paper-Space)
2_Facader (*Paper_Space0)
3_Planer (*Paper-Space1)
4_Bad (*Paper-Space2)

So it seems QCAD is using the "(Paper-SpaceXXX) to sort the list?

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

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

Post by andrew » Tue Nov 12, 2019 2:56 pm

Correct, since "*Paper_SpaceXXX" is the block name of those layout blocks.

This behaviour might change in a future version to sort based on the layout name for layouts. Or perhaps use the layout order since layouts (unlike blocks) do have an order value attached to 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 » Tue Nov 12, 2019 3:38 pm

andrew wrote:
Tue Nov 12, 2019 2:56 pm
Correct, since "*Paper_SpaceXXX" is the block name of those layout blocks.
Is there a way for me to change the numbering of the Paper_Space after they are created?
andrew wrote:
Tue Nov 12, 2019 2:56 pm
This behaviour might change in a future version to sort based on the layout name for layouts. Or perhaps use the layout order since layouts (unlike blocks) do have an order value attached to them.
Yes the layout ordering would make sense, then the printed order would match the UI ordering

Post Reply

Return to “QCAD 'How Do I' Questions”