我使用TuesPechkin(wkhtmltopdf的C#包裝),並讓它從HTML生成PDF文件。如何設置PagePhont的週二皮金
不過,我想設置--disable-smart-shrinking
選項,這是在wkhtmltopdf documentation列爲PageOption
我怎麼能這樣做?
public sealed class PdfConverter
{
static readonly PdfConverter instance = new PdfConverter();
private IConverter converter;
static PdfConverter()
{
}
PdfConverter()
{
// Keep the converter somewhere static, or as a singleton instance! Do NOT run this code more than once in the application lifecycle!
this.converter = new ThreadSafeConverter(new RemotingToolset<PdfToolset>(new Win32EmbeddedDeployment(new TempFolderDeployment())));
}
public static PdfConverter Instance
{
get { return instance; }
}
public byte[] ConvertHtmlToPdf(string html)
{
var document = new HtmlToPdfDocument
{
Objects = { new ObjectSettings { HtmlText = html } }
// Where are PageOptions? Thats where --disable-smart-shrinking is
};
return converter.Convert(document);
}
}