簡體   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