在 Azure 中托管 Winnovative HTML 到 PDF 转换器

Hosting Winnovative HTML to PDF Converter in Azure

我希望移植 ASP.NET MVC 5 应用程序以托管在 Azure.We 正在考虑在 Azure 应用服务中托管我们的应用程序。我的依赖项之一是 Winnovative 的 HTML 到 PDF 转换器。转换器在 Web 服务中不起作用,这是该软件的一个众所周知的问题。 Winnovative 的建议是:

For the situations when you must use the converter in an Azure Website and you cannot deploy your web application as an Azure Web Role or Worker Role or install it on an Azure Virtual Machine we developed a solution consisting in a service that you can deploy as a separate Azure Worker Role and a client library that you can link directly into your Azure Website to call that service completely transparent for you.

我已下载此软件并尝试将其托管在应用服务中,但这没有用(可能是由于相同的根本原因,转换器无法在我们的主应用程序中运行)。托管该服务的所有说明都说要以 Web 角色或辅助角色来托管它,但这些已被 Azure 弃用。如何使用当前的 Azure 选项托管服务?

Winnovative HTML to PDF Converter for Azure所述:

For Azure Websites we developed a solution consisting in a service that you can deploy as a separate Azure Worker Role and a client library that you can link directly into your Azure Website to call that service completely transparent for you. The API of the client library is almost identical to the general .NET library API.

您可以点击下载HTML to PDF Converter v14.4 for Azure下载解决方案。然后,您需要安装 HTML 到 PDF 服务器。正如 Readme.txt 文件中的说明所述,您可以按如下方式安装服务器:

  • 运行 HTML 到 Azure 云服务中的 PDF 服务器

    对于 Azure Cloud Service Worker 角色,您可以在 Server\Azure\TCP_Service 文件夹下找到它。和 Azure 云服务 Web 角色 可以在 Server\Azure\Web_Service 文件夹下找到。

  • 运行 在 Windows 服务中 HTML 到 PDF 服务器,您可以使用 Azure VM

更多关于HTML到PDF服务器安装的详细信息,您可以查看Readme.txt文件如下:

对于您的客户,您可以参考 WnvHtmlToPdf-Azure-v14.4\Demo 下的示例,或者您可以直接将 NuGet 包 WnvHtmlToPdf_Azure_Client 引用到您的项目中,然后按照Winnovative HTML to PDF Converter for Azure 下的 Azure 代码示例 部分连接 HTML 到您之前安装的 PDF 服务器。

此外,如Azure-Web-App-sandbox所述:

The following PDF generators are supported: