是否有可能从任何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) 任何人都可以告诉我如何包含用户样式表ind wkhtlmtopdf v.0.10?
我正在引用一个本地文件,但这无论如何都不会影响我的Pdf.
switches += "--user-style-sheet \User\...\style.css "
Run Code Online (Sandbox Code Playgroud)