Printing A0 to PDF crashes librecad on windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Printing A0 to PDF crashes librecad on windows

cadnoob
Hi,

really great software, I'm just getting the hang of it. So much easier than almost everything else I tested.
Of course I've got a little problem. ;)

LibreCAD 2.0.4
PDFCreater, multiple versions tested.
Windows 7 SP1 x64, all patches as of today.

If I try to print an DIN A0 drawing to PDF LibreCAD just crashes. I can attach a screenshot from the crash, if you want me to.
I think this may be a memory issue. Reducing size to A4, or reducing resolution die 75dpi with A0 saves PDF just fine. Of course in one it is too small, and in the other case to coarse to print that.

It will be a 1:1 drawing of a guitar or parts thereof, which I'd like to have printed in large format to create routing templates from that, so yes, unfortunately I need the size.

Suggestions?

Regards,
Marc
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

LordOfBikes
Administrator
Can you share the DXF file which causes the crash or create a similar one which crashes too?
Does it depend on the entities (polyline, spline, dimensions?) or does a simple rect in A0 size crash too?

Use More->Upload a file when you reply, to upload the DXF.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

cadnoob
testcase.dxf

Hi Armin,

it doesn't seem to be dimensions per se..
I can get it to crash with a simple rectangle, but not every time.
If I add a dimension (see attached testcase) it crashes every time.
If I remove the dimensions layer from my guitar dxf it still crashes.
What I do:
Open LibreCAD. Open testcase.dxf
File -> Print preview. Scale 1:1. Center on Page.
File ->Print, PDF-Creator, Settings, Advanced, Paper Size: A0. ok.ok. print. ->crash.
Every other setting of PDF-Creator is on default. So probably most important memory wise: Colour=yes, Resolution=600dpi.

Problem signature, if that helps:

Problemsignatur:
  Problemereignisname: APPCRASH
  Anwendungsname: LibreCAD.exe
  Anwendungsversion: 0.0.0.0
  Anwendungszeitstempel: 538cdd5e
  Fehlermodulname: Qt5PrintSupport.dll
  Fehlermodulversion: 5.2.1.0
  Fehlermodulzeitstempel: 52ed6c5d
  Ausnahmecode: c0000005
  Ausnahmeoffset: 0000ec3f
  Betriebsystemversion: 6.1.7601.2.1.0.256.48
  Gebietsschema-ID: 1031
  Zusatzinformation 1: 0a9e
  Zusatzinformation 2: 0a9e372d3b4ad19135b953a78882e789
  Zusatzinformation 3: 0a9e
  Zusatzinformation 4: 0a9e372d3b4ad19135b953a78882e789



Regards,
Marc
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

LordOfBikes
Administrator
This post was updated on .
Marc,

thanks for the test case and your investigations.

For the moment I can say, that I can reproduce it with the test case file on XP with FreePDF. So it does not depend on Windows version or PDF creator software.

I can print A2 with 600 dpi, but A2 with 720 dpi crashes too. So I think it's an issue of memory consumption. If this is the case, I expect it will fail on Linux too, I will try this later.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

dxli
In Linux, I can print to A0 size PDF without an issue.

LordOfBikes wrote
Marc,

thanks for the test case and your investigations.

For the moment I can say, that I can reproduce it with the test case file on XP with FreePDF. So it does not depend on Windows version or PDF creator software.

I can print A2 with 600 dpi, but A2 with 720 dpi crashes too. So I think it's an issue of memory consumption. If this is the case, it expect it will fail on Linux too, I will try this later.

Armin
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

dxli
In reply to this post by LordOfBikes
Hi Armin,

I added a menu entry to "Export to PDF", but it doesn't seem to work well in Windows or OS/X.

Can you check whether we can do better with PDF in windows? I feel this is an essential feature.

My commit:

https://github.com/LibreCAD/LibreCAD/commit/aa7373fbc80dfffb71871e65f9de7a9084971b3a

Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

LordOfBikes
Administrator
Dongxu,

I have checked master HEAD on Windows and you're right, "Export to PDF" does't work there

I have to stop now, will continue tomorrow digging into this.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

cadnoob
you guys are great. ;)
Did some more digging myself as well.
I can confirm that with MacOS X the OS integrated PDF printer works, although it took me some time to convince this "ยง$!%! thing (MacOS) to create a PDF in a size my printer is not able to print... At least on my print dialog "custom size" is grayed out, even if PDF is selected. If you want the workaround, drop me a line.

I'll think I'll use a workaround with a LinuxVM on my Windows box for the time being.
I'll be happy to test some windows builds, so send me a message, if I can help.

Shall I file the windows pdf thing via the bug tracker as well?

Regards,
Marc
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

LordOfBikes
Administrator
Marc,

I'm glad that you found a workaround that works for you. I didn't make any progress on that issue today.
You're welcome to open a bug ticket on sf.net, that it doesn't pass out of mind.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

dxli
In reply to this post by cadnoob
Implementing "Export as PDF" in LC may require a PDF library for win32.

A workaround might be cups-pdf.de, or something similar.

cadnoob wrote
you guys are great. ;)
Did some more digging myself as well.
I can confirm that with MacOS X the OS integrated PDF printer works, although it took me some time to convince this "ยง$!%! thing (MacOS) to create a PDF in a size my printer is not able to print... At least on my print dialog "custom size" is grayed out, even if PDF is selected. If you want the workaround, drop me a line.

I'll think I'll use a workaround with a LinuxVM on my Windows box for the time being.
I'll be happy to test some windows builds, so send me a message, if I can help.

Shall I file the windows pdf thing via the bug tracker as well?

Regards,
Marc
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

LordOfBikes
Administrator
Dongxu,

I think I've fixed "Export as PDF" with my latest commits.

Qt itself can handle export to PDF, the problem was QPrinterDialog. I found it in the Qt source codes. The Windows and QSX version of QPrinterDialog returns Rejected if the format is not equal to QPrinter::NativeFormat. So printing was abandoned. It worked on Linux because of native OS support for Print to PDF.

I generally tested the code on Windows, I exported an A0 drawing with test code, but have to check the commited version on Windows tomorrow.

If this works on Windows, this could be the solution for the threads original issue too. When export to PDF within LC works, it is not necessary to print on a virtual PDF printer like PDF creator or FreePDF which could also have been the cause of the exception.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

LordOfBikes
Administrator
I've tested master HEAD "Export as PDF" successfully with the A0 crash test DXF and it works for me on XP, build with Qt 5.3.1.

I can test later on Win 7 and QSX.

This may also be an indication, that the "Print to PDF" issue on Windows is caused by the PDF printer driver and not LibreCAD.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

dxli
Hi Armin,

Wonderful solution.

We are going to release 2.0.5 this weekend.

Need to make a release note then.

dxli
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

LordOfBikes
Administrator
Hi Dongxu,

I've had issues yesterday with that. On W7 I've got a PDF, but with a size of 0x0 pixel. And on OSX Mavericks the PDF contained only a part of the print preview. I will continue debugging later this evening.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

LordOfBikes
Administrator
In reply to this post by dxli
Dongxu,

both issues belongs to Qt. I've used Qt 5.2.1 on both machines which caused the problems with wrong paper format.
After updating both machines to Qt 5.3.1 the "Export as PDF" works fine for me on Windows 8 and OSX Mavericks.

So I will build and upload the Windows installer today.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

dxli
Hi Armin,

Nice to know. I built the osx 2.0.5 installer with Qt-4.8.6, and Export to PDF works.

As usual, the osx installer only works for 10.9 Mavericks.


LordOfBikes wrote
Dongxu,

both issues belongs to Qt. I've used Qt 5.2.1 on both machines which caused the problems with wrong paper format.
After updating both machines to Qt 5.3.1 the "Export as PDF" works fine for me on Windows 8 and OSX Mavericks.

So I will build and upload the Windows installer today.

Armin
Reply | Threaded
Open this post in threaded view
|

Re: Printing A0 to PDF crashes librecad on windows

cadnoob
In reply to this post by LordOfBikes
Hi @all,

just saw, that 2.0.5 has been released. Installed it, opened my dxf, exported to PDF.
And what shall I say?
You guys are amazing!

Works like a charm, quality is way better than the pdf print I did in MacOS.

Donation is definitely on its way!

All the best,
Marc