0

如何将 WkHtmlToXSharp PDF 的页面大小更改为字母?默认情况下它输出 8.26 x 11.69 英寸,我需要它是 8.5 x 11。

4

1 回答 1

0

这是一个已知问题,拉取请求已提交但未合并。

从 GitHub 项目页面添加拉取请求:https ://github.com/tylerabahr/WkHtmlToXSharp/blob/ad9a935ea01c852133071fabbaf1b7d5a551e517/WkHtmlToXSharp/PdfGlobalSettings.cs

然后编写这段代码:

    MultiplexingConverter mc = new MultiplexingConverter();
    mc.GlobalSettings.Dpi = 300;
    mc.GlobalSettings.Size.PageSize = PdfPageSize.Letter;
    PdfMarginSettings pms = new PdfMarginSettings();
    string halfInch = ".5in";
    mc.GlobalSettings.Margin.Bottom = halfInch;
    mc.GlobalSettings.Margin.Left = halfInch;
    mc.GlobalSettings.Margin.Right = halfInch;
    mc.GlobalSettings.Margin.Top = halfInch;
于 2013-11-08T04:48:28.913 回答