开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜