小编Flg*_*Flg的帖子

wkhtmltopdf输出流和下载 - diaglog

是否有可能从任何html文件中获取由wkhtmltopdf创建的pdf流,并在IE/Firefox/Chrome等中弹出下载对话框?

目前我通过此代码获取我的输出流:

public class Printer
{
    public static MemoryStream GeneratePdf(StreamReader Html, MemoryStream pdf, Size pageSize)
    {
        Process p;
        StreamWriter stdin;
        ProcessStartInfo psi = new ProcessStartInfo();

        psi.FileName =  @"C:\PROGRA~1\WKHTML~1\wkhtmltopdf.exe";

        // run the conversion utility 
        psi.UseShellExecute = false;
        psi.CreateNoWindow = true;
        psi.RedirectStandardInput = true;
        psi.RedirectStandardOutput = true;
        psi.RedirectStandardError = true;

        // note that we tell wkhtmltopdf to be quiet and not run scripts 
        psi.Arguments = "-q -n --disable-smart-shrinking " + (pageSize.IsEmpty ? "" : "--page-width " + pageSize.Width + "mm --page-height " …
Run Code Online (Sandbox Code Playgroud)

c# memorystream wkhtmltopdf

6
推荐指数
1
解决办法
4258
查看次数

wkhtmltopdf样式表

任何人都可以告诉我如何包含用户样式表ind wkhtlmtopdf v.0.10?

我正在引用一个本地文件,但这无论如何都不会影响我的Pdf.

switches += "--user-style-sheet \User\...\style.css "
Run Code Online (Sandbox Code Playgroud)

css pdf stylesheet wkhtmltopdf

6
推荐指数
1
解决办法
8523
查看次数

标签 统计

wkhtmltopdf ×2

c# ×1

css ×1

memorystream ×1

pdf ×1

stylesheet ×1