Does iText (any version) work on Windows Azure websites?

余生长醉 提交于 2019-12-29 06:29:50

问题


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.


回答1:


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).



来源:https://stackoverflow.com/questions/45471073/does-itext-any-version-work-on-windows-azure-websites

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!