繁体   English   中英

Azure WebJobs上的ABCPDF Gecko

[英]ABCPDF Gecko on Azure WebJobs

让ABCPDF Gecko Engine将网页转换为PDF。 在本地工作正常,但是当推向天蓝色的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)

当部署为Azure webjob时,ABCpdf Gecko引擎会失败,而是可以部署为Azure云服务(经典)Web角色。

仅在需要将图像或HTML转换为PDF的情况下才需要WebRole。 如果仅需要将文本转换为PDF,我们可以将应用程序托管为App Service或WebJob(可能不需要WebRole或Cloud Service)。

ABCpdf Azure部署指南可在此处获得:

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

不幸的是,由于沙箱限制,我认为这在Azure网站中不起作用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM