Bug 160644 - Wrong line width when printed to PDF
Summary: Wrong line width when printed to PDF
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Printing (show other bugs)
Version: Safari 9
Hardware: Unspecified OS X 10.11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-08-07 02:52 PDT by Rüdiger Cordes
Modified: 2019-01-17 17:25 PST (History)
4 users (show)

See Also:


Attachments
all three examples (40.27 KB, application/zip)
2016-08-07 02:52 PDT, Rüdiger Cordes
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Cordes 2016-08-07 02:52:39 PDT
Created attachment 285526 [details]
all three examples

Line widths are not printed correctly to PDF. I have thought that is a problem of Apples "Quartz PDFContext" but printed with Word, fine lines are printed exactly.
HTML lines in Safari are not, whereas SVG lines are printed correctly. So maybe its a Safari/Webkit problem.
Behaviour: lines thinner than 1px are not printed, with 1px they are printed with a width of 2px, not very nice when 2px is the result of a wanted hairline!

I attached a Word, HTML and SVG PDF-example.

This problem persists for years even in OS 10.11.6.

HTML-Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
 <META http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</HEAD>
<BODY>
<DIV style="border-top:0.25pt solid #f00; border-left:0.5pt solid #00f; border-bottom:0.75pt solid #800; border-right:1pt solid #0f0">feine Linie: oben 1/4, links 1/2, unten 3/4, rechts 1 pt</DIV>
</BODY>
</HTML>

SVG-Code
<?php
header('Content-Type: image/svg+xml');
echo '<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="60cm" height="80cm" onload="getSVGDoc(evt)">
 <title>Ruedis SVG-Test</title>
 <desc>SVG-Manipulation mit JavaScript</desc>
 <g id="querl2" transform="translate(0.5 0.5) rotate(0)">
  <line x1="3"   y1="3"  x2="436" y2="3"  style="fill:none;stroke:red;stroke-width:0.25;" />
  <line x1="3"   y1="3"  x2="3"   y2="31" style="fill:none;stroke:blue;stroke-width:0.5;" />
  <line x1="3"   y1="31" x2="436" y2="31" style="fill:none;stroke:#800000;stroke-width:0.75;" />
  <line x1="436" y1="3"  x2="436" y2="31" style="fill:none;stroke:green;stroke-width:1;" />
  <text x="0px" y="0px" text-anchor="middle" transform="translate(220 20)" style="fill:rgb(0,0,0);font-size:12;font-family:Times">feine Linie: oben 1/4, links 1/2, unten 3/4, rechts 1 pt</text>
 </g>
</svg>';
?>
Comment 1 Rüdiger Cordes 2019-01-17 09:10:22 PST
Problem is still existing in macOS 10.14.3 and Safari 12.0.3

It is really a shame! It makes my daily work ugly.
Comment 2 Radar WebKit Bug Importer 2019-01-17 17:25:26 PST
<rdar://problem/47370708>