Problem with line type when converting DWG to PDF

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post Reply
sistemas.caw
Junior Member
Posts: 16
Joined: Wed Apr 10, 2019 3:51 pm

Problem with line type when converting DWG to PDF

Post by sistemas.caw » Wed May 22, 2019 8:53 pm

Hello,

We have some drawings that have lines with property "linetype" setted as "Dash dot".
When we open these files with QCad, the scale of this lines are distorted if compared with same drawing opened with TrueView.
More critical, when we try to convert this file to PDF with DWG2PDF, lines with "linetype" setted as "Dash dot" are converted as "Continuous".
Could you help us with this problem?

S.O.: Windows 10 Professional
QCad Version: 3.22.0.10

Script used to convert DWG to PDF:
dwg2pdf.bat -a -c -d -f -n -l -w 0.1 -fs romans standard -fs romand standard -o "C:\temp\croquis\2pdf\CAD.pdf" "C:\temp\croquis\2pdf\CAD.DWG"

Attached Files:
CAD.dwg - drawing for reference;
CAD.pdf - Cad.dwg converted to pdf with DWG2PDF
CAD_QCAD.png - CAD.dwg opened with QCAD
CAD_TRUEVIEW.png - CAD.dwg opened with TrueView
Attachments
CAD_TRUEVIEW.png
CAD_TRUEVIEW.png (65.83 KiB) Viewed 3374 times
CAD_QCAD.png
CAD_QCAD.png (72.48 KiB) Viewed 3374 times
CAD_DWG2PDF.png
CAD_DWG2PDF.png (46.77 KiB) Viewed 3374 times
CAD.pdf
(100.59 KiB) Downloaded 62 times
CAD.dwg
(70.25 KiB) Downloaded 69 times

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

Re: Problem with line type when converting DWG to PDF

Post by andrew » Thu May 23, 2019 12:46 pm

The drawing unit is set to "None". I think Trueview might assume "Inch" in this case.

If you open the drawing in QCAD and set Edit > Drawing Preferences > General > Drawing Unit > Drawing Unit to "Inch", it will display as desired.

Using command line tools, you can set the drawing unit using dwg2dwg:

Code: Select all

dwg2dwg -s INSUNITS:1 -f -o out.dwg in.dwg

sistemas.caw
Junior Member
Posts: 16
Joined: Wed Apr 10, 2019 3:51 pm

Re: Problem with line type when converting DWG to PDF

Post by sistemas.caw » Thu May 23, 2019 1:44 pm

Dear Andrew,

Thank you very much for your quickly reply. I changed Drawing Unit to "Inch" and then QCad show this line correctly.
But, when I convert to PDF, this line still is displayed as "Continuous" as showed in file"Cad.pdf"

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

Re: Problem with line type when converting DWG to PDF

Post by andrew » Fri May 24, 2019 8:50 am

That would be caused by the linetype scale (LTSCALE) of 20.

Try this:

Code: Select all

dwg2dwg -s INSUNITS:1 -s LTSCALE:0.2 -f -o CAD_fixed.dwg CAD.dwg

dwg2pdf -a -c -d -f -n -l -w 0.1 -fs romans standard -fs romand standard -o CAD.pdf CAD_fixed.dwg

sistemas.caw
Junior Member
Posts: 16
Joined: Wed Apr 10, 2019 3:51 pm

Re: Problem with line type when converting DWG to PDF

Post by sistemas.caw » Fri May 24, 2019 6:23 pm

Hello Andrew,

Thank you very much for your help.
Although this drawing is with scale of 20, I think that when I use dwg2pdf with -a (autofit) parameter the drawing is scaling and dashed line not.
This behaviour occur with QCad print preview too (See attached files).
I think that QCad need to print (and/or generate pdf) the drawn with same features that is displayed outside preview.
Is possible correct this QCad behaviour?
Attachments
CAD_PREVIEW.png
CAD_PREVIEW.png (50.08 KiB) Viewed 3300 times
CAD.png
CAD.png (32.86 KiB) Viewed 3300 times

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

Re: Problem with line type when converting DWG to PDF

Post by andrew » Fri May 24, 2019 7:00 pm

Line type patterns (and also lineweights) are paper based. For example a dashed line with 2mm dashes has 2mm dashes on paper (independent of the scale at which the drawing is printed). This is expected / correct behaviour. The linetype scale factor can be used to adjust all linetype scales on paper if desired.

sistemas.caw
Junior Member
Posts: 16
Joined: Wed Apr 10, 2019 3:51 pm

Re: Problem with line type when converting DWG to PDF

Post by sistemas.caw » Tue May 28, 2019 1:11 pm

Hello Andrew,

Thanks for your help, now I'm understanding what is happening. QCad works with dashed lines paper based. But this is a problem for me. We have other software working in parallel with QCad as Trueview, Autocad, etc.
These other software do not work with dashed lines paper based (See attached files), then, I have softwares printing differently same DWG file. The critical problem for me is that we choose QCad to convert DWG files to PDF and later print to manufacture. With the problem with dashed lines, our factory is manufacturing wrong parts of our product what is a big problem.

I want to see with you the possibility that script dwg2pdf has an option to scaling dashed lines with all other entities of the drawing, not paper based as work now.
Attachments
trueview_preview.png
trueview_preview.png (49.69 KiB) Viewed 3199 times
trueview.png
trueview.png (123.08 KiB) Viewed 3199 times
Librecad_preview.png
Librecad_preview.png (78.56 KiB) Viewed 3199 times
Librecad.png
Librecad.png (69.87 KiB) Viewed 3199 times
autocad_preview.png
autocad_preview.png (30.76 KiB) Viewed 3199 times
autocad.png
autocad.png (73.25 KiB) Viewed 3199 times

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

Re: Problem with line type when converting DWG to PDF

Post by andrew » Thu May 30, 2019 3:31 pm

In your screenshots you appear to be printing / viewing the model space. In model space, linetypes are not scaled to paper units (as there is no paper and everything is in drawing units).

I can offer you to implement a switch to override the linetype scale in dwg2pdf (i.e. -ltscale=1).

sistemas.caw
Junior Member
Posts: 16
Joined: Wed Apr 10, 2019 3:51 pm

Re: Problem with line type when converting DWG to PDF

Post by sistemas.caw » Fri May 31, 2019 6:46 pm

Hello Andrew,

The LTSCALE could help, but I'm afraid with possibility that this parameter correct some drawings and mess others. Autocad have a parameter named "PSLTSCALE". This parameter is used to control if line type is scaled to paper units or to drawing units (See attached Autocad documentation).
I see at QCad source code documentation that QCad have this parameter too (See attached documentation), but I didn't find how to set it.
Have any way to set this parameter to this drawn? If yes, is possible to add a switch to override this parameter in dwg2pdf?
Attachments
PSLTSCALE_DOC_SOURCE_QCAD.PNG
PSLTSCALE_DOC_SOURCE_QCAD.PNG (40.72 KiB) Viewed 3085 times
PSLTSCALE_DOC_AUTOCAD.PNG
PSLTSCALE_DOC_AUTOCAD.PNG (19.13 KiB) Viewed 3085 times
Autocad_LineTypePaperSpaceUnits.png
Autocad_LineTypePaperSpaceUnits.png (16.72 KiB) Viewed 3085 times

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

Re: Problem with line type when converting DWG to PDF

Post by andrew » Mon Jun 03, 2019 11:11 am

As far as I can see from your screenshots, you are printing the model space somehow. PSLTSCALE affects only printing from paper space which might be the reason why your prints look fine. I think you are somehow printing the current screen "as displayed". This is uncommon in CAD.

In any case: setting the linetype scale (LTSCALE) to 1 guarantees that dashes are visible as dashes (if the line is long enough to show them). I'd recommend that solution.

sistemas.caw
Junior Member
Posts: 16
Joined: Wed Apr 10, 2019 3:51 pm

Re: Problem with line type when converting DWG to PDF

Post by sistemas.caw » Tue Jun 04, 2019 12:24 pm

Hello Andrew,
Thanks for your help. I did tests with some dwg files with dashed line setting LTSCALE to 1 and I get acceptable results.
Could you add INSUNITS (I have some dwg files that are without drawing unit defined too) and LTSCALE switch to dwg2pdf?

sistemas.caw
Junior Member
Posts: 16
Joined: Wed Apr 10, 2019 3:51 pm

Re: Problem with line type when converting DWG to PDF

Post by sistemas.caw » Mon Jun 10, 2019 2:48 pm

Hello Andrew,

Do you have a prevision to release a new QCad Version with theses new switch of dwg2pdf?

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

Re: Problem with line type when converting DWG to PDF

Post by andrew » Tue Jun 11, 2019 9:13 am

We will likely release a snapshot this or next week.

sistemas.caw
Junior Member
Posts: 16
Joined: Wed Apr 10, 2019 3:51 pm

Re: Problem with line type when converting DWG to PDF

Post by sistemas.caw » Tue Jun 11, 2019 1:31 pm

Ok Andrew,

I'll wait. Thanks.

Post Reply

Return to “QCAD Troubleshooting and Problems”