使用Aspose PDF将为IE 7、8和9设计的HTML文件转换为PDF [英] Convert HTML files designed for IE 7, 8 and 9 to PDF using Aspose PDF

查看:100
本文介绍了使用Aspose PDF将为IE 7、8和9设计的HTML文件转换为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数千个HTML文件,这些文件是为IE 7、8和9设计的并且只能在IE 7、8和9中工作.

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

当我尝试使用下面的代码将它们转换为使用c#时,它们没有正确转换. (即,它们的转换类似于不需要IE 11中的显示).

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

链接到HTML文件:

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

如果使用当前版本的IE打开HTML文件并转到IE中的开发人员工具并模拟IE 7、8或9,则HTML页面将正确显示.

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.

代码:

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");

如何将HTML文件完全转换为PDF,就像它们在IE 7、8或9中的外观一样?是否有任何选项或参数可以更改,以使它们根据需要正确转换?

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?

推荐答案

我已经使用最新版本的结果PDF文件.

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,我叫Nayyer,我是Aspose的开发人员.

这篇关于使用Aspose PDF将为IE 7、8和9设计的HTML文件转换为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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