View Issue Details

IDProjectCategoryView StatusLast Update
0016767ScribusPDFpublic2023-05-29 18:56
Reportercathysax Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOS10 Pro 
Product Version1.5.8 
Fixed in Version1.6.0.svn 
Summary0016767: Dashed lines imported from PDF have incorrect segment lengths
DescriptionWhen displaying a PDF, the lengths of segments in dashed lines appear to be erroneously scaled based on the line's width.
Steps To ReproduceThe attached dashes.pdf has three different dashed line patterns. Each pattern is drawn in 3 different widths: 0.5pt, 1pt, and 2pt.

If you view this file in Acrobat, Firefox, etc., you can see that for each pattern, the dash segment lengths match for all three line widths.

If you open this file in Scribus, it draws the dashes (and gaps) too long for the 0.5pt lines and too short for the 2pt lines. (The 1pt-wide line is correct.) Scribus appears to be using dash (and gap) lengths equal to the specified length divided by the line's width.
Additional Informationdashes.tex is provided just for reference; I created it to generate the example dashes.pdf.

This is not a new bug; it happens in previous 1.5.x and 1.4.x versions. I've always just worked around it by scaling the pattern that I generate.
Tagsdashed lines, lines, pdf import
PatchNo

Activities

cathysax

2022-03-05 23:10

reporter  

dashes.pdf (18,813 bytes)
dashes.tex (1,804 bytes)

cathysax

2022-03-05 23:24

reporter   ~0049584

dashes-Scribus.gif shows a screen shot of the dashes displayed by Scribus when opening dashes.pdf
dashes-Scribus.gif (51,711 bytes)   
dashes-Scribus.gif (51,711 bytes)   

cathysax

2022-03-07 19:30

reporter   ~0049585

I think the issue may be related to differences in how PDF and Qt represent dash patterns.

* Qt documentation states that "The dash pattern is specified in units of the pens width." <https://doc.qt.io/qt-5/qpen.html#setDashPattern>

* The lengths for a dash pattern in a PDF are specified in "user space units" (pts in my example file), and are thus independent of line width.

This would indicate needing to take the PDF values and divide by line width to get the values needed by Qt. But the result I see in Scribus indicates that this conversion may have been applied twice.

jghali

2022-03-07 22:12

administrator   ~0049586

In fact we do not use Qt for drawing to screen, but cairo graphics library. However it seems that some of our importer code was copied from poppler's qt support library and there was indeed an incorrect division of dashes values by line width. Removed it, and things now works better :-)

cathysax

2022-03-08 18:28

reporter   ~0049587

Thank you! And thanks for the explanation; that would explain why I saw cairo references in the code :-)

Issue History

Date Modified Username Field Change
2022-03-05 23:10 cathysax New Issue
2022-03-05 23:10 cathysax Tag Attached: dashed lines
2022-03-05 23:10 cathysax Tag Attached: lines
2022-03-05 23:10 cathysax Tag Attached: pdf import
2022-03-05 23:10 cathysax File Added: dashes.pdf
2022-03-05 23:10 cathysax File Added: dashes.tex
2022-03-05 23:24 cathysax Note Added: 0049584
2022-03-05 23:24 cathysax File Added: dashes-Scribus.gif
2022-03-07 19:30 cathysax Note Added: 0049585
2022-03-07 22:03 jghali Summary Dashed lines from PDF have incorrect segment lengths => Dashed lines imported from PDF have incorrect segment lengths
2022-03-07 22:12 jghali Assigned To => jghali
2022-03-07 22:12 jghali Status new => resolved
2022-03-07 22:12 jghali Resolution open => fixed
2022-03-07 22:12 jghali Fixed in Version => 1.6.0.svn
2022-03-07 22:12 jghali Note Added: 0049586
2022-03-08 18:28 cathysax Note Added: 0049587
2023-05-29 18:56 cbradney Status resolved => closed