SVG Web打印宽度减小

时间:2017-09-05 21:06:46

标签: css svg web printing

我正在尝试正确打印我的网页,但打印机使用的纸张宽度尺寸的一半,高度没有问题。 我检查了打印配置纸张尺寸A4和方向(垂直)

<- example print preview ( chrome ) width ->
    P100 CH:  
    P100 CB:
    21/09/2017
  12:40
12:41               T1  T2  T3  T4 T5  T6 T7
12:41
12:43  

<-------- real physical print ------------->
  P100 CH:  
  P100 CB:
  21/09/2017
 12:40
12:41   T1 T2 T3 T4 T5 T6 T7
12:41
12:43  
  

HTML代码

<style type="text/css">     
text
{
 fill         : #1a1a1a;
 fill-opacity : 1;
 fill-rule    : nonzero;
 stroke       : none;
 font-size   :6mm;
 font-family : "Liberation Sans";
}
</style> 
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="200mm" height="120mm" id="svg3212"><g transform="translate(80, 28)" id="layer2">
<text  width="300.51901" height="2.6448176" x="20mm" y="7mm" id="padron">P101</text> 
<text " width="269.51901" height="1.9095461" x="19mm" y="11mm" id="placa">P101</text> <text width="269.51901" height="1.9095461" x="18mm" y="16mm" id="fecha">05/08/17</text> 
 <text width="269.51901" height="1.9095461" x="39mm" y="7mm" id="placa">CH: WILMER MENDOZA SILVA</text> 
<text width="269.51901" height="1.9095461" x="39mm" y="11mm" id="placa">CB: ROBERTO DIEGO MORETO REQUEJO</text> 
<text x="26mm" y="21mm" id="departure_time">15:03</text> 
<text width="94.713554" height="2.4005728" x="7mm" y="33mm" id="checkpoint_0">15:13</text>
<text width="94.713554" height="2.4005728" x="7mm" y="39.6mm" id="checkpoint_1">15:25</text>
<text width="94.713554" height="2.4005728" x="7mm" y="46.2mm" id="checkpoint_2">15:35</text>
<text  width="94.713554" height="2.4005728" x="7mm" y="52.8mm" id="checkpoint_3">15:42</text>
<text width="94.713554" height="2.4005728" x="7mm" y="59.4mm" id="checkpoint_4">15:49</text>
<text width="94.713554" height="2.4005728" x="7mm" y="66mm" id="checkpoint_5">15:59</text>
<text width="94.713554" height="2.4005728" x="7mm" y="72.6mm" id="checkpoint_6">16:09</text>
<text width="94.713554" height="2.4005728" x="7mm" y="79.19999999999999mm" id="checkpoint_7">16:34</text>
<text width="94.713554" height="2.4005728" x="7mm" y="85.8mm" id="checkpoint_8">16:44</text>
<text width="94.713554" height="2.4005728" x="7mm" y="92.4mm" id="checkpoint_9">16:52</text>
<text  width="94.713554" height="2.4005728" x="7mm" y="99mm" id="checkpoint_10">17:00</text> 
<text  width="62.110207" height="2.4005728" x="64mm" y="32.5mm" id="ticket_0">9</text> 
<text width="62.110207" height="2.4005728" x="82.65mm" y="32.5mm" id="ticket_1">343</text> 
<text width="62.110207" height="2.4005728" x="101.3mm" y="32.5mm" id="ticket_2">2</text> 
<text width="62.110207" height="2.4005728" x="119.94999999999999mm" y="32.5mm" id="ticket_3">5</text> 
<text width="62.110207" height="2.4005728" x="138.6mm" y="32.5mm" id="ticket_4">4</text> 
<text width="62.110207" height="2.4005728" x="157.25mm" y="32.5mm" id="ticket_5">3</text> 
<text  width="62.110207" height="2.4005728" x="175.89999999999998mm" y="32.5mm" id="ticket_6">1</text>
</g>
</svg>

我正在使用windows和epson lx 350打印机进行打印。使用ubuntu OS我没有问题

1 个答案:

答案 0 :(得分:0)

我用iexplorer测试它并且效果很好。我不知道为什么chrome和firefox不使用纸张尺寸配置。