iText(任何版本)是否适用于Windows Azure网站? [英] Does iText (any version) work on Windows Azure websites?

查看:192
本文介绍了iText(任何版本)是否适用于Windows Azure网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure App Service(以前称为网站)存在许多限制,因此我想知道iText的PDF创建工具是否仍然有效。具体来说,我将HTML转换为PDF,包括各种样式和图像。



由于受限制,rotativa和Pechkin都不能在Azure App Service上工作。

解决方案


Azure App Service(以前称为网站)有很多限制,所以我想知道iText的PDF是否有用创建工具仍然有效。


根据我的测试以下示例,我可以使用



此外,我使用的是iText的基本功能,它在 Azure Web App沙箱。如果iText的任何高级功能无法在沙箱上运行,您可以尝试其他托管选项(例如云服务,虚拟机)。


There are many limitations with the Azure App Service (formerly websites), so I was wondering if iText's PDF creation tools still worked. Specifically, I will be converting HTML to PDF, including all manner of styles and images.

Neither rotativa nor Pechkin work on Azure App Service due to its limitations.

解决方案

There are many limitations with the Azure App Service (formerly websites), so I was wondering if iText's PDF creation tools still worked.

Based on my test with following sample, I can use iText 7 to generate PDF file, and it works fine on Azure App Service Web App.

var path = Server.MapPath("test.pdf");

FileInfo dest = new FileInfo(path);

var writer = new PdfWriter(dest);
var pdf = new PdfDocument(writer);
var document = new Document(pdf);
document.Add(new Paragraph("hello world"));
document.Close();

Generated PDF:

Besides, I am using the basic feature of iText, which works fine on Azure Web App sandbox. If any advanced features of iText can not work on sandbox, you can try another hosting options (such as Cloud Services, Virtual Machines).

这篇关于iText(任何版本)是否适用于Windows Azure网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆