我想從HTML字符串創建一個PDF文件,基本上HTML是一個包含多列的表格。問題是,當我生成PDF文件時,我無法看到所有的列。C#NReco HtmlToPdfConverter頁面寬度
我已經嘗試了幾種方案,但至今沒有運氣:
var generator = new NReco.PdfGenerator.HtmlToPdfConverter();
generator.CustomWkHtmlPageArgs = "--enable-smart-shrinking";
generator.CustomWkHtmlArgs = "--page-width value";
generator.PageWidth = Value;
也都像身體和表中的HTML元素具有寬度= 100%
我怎樣才能讓HTML,以適應在一個頁?
這是HTML:
<!doctype html>
<html lang="en">
<body >
<table border="1" width="100%">
<tr>
<th >Heat Id</th>
<th >Heat Order Id</th>
<th >MSP</th>
<th >Grade</th>
<th >Recipe</th>
<th >Shift</th>
<th >Crew</th>
<th >Start Date</th>
<th >End Date</th>
<th >Tap Date</th>
<th >Tap Wt. (Tons)</th>
<th >Scale Tap Wt. (Tons)</th>
<th >Cast Heat Wt.</th>
<th >Cast Slab Wt.</th>
<th >Charge Wt. (Tons)</th>
<th >Pseudo 1 Bucket</th>
<th >Scrap Wt. (Tons)</th>
<th >Scrap Flux Wt. (Tons)</th>
<th >Alloys Wt. (Lbs)</th>
<th >Tap Flux Wt. (Lbs)</th>
<th >MWH</th>
<th >Avg MW</th>
<th >KWH/Charge Ton</th>
<th >Tap To Tap Time A & B Furnace (min)</th>
<th >Tap To Tap Time Single Furnace (min)</th>
<th >Power On Time (min)</th>
<th >Power On %</th>
<th >Delay Time (min)</th>
<th >Tons/Hr</th>
<th >Total O2</th>
<th >Total O2 SS</th>
<th >Total Gas</th>
<th >Total C</th>
<th >Tap Temp</th>
<th >Tap C</th>
<th >Tap O2</th>
<th >Ladle ID</th>
<th >Comments</th>
<th >Auto Preheat On Time (min)</th>
<th >Auto Preheat Energy (MWH)</th>
<th >Heating/Lancing Energy (MWH)</th>
</tr>
</table>
</body>
</html>
請澄清「基本上」 – lloyd