且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ASP.NET Core中Azure上的Phantom pdf

更新时间:2022-05-07 00:41:46

phantomjs和其他pdf渲染在默认Windows Server上运行的Azure App服务中不起作用.但是,您现在可以使用在jsreport可以正常工作的linux上运行的Azure App服务.

phantomjs and other pdf rendering won't work in Azure App service running on default Windows Server. However you can now use Azure App service running on linux where jsreport nicely works.

创建新的App Service并使用基于节点的容器时,您只需要切换到Linux上的Web App.然后,您可以使用docker hub将带有jsreport的图像直接下载到Web App中.最简单的方法是使用官方的jsreport图像,但也很容易使用您自己的图像.

You just need to switch to Web App on Linux when creating new App Service and use node based container. Then you can use docker hub to download an image with jsreport right into the Web App. The simplest is to use official jsreport image but it is easy to use also your own.

链接
教程如何在Linux上的Azure Web App上运行jsreport
jsreport官方docker镜像

Links
Tutorial how run jsreport on Azure Web App on linux
jsreport official docker image

我知道我没有回答如何在与asp.net core相同的应用程序中实际运行它.我目前不知道该怎么做,但是我建议您在单独的应用程序中运行asp.net应用程序和jsreport.您可以通过REST轻松调用jsreport呈现.这也可以改善您的架构设计.

I'm aware I didn't answer how to actually run it in the same app as asp.net core. I don't know how to do that currently, but I suggest you to run asp.net application and jsreport in separate apps. You can easily invoke jsreport rendering through REST. This could also improve your architecture design.