开发者

Is it possible to set which rendering engine to use when exporting a page using EvoPDF

开发者 https://www.devze.com 2023-03-20 21:47 出处:网络
Is it possible to set which rendering engine to use when exporting a page using EvoPDF? The default rendering engine is FireFox apparently whereas I\'d need to use IE.

Is it possible to set which rendering engine to use when exporting a page using EvoPDF?

The default rendering engine is FireFox apparently whereas I'd need to use IE.

protected void btnPdfCreator_Click(object sender, EventArgs e)
    {
        var htmlCodeToConvert = GetHtmlCode();

        var pdfConverter = new PdfConverter();

        // ideally pdfConverter.RenderingEngine = RenderingEngine.IE.

        var pdfBytes = pdfConverter.GetPdfBytesFromHtmlString(htmlCodeToConvert, this.pageUrl);

        WriteToResponse(pdfBytes, this.Response);
    }

private void WriteToResponse(byte[] pdfBytes, HttpResponse httpResponse)
    {
        httpResponse.Clear();
        httpResponse.Buffer = true;
        httpResponse.AddHeader("Content-Type", "application/pdf");

        httpResponse.AddHeader("Content-Disposition",
            Str开发者_StackOverflowing.Format("attachment; filename={0}.pdf; size={1}", this.pdfFileName, pdfBytes.Length.ToString()));

        httpResponse.Charset = String.Empty;
        httpResponse.BinaryWrite(pdfBytes);
        httpResponse.Flush();
        httpResponse.End();
    }


EvoPdf is developed by the same team who develop ExpertPDF (http://www.html-to-pdf.net/). ExpertPDF is the older product so although the APIs are almost identical, the EvoPDF API is slightly more refined.

The main difference between the products is that ExpertPDF uses the local IE rendering engine.

FWIW We moved across from ExportPDF to EvoPDF because we didn't want our PDF rending to change if the version of IE changed on the machine.


It wasn't possible with EvoPdf.

I used Winnovative that uses IE rendering engine by default.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号