Convert HTML files designed for IE 7, 8 and 9 to PDF using Aspose PDF

試著忘記壹切 提交于 2019-12-08 11:42:17

问题


I have several thousands of HTML files that are designed for and work only in IE 7, 8 and 9.

When I try to convert these to using c# with the code below, they are not properly converted. (i.e. they are converted similar to how it is displayed in IE 11 which is not what's needed).

Link to HTML file:

https://www.dropbox.com/s/8mzln3jjify4yi0/input.zip?dl=0

If you open the HTML file with the current version of IE and go to Developer Tools within IE and emulate IE 7, 8 or 9, the HTML page is displayed properly.

Code:

String basePath = "C:\\temp\\";
HtmlLoadOptions htmloptions = new HtmlLoadOptions(basePath);
// Load HTML file
Document doc = new Document("input.htm", htmloptions);
// Save HTML file
doc.Save("output.pdf");

How can I get the HTML files to be converted to PDF exactly like how they look in IE 7, 8 or 9? Are there any options or parameters that can be changed to make them convert properly as needed?


回答1:


I have tested the scenario using latest release of Aspose.Pdf for .NET 16.10.0 and I am unable to notice any issue. As per my observations, the PDF file is properly being generated. Please take a look resultant PDF file.

PS, My name is Nayyer and I am developer evangelist at Aspose.



来源:https://stackoverflow.com/questions/40429220/convert-html-files-designed-for-ie-7-8-and-9-to-pdf-using-aspose-pdf

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