【问题标题】:Has anyone been able to get ABCPDF (HTML Conversion) working on azure websites有没有人能够让 ABCPDF(HTML 转换)在 azure 网站上工作
【发布时间】:2012-11-29 17:20:50
【问题描述】:

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 此项目文件夹中的所有文件

【问题讨论】:

标签: abcpdf azure-web-app-service


【解决方案1】:

您不得在 Windows Azure Website 内运行外部进程,因为这会对共享基础架构造成风险。

请参阅 MSFT 员工的this postthat post,其中同一员工谈论与本机 API 相关的其他限制。

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

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

【讨论】:

  • 这已经过时了。 2012 年的 Azure 与现在的 Azure 完全不同。实际上,Windows Azure 网站产品已不复存在。 2017 年现在存在的称为应用服务,有多种不同的风格,包括 Web 应用。 Web 应用程序是精简的虚拟机,易于使用,但在控制和功能方面受到限制。还有更强大的云服务,还提供网络服务。最后是功能齐全的虚拟机。见:cloudacademy.com/blog/…
【解决方案2】:

这里有完整的 ABCpdf Azure 部署指南:

http://www.websupergoo.com/support-azure-abcpdf.htm

【讨论】:

  • 感谢您的信息...似乎它仍然不能直接与 Windows azure 网站一起使用
  • 它适用于 Azure。只需按照上面列出的部署指南进行操作即可。
  • 看起来它仍然不允许 HTML 转换。将编辑标题以添加详细信息
  • 这不适用于 Azure App 服务,因为我发布的日期。
  • 截至目前,它确实有效。有关 Azure 应用服务等的详细信息,请参阅上面的链接
猜你喜欢
  • 1970-01-01
  • 2020-04-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-08
  • 1970-01-01
相关资源
最近更新 更多