有没有人能够在azure网站上获得ABCPDF(HTML转换)

问题描述 投票:10回答:2

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

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

abcpdf azure-web-sites
2个回答
6
投票

您不能在Windows Azure Website中运行外部流程,因为这会在共享基础架构中造成风险。

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

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

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


2
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.