(solved) PDF export on linux 53 times bigger than on Windows
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
(solved) PDF export on linux 53 times bigger than on Windows
I have a fairly small drawing of 333 KB in size (attached), but when I export to PDF, the PDF size is 12.6 MB!
This is even after I have turned off the auxilary layer and removed some peripheral details.
I tried the QCAD export, and well as printing to the linux PDF printer, and both gave the large 12.6MB .pdf file.
I've read every post on the forum that may help but I couldn't find any fixes there.
As a test I tried the Windows version and it's PDF export was perfect at 234 KB, which is a huge difference, about 53 x smaller.
So at least I have a work around - run a Windows PC just for exporting to PDF, but I would obviously prefer to use just my primary linux PC.
Can anyone please give any ideas as to what is causing the PDF bloat on linux and what I may try to rememdy it?
-------- CONFIGURATION --------
Versions
QCAD version: 3.9.4.0 Date: May 25 2015
Qt version: 4.8.4
Compiler version: gcc 4.4.3
OS: Linux, openSUSE 13.1 (x86_64)
----------------------------------------
Regards
Gaz
Perth, Australia
This is even after I have turned off the auxilary layer and removed some peripheral details.
I tried the QCAD export, and well as printing to the linux PDF printer, and both gave the large 12.6MB .pdf file.
I've read every post on the forum that may help but I couldn't find any fixes there.
As a test I tried the Windows version and it's PDF export was perfect at 234 KB, which is a huge difference, about 53 x smaller.
So at least I have a work around - run a Windows PC just for exporting to PDF, but I would obviously prefer to use just my primary linux PC.
Can anyone please give any ideas as to what is causing the PDF bloat on linux and what I may try to rememdy it?
-------- CONFIGURATION --------
Versions
QCAD version: 3.9.4.0 Date: May 25 2015
Qt version: 4.8.4
Compiler version: gcc 4.4.3
OS: Linux, openSUSE 13.1 (x86_64)
----------------------------------------
Regards
Gaz
Perth, Australia
- Attachments
-
- Front porch_paving_plan.dxf
- (333.05 KiB) Downloaded 581 times
Re: PDF export from linux is 53 times bigger than on Windows
PDF export is handled between the Qt tool kit which QCAD is based on and the operating system's PDF driver.
Unfortunately, QCAD is too far away from all of that to be able to influence the file size.
I've tested this also with the latest Qt version 5.4.1 (on Mac OS X) and the file size is still around 13MB, so no fix can be expected for this from the Qt side, sorry.
Unfortunately, QCAD is too far away from all of that to be able to influence the file size.
I've tested this also with the latest Qt version 5.4.1 (on Mac OS X) and the file size is still around 13MB, so no fix can be expected for this from the Qt side, sorry.
Re: PDF export from linux is 53 times bigger than on Windows
OK, so if QT is the problem, would this also explain why using the Print option and selecting the "PDF printer" gives the same bloated PDF?
Re: PDF export from linux is 53 times bigger than on Windows
Do you think it is worth me trying to solve this with a newer operating system PDF driver?andrew wrote:PDF export is handled between the Qt tool kit which QCAD is based on and the operating system's PDF driver.
Unfortunately, QCAD is too far away from all of that to be able to influence the file size.
I've tested this also with the latest Qt version 5.4.1 (on Mac OS X) and the file size is still around 13MB, so no fix can be expected for this from the Qt side, sorry.
Or even a different flavour of linux? Though I am a little disheartened by your OSX testing, which didn't make a difference.
Is anyone else using linux and getting small PDF export file sizes? If so, can you please post details of your linux and QCAD version.
--
Gaz
Re: PDF export from linux is 53 times bigger than on Windows
After looking for .dxf file viewers I came across LibreCAD, and it could view my QCAD .dxf file nicely and export as PDF with a file size of just 1.1 MB, which is much better than QCAD's 12.6MB.
LibreCAD uses Qt too, so Qt alone can't be the cause of QCAD's PDF bloat on linux.
So there are workarounds: Use QCAD (Windows) for PDF exports, or other .dxf drawing/viewing software such as LibreCAD. I'll see if there are any other light weight .dxf viewers for linux that may also work.
--
Gaz
LibreCAD uses Qt too, so Qt alone can't be the cause of QCAD's PDF bloat on linux.
So there are workarounds: Use QCAD (Windows) for PDF exports, or other .dxf drawing/viewing software such as LibreCAD. I'll see if there are any other light weight .dxf viewers for linux that may also work.
--
Gaz
Re: PDF export from linux is 53 times bigger than on Windows
Hello,
got attached pdf files with Debian GNU/Linux (testing) and the CUPS pdf driver (printer-driver-cups-pdf, version 2.6.1-20) and QCAD 3.9.2.0 / Qt 4.8.6.
Regards
Stephan
got attached pdf files with Debian GNU/Linux (testing) and the CUPS pdf driver (printer-driver-cups-pdf, version 2.6.1-20) and QCAD 3.9.2.0 / Qt 4.8.6.
Regards
Stephan
- Attachments
-
- Front porch_paving_plan_colored.pdf
- (260.07 KiB) Downloaded 582 times
-
- Front porch_paving_plan.pdf
- (260.18 KiB) Downloaded 565 times
Re: PDF export from linux is 53 times bigger than on Windows
I've had a look again and found the culprit. There's a simple and logical explanation and fix after all:
- Load your drawing
- Zoom in to the area with an orange rectangle: - The rectangle that seems to be solid filled contains really four extremely dense hatch patterns on top of each other (patterns NET and HOUND)
- These hatch patterns cause the large file size since lots of tiny lines are being (correctly) exported to PDF
- Delete three of those hatches and change the last one to solid: - Export to PDF -> file size will be about 150kB
Librecad quite likely simply does not know or support the hatch patterns called NET or HOUND and therefore can't render those hatches at all.
I haven't quite figured out what QCAD under Windows does differently, but at least this should fix your problem.
- Load your drawing
- Zoom in to the area with an orange rectangle: - The rectangle that seems to be solid filled contains really four extremely dense hatch patterns on top of each other (patterns NET and HOUND)
- These hatch patterns cause the large file size since lots of tiny lines are being (correctly) exported to PDF
- Delete three of those hatches and change the last one to solid: - Export to PDF -> file size will be about 150kB
Librecad quite likely simply does not know or support the hatch patterns called NET or HOUND and therefore can't render those hatches at all.
I haven't quite figured out what QCAD under Windows does differently, but at least this should fix your problem.
Re: PDF export from linux is 53 times bigger than on Windows
Fantastic Stephan! So there is hope for me to stick with QCAD on linux. Did you modify the original drawing at all, or just open it and print to PDF. Andrew, above found an issue with Hatching, so I am curious if you had to 'clean' things up first.spatz wrote:Hello,
got attached pdf files with Debian GNU/Linux (testing) and the CUPS pdf driver (printer-driver-cups-pdf, version 2.6.1-20) and QCAD 3.9.2.0 / Qt 4.8.6.
Regards
Stephan
I installed CUPS pdf driver, but I am having some problems with it after modifying one of it's .conf files to set the default print directory. I'll work and try to get it going because the file size you produced is perfectly acceptable to quickly print or email.
-- Gaz
Last edited by Gaz on Wed Jun 03, 2015 3:31 pm, edited 1 time in total.
Re: PDF export from linux is 53 times bigger than on Windows
Andrew,andrew wrote:I've had a look again and found the culprit. There's a simple and logical explanation and fix after all:
- The rectangle that seems to be solid filled contains really four extremely dense hatch patterns on top of each other (patterns NET and HOUND)
- These hatch patterns cause the large file size since lots of tiny lines are being (correctly) exported to PDF
- Delete three of those hatches and change the last one to solid:
- Export to PDF -> file size will be about 150kB
.
That is legendary sleuthing of you.
I am intrigued. How did you determine the location of the problem?
From your experience are hatches often a potential issue like this?
Is there anything in QCAD that would help me identify such issues, like a "Drawing checker" function? Or if not, is there a way to list hatches, so that I could manually check them?
Regards, Gaz
Re: (SOLVED) PDF export on linux 53 times bigger than on Win
Hatches could often be the cause of slow rendering (or in this case large PDF exports).
One of the hatches in the marked area is a rectangle shaped hatch of about 400x300 units with pattern HOUND and a scale factor of 0.05. This could easily take several seconds to render. If the factor would be even smaller, minutes or hours. For this reason, QCAD has a configurable timeout for rendering hatches (default is 2s).
Your Linux machine was able to render the extremely dense hatch and exported it, creating the big (correct) PDF file.
Your Windows machine (and Stephan's Linux machine) are a bit slower than your Linux machine, so the extremely dense hatch caused a time out and was not exported, creating the smaller (incomplete) PDF file.
The selection filter can be useful to find such hatches:
View > Selection Filter I agree that some general tool to find all problem areas (zero length entities, huge entities, duplicate entities, dense hatch patterns, dense line patterns, etc) in a drawing would be helpful.
One of the hatches in the marked area is a rectangle shaped hatch of about 400x300 units with pattern HOUND and a scale factor of 0.05. This could easily take several seconds to render. If the factor would be even smaller, minutes or hours. For this reason, QCAD has a configurable timeout for rendering hatches (default is 2s).
Your Linux machine was able to render the extremely dense hatch and exported it, creating the big (correct) PDF file.
Your Windows machine (and Stephan's Linux machine) are a bit slower than your Linux machine, so the extremely dense hatch caused a time out and was not exported, creating the smaller (incomplete) PDF file.
The selection filter can be useful to find such hatches:
View > Selection Filter I agree that some general tool to find all problem areas (zero length entities, huge entities, duplicate entities, dense hatch patterns, dense line patterns, etc) in a drawing would be helpful.
Re: (SOLVED) PDF export on linux 53 times bigger than on Win
I just followed through your post and located the offending hatches using the select filter you described and there they are!! How bizarre, I can't recall how this could have come about.andrew wrote:Hatches could often be the cause of slow rendering (or in this case large PDF exports).
One of the hatches in the marked area is a rectangle shaped hatch of about 400x300 units with pattern HOUND and a scale factor of 0.05. This could easily take several seconds to render. If the factor would be even smaller, minutes or hours. For this reason, QCAD has a configurable timeout for rendering hatches (default is 2s).
4 layers of hatches!! OMG!
Well explained. I feel very happy that it was (ab)user caused, and not some bug waiting to haunt me again. My Windows machine is a virtual one, and has a very basic virtual graphics controller, so it would have certainly timed out if asked to work that hard to render 4 layers of dense hatching.andrew wrote: Your Linux machine was able to render the extremely dense hatch and exported it, creating the big (correct) PDF file.
Your Windows machine (and Stephan's Linux machine) are a bit slower than your Linux machine, so the extremely dense hatch caused a time out and was not exported, creating the smaller (incomplete) PDF file.
In the previous hours I spent researching and trying to resolve this issue, apart from pruning and cropping my drawing, I used "Block | Purged Unused Blocks", which found a couple of extraneous things, but still did not help with my main issue.andrew wrote: I agree that some general tool to find all problem areas (zero length entities, huge entities, duplicate entities, dense hatch patterns, dense line patterns, etc) in a drawing would be helpful.
I am glad that I eventually asked on the forum, and I am VERY HAPPY that the root cause of this has been found. Mistaken dense hatches were the last thing I was looking for. I dread to think of the further hours I would have spent looking at the pdf engine of the OS. Thanks VERY much Andrew for your expert insight! If I see such a thing again, at least now I know where to start looking.
Regards, Gaz (QCAD noob)
Re: (SOLVED) PDF export on linux 53 times bigger than on Win
Interesting. So my old machine has maybe saved me some disk space .