abcpdf - 有没有人能够在 azure 网站上使用 ABCPDF(HTML 转换)

标签 abcpdf azure-web-app-service

Webforms 页面代码后面

        XSettings.InstallRedistributionLicense("REDACTED");
        var theDoc = new Doc();
        theDoc.HtmlOptions.Engine = EngineType.Gecko;
        theDoc.Rect.Inset(72, 144);
        theDoc.Page = theDoc.AddPage();
        int theID = theDoc.AddImageUrl("http://www.woot.com/");
        while (true)
        {
            theDoc.FrameRect(); // add a black border
            if (!theDoc.Chainable(theID))
                break;
            theDoc.Page = theDoc.AddPage();
            theID = theDoc.AddImageToChain(theID);
        }
        for (int i = 1; i <= theDoc.PageCount; i++)
        {
            theDoc.PageNumber = i;
            theDoc.Flatten();
        }
        Response.Buffer = false;
        Response.AddHeader("Content-Disposition", "inline; filename=\"rept.pdf\"");
        Response.ContentType = "application/pdf";
        theDoc.Save(Response.OutputStream);
        Response.Flush();

应该工作得很好..但是得到
      Failed to add HTML: RPC to Gecko engine process failed.Remote process terminated unexpectedly.

运行完全信任
在 bin 文件夹中
  • XULRunner 文件夹以及 C:\Program Files (x86)\WebSupergoo\ABCpdf .NET 9.0\ABCGecko 中的所有内容
  • ABCGecko.dll
  • ABCpdf.dll
  • ABCpdf9-32.dll

  • 打包/发布 Web 此项目文件夹中的所有文件

    最佳答案

    您不能从 Windows Azure Website 内部运行外部进程。因为这会给共享基础设施带来风险。

    this post由 MSFT 员工或 that post同一位员工谈论与 native API 相关的其他限制。

    可以验证问题是否与外部启动的Gecko有关。通过不将 HTML 图像添加到文档中。对我来说,PDF 的创建取得了进一步进展,但由于缺少许可证而失败。

    看起来您必须找到一个完全托管的/.NET HTML 渲染引擎(如果将网站转换为 PDF 是您的用例),或者希望保留模式的网站获得执行 native /外部进程的权利。

    关于abcpdf - 有没有人能够在 azure 网站上使用 ABCPDF(HTML 转换),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13631232/

    相关文章:

    ABCPDF 执行 doc.AddImageUrl 时更改图像压缩

    html - 使用 abcPDF 打印横向 html->pdf

    c# - ABCPDF 计算标题大小和位置。

    c# - Azure 解决方案架构 - 网站还是云服务?

    azure - 将 Azure SSL 证书导出为 pfx 文件

    c# - abcPDF 在将其添加到 pdf 后使我的图像变形

    c# - ABCpdf 不应用内联 css 样式

    c# - 使用 C# 将文件从另一台 Azure 服务器写入 Azure 服务器

    c# - Web Api 2 处理 OPTIONS 请求

    azure-web-app-service - 天蓝色 : Cannot Delete Subnet of App Service VNet Integration Preview