【问题标题】:ABCPDF Gecko on Azure WebJobsAzure WebJobs 上的 ABCPDF Gecko
【发布时间】:2014-04-30 15:23:23
【问题描述】:

让 ABCPDF Gecko Engine 将网页转换为 PDF。在本地工作正常,但是当推送到 azure webjobs 时,我不知道如何调试它。我不确定那行代码(3518)是什么,因为有不同的版本,并且它从没有代码的地方抛出错误。

C#代码

    var url = "http://www.woot.com";
    Log("AddingImageUrl {0}", url);
    var theID = _doc.AddImageUrl(url);
    while (true)
    {
        if (!_doc.Chainable(theID))
        {
            break;
        }
        _doc.Page = _doc.AddPage();
        SetupRectangle();
        theID = _doc.AddImageToChain(theID);
    }

日志:

[04/30/2014 15:15:31 > 865961: INFO] AddingImageUrl http://www.woot.com
[04/30/2014 15:15:36 > 865961: ERR ] ??????????p: T###!!! ABORT: unable to find a usable font (serif): file c:/WSG/Projects/ABCpdf/Source/mozilla-release/gfx/thebes/gfxFont.cpp, line 3518
[04/30/2014 15:15:38 > 865961: ERR ] ??????????p: T###!!! ABORT: unable to find a usable font (serif): file c:/WSG/Projects/ABCpdf/Source/mozilla-release/gfx/thebes/gfxFont.cpp, line 3518
[04/30/2014 15:15:40 > 865961: ERR ] ??????????p: T###!!! ABORT: unable to find a usable font (serif): file c:/WSG/Projects/ABCpdf/Source/mozilla-release/gfx/thebes/gfxFont.cpp, line 3518
[04/30/2014 15:15:43 > 865961: ERR ] ??????????p: T###!!! ABORT: unable to find a usable font (serif): file c:/WSG/Projects/ABCpdf/Source/mozilla-release/gfx/thebes/gfxFont.cpp, line 3518
[04/30/2014 15:15:45 > 865961: ERR ] ??????????p: T###!!! ABORT: unable to find a usable font (serif): file c:/WSG/Projects/ABCpdf/Source/mozilla-release/gfx/thebes/gfxFont.cpp, line 3518
[04/30/2014 15:15:47 > 865961: ERR ] ??????????p: T###!!! ABORT: unable to find a usable font (serif): file c:/WSG/Projects/ABCpdf/Source/mozilla-release/gfx/thebes/gfxFont.cpp, line 3518
[04/30/2014 15:15:47 > 865961: ERR ] 
[04/30/2014 15:15:47 > 865961: ERR ] Unhandled Exception: WebSupergoo.ABCpdf9.Internal.PDFException: Failed to add HTML: Remote process terminated unexpectedly. (Possible causes: Out of memory or corrupted/incorrect version of XULRunner folder.). ---> WebSupergoo.TaskGarden.RemoteProcessTerminatedException: Remote process terminated unexpectedly.
[04/30/2014 15:15:47 > 865961: ERR ] 
[04/30/2014 15:15:47 > 865961: ERR ] Server stack trace: 
[04/30/2014 15:15:47 > 865961: ERR ]    at WebSupergoo.TaskGarden.Core.RpcCaller.EndCall(IAsyncResult result, Object[]& outArgs)
[04/30/2014 15:15:47 > 865961: ERR ]    at WebSupergoo.TaskGarden.Core.RpcCaller.Call(MethodBase method, Object[] args)
[04/30/2014 15:15:47 > 865961: ERR ]    at WebSupergoo.TaskGarden.Instance`1.Invoke(IMessage msg)
[04/30/2014 15:15:47 > 865961: ERR ] 
[04/30/2014 15:15:47 > 865961: ERR ] Exception rethrown at [0]: 
[04/30/2014 15:15:47 > 865961: ERR ]    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
[04/30/2014 15:15:47 > 865961: ERR ]    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
[04/30/2014 15:15:47 > 865961: ERR ]    at WebSupergoo.ABCpdf9.Internal.Gecko.IGeckoWorker.AddImageUrl(String url, Double pageWidthMm, Double pageHeightMm, AddImageUrlOptions options, UInt32& numCommands, Byte[]& data)
[04/30/2014 15:15:47 > 865961: ERR ]    --- End of inner exception stack trace ---
[04/30/2014 15:15:47 > 865961: ERR ]    at WebSupergoo.ABCpdf9.Doc.AddUrlHtml(String urlOrHtml, Boolean isHtml, Boolean paged, Int32 width, Boolean disableCache)
[04/30/2014 15:15:47 > 865961: ERR ]    at WebSupergoo.ABCpdf9.Doc.AddImageUrl(String url, Boolean paged, Int32 width, Boolean disableCache)

【问题讨论】:

    标签: c# azure abcpdf azure-webjobs


    【解决方案1】:

    ABCpdf Gecko 引擎在部署为 Azure webjob 时失败,您可以改为部署为 Azure 云服务(经典)Web 角色。

    WebRole 仅在需要将 Image 或 HTML 转换为 PDF 的情况下才需要。 如果只需要将文本转换为 PDF,我们可以将应用程序托管为应用服务或 WebJob(可能不需要 WebRole 或云服务)。

    此处提供 ABCpdf Azure 部署指南:

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

    【讨论】:

      【解决方案2】:

      很遗憾,由于沙盒限制,我认为这不能在 Azure 网站中运行。

      【讨论】:

      • 我很愿意,但它似乎比网站限制更进一步在这里演示:abcpdf2.azurewebsites.net 错误:无法添加 HTML:RPC 到 Gecko 引擎进程失败。未能创建命名管道 \\.\Pipe\TaskGarden_ctrl_09971bf3-908d-4874-b2a2-fadc108ac2a2。这似乎已经触发了外部程序,然后遇到了问题。
      • UI api 被沙箱禁用,因此您无法使用 Internet Explorer,例如您的 Azure 网站,这可能是用来创建 PDF 的。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多