Blank PDF from dwg2pdf

Do you have a question you want to ask an existing QCAD user about QCAD and what you can do with it? Do you want to know if a particular feature exists? This is the place to ask.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
vd9
Registered Member
Posts: 2
Joined: Fri Feb 21, 2025 11:15 pm

Blank PDF from dwg2pdf

Post by vd9 » Fri Feb 21, 2025 11:23 pm

Hi,
i try yo generate a pdf file from the attached dwg file but it generates blank pdf. The dwg file is large.

I tried different optinos like this:

dwg2pdf.bat -o c:\11.pdf block="*Model_Space" -paper=17780x1270 -pdf-version=1.6 -force -a -c c:\1.dwg
Attachments
11.pdf
(1.57 MiB) Downloaded 1158 times
1.dwg
(8.74 MiB) Downloaded 660 times

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

Re: Blank PDF from dwg2pdf

Post by CVH » Sat Feb 22, 2025 8:38 am

Hi,

May I remark that the lower left corner of your content is about at (529928, 4514000)
And that the page settings specifies a viewport at (0, 0) or not configured and in default values.
This would not matter for the command line tool with the -a -c flags

BTW: It is never a good idea to draw that far form the origin.
Number accuracy reduces because of the limited decimal digits (15-16) in the Floating Point system.

Other remarkable things:
- The design is only 29 by 421mm for all 12 page representations.
- A paper of 17780x1270 in paper units or about 18 meters wide and more than 1 meter high ... Truly landscape :lol:
- Navigating in full view is rather sluggish, exploding all (stacked) blocks results in >54k drawing entities.
Over 500 Hatch entities with over 110k line segments to render.
Not really a simple drawing file.

Regards,
CVH
Last edited by CVH on Sat Feb 22, 2025 9:53 am, edited 3 times in total.

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

Re: Blank PDF from dwg2pdf

Post by andrew » Sat Feb 22, 2025 8:44 am

I can get a decent output with:

Code: Select all

dwg2pdf -auto-fit -margin=0 -force -paper=17780x1270 -pdf-version=1.6 -o 1.pdf  1.dwg
The margins might have been the problem.

The resulting PDF file is 20MB and too large to be attached here. My PDF viewer also struggles to load the file.

vd9
Registered Member
Posts: 2
Joined: Fri Feb 21, 2025 11:15 pm

Re: Blank PDF from dwg2pdf

Post by vd9 » Sat Feb 22, 2025 2:37 pm

Thank you very much for your detailed explanations; I truly appreciate your help.

I need to convert very wide DWG files to PDF, and struggling to find a solution. I have even larger DWG files in the queue :)

I tried Andrew's command as follows:

dwg2pdf.bat -auto-fit -margin=0 -force -paper=17780x1270 -pdf-version=1.6 -o e:\11.pdf e:\1.dwg

However, it generates a blank 2KB PDF file (attached). I have also included the command-line output for reference.

I am currently testing using the trial version and have attempted this on two different Windows computers, but the issue persists. I would appreciate any insights you might have on resolving this.
Attachments
11.pdf
(1.17 KiB) Downloaded 1168 times
out.txt
(4.21 KiB) Downloaded 624 times

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

Re: Blank PDF from dwg2pdf

Post by CVH » Wed Feb 26, 2025 12:37 pm

Hi,

Code: Select all

RHatchData::getBoundaryPath: loop not closed: ellipse arc does not connect
Would already be a problem for rendering some Hatch entities.
26 warnings in total.

I presume that this is related to ellipse methods and those are found to be inaccurate in some occasions.
At some point the methods may fail for a fixed tolerance even when that is unnecessary tolerant.
Not that these issues can be fixed easily, ellipses are a little mathematical nightmare.
Some problems have no closed-form solution and can only be solved with elliptic integrals.

Referring to:
CVH wrote:
Sat Feb 22, 2025 8:38 am
BTW: It is never a good idea to draw that far form the origin.
Number accuracy reduces because of the limited decimal digits (15-16) in the Floating Point system.
A simple solution might be to move the entire design closer to the origin.
Coordinate values will decrease drastically for the integer part, leaving more room for higher accuracy.
As result: All will be mathematically more stable.

:!: But it can also be the overall scale of your design :!:
Very tiny arcs may already have parameters very close to some fixed tolerance level.


For the record: Per direct I am unable to find ellipse arcs in Hatch loops.
Therefor I isolated all Hatches as solid, exploding them to outlines.
What resulted in Arcs (389) and Lines (3030) but no Ellipse Arcs.
It is possible that these ellipses were nearly circular and were replaced by Arcs during the explosion process.


Also found a problematic use of the Hatch pattern 'GRAVEL'.
This is a badly coded standard pattern that can't be stretched that far.
Not for the QCAD Hatch rendering engine.
Standard advice is to keep your Hatching origin near the hatch.
Typically the Hatching origin is (0, 0) for all included Hatches what is pretty far from where the Hatches occur.

Regards,
CVH

Post Reply

Return to “Pre-sales Questions”