我有一个位于本地电脑上的html文件,我希望通过一个小小的c#程序打印它,但问题是它打印1页的html文件的小设计。 我的HTML:
<html>
<body>
<table dir="rtl">
<colgroup>
<col width="87.49609375">
<col width="50">
<col width="92.04541015625">
<col width="94.19384765625">
<col width="52.18115234375">
<col width="50">
<col width="53.09423828125">
<col width="141.99658203125">
<col width="55.24267578125">
<col width="50.66650390625">
<col width="57.052734375">
<col width="52.798828125">
<col width="52.7880859375">
<col width="56.74658203125">
<col width="52.49267578125">
<col width="53.701171875">
<col width="50.95654296875">
<col width="63.4443359375">
<col width="52.7880859375">
</colgroup>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
</tr>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">3,040.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">-0.75</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">.edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">3,063.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">281014</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">10:49</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">1,452.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">4,656.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1,548.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">3,040.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">3,056.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">44.14</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">142.29</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">47,049.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
</tr>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1,711.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">24.80</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1,371.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">604611</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">10:46</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">6,522.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">30,000.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">1,711.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">111.59</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">513,300.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
</tr>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">16,880.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">-5.75</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">.edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">17,910.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">629014</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">10:50</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">1,800.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">209.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">494.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">16,870.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">16,880.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">303.66</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">35.28</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">88,701.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
</tr>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">400.50</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">400.50</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1010164</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
</tr>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">503.20</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">503.20</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1010172</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
</tr>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">860.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1.12</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">850.50</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1111632</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">10:31</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">900.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">6,930.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">6,625.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">851.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">855.60</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">7.66</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">59.29</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">65,217.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
</tr>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete21</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">6,999.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">6,999.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1111640</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
</tr>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1,114.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1,114.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1111665</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">'edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
</tr>
<tr>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1,558.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">0.06</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1,557.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">1111657</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">edfrtrete</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">10:23</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">15,552.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">5,121.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">7,071.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #00B000;">1,559.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: #FF0000;">1,564.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">242.46</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">80.09</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;">110,115.00</td>
<td align="Right" style="font-family: Aharoni;font-size: 11pt;font-weight: bold;color: ;"></td>
</tr>
</table>
</body>
</html>
我的代码如下:
const short PRINT_WAITFORCOMPLETION = 2;
const int OLECMDID_PRINT = 6;
const int OLECMDEXECOPT_DONTPROMPTUSER = 2;
private void PrintDocument(string fileName)
{
using (var browser = new WebBrowser())
{
browser.Navigate(fileName);
while (browser.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
dynamic ie = browser.ActiveXInstance;
ie.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, PRINT_WAITFORCOMPLETION);
}
}
我想打印它,因为我在浏览器上看到它,如何修复我的代码?