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

Mar*_*way 10 abcpdf azure-web-sites

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();
Run Code Online (Sandbox Code Playgroud)

应该工作得很好..但得到

      Failed to add HTML: RPC to Gecko engine process failed.Remote process terminated unexpectedly.
Run Code Online (Sandbox Code Playgroud)

在bin文件夹中运行完全信任

  • XULRunner文件夹和C:\ Program Files(x86)\ WebSupergoo\ABCpdf .NET 9.0\ABCGecko中的所有内容
  • ABCGecko.dll
  • ABCpdf.dll
  • ABCpdf9-32.dll

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

Sim*_*elt 6

您不能在Windows Azure网站内运行外部进程,因为这会在共享基础架构中造成风险.

这个帖子由MSFT员工或该职位,其中关于和本地API其他限制同一名员工会谈.

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

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

  • 这个已经过期了.2012年的Azure与Azure完全不同.实际上,Windows Azure网站产品不再存在.2017年现有的产品称为App Service,有各种不同的口味,包括Web App.Web应用程序是虚拟机,简单易用,但控制和功能受限.还有一些云服务功能更强大,并且还提供Web服务.最后有全功能的虚拟机.请参阅:https://cloudacademy.com/blog/microsoft-azure-app-service-virtual-machines/ (2认同)