你将如何简化这个过程?

我有一堆(超过1000)只有简单的文本的HTML文件。 这只是<table>本的组合。 这是一批内部文件,不适用于网页制作。

我们的工作是使用Photoshop和旧的复制粘贴方法将它们转换成JPEG文件。 这是乏味的。

有没有一种方法可以使这个过程更加高效/简单/简单?

我曾试图将HTML转换成Excel,然后将它合并到Word中作为JGEG打印。 但是我找不到(也没错)将HTML转换为XLSX。

思考? 或者这只是一个手动工作?

这是我创build一个单一的HTML文件转换为JPEG的一点点。 这不是很漂亮(至less可以这么说),但是对于大于我的屏幕的表格,它可以正常工作。 把它放在一个Windows窗体项目。 你可以添加更多的检查,并在一个循环中调用这个程序,或者重构它来处理多个html文件。

思想和技术取自 –

find所需的大小 – http://social.msdn.microsoft.com/Forums/ie/en-US/f6f0c641-43bd-44cc-8be0-12b40fbc4c43/webbrowser-object-use-to-find-the-width-of -a-网页

创buildgraphics – http://cplus.about.com/od/learnc/a/How-To-Save-Web-Page-Screen-Grab-csharp.htm

以表格为例 – 复制粘贴http://www.w3schools.com/html/html_tables.asp的放大版&#x672C;

 static class Program { static WebBrowser webBrowser = new WebBrowser(); private static string m_fileName; [STAThread] static void Main(string[] args) { if (args.Length != 1) { MessageBox.Show("Usage: [fileName]"); return; } m_fileName = args[0]; webBrowser.DocumentCompleted += (a, b) => webBrowser_DocumentCompleted(); webBrowser.ScrollBarsEnabled = false; // Don't want them rendered webBrowser.Navigate(new Uri(m_fileName)); Application.Run(); } static void webBrowser_DocumentCompleted() { // Get the needed size of the control webBrowser.Width = webBrowser.Document.Body.ScrollRectangle.Width + webBrowser.Margin.Horizontal; webBrowser.Height = webBrowser.Document.Body.ScrollRectangle.Height + webBrowser.Margin.Vertical; // Create the graphics and save the image using (var graphics = webBrowser.CreateGraphics()) { var bitmap = new Bitmap(webBrowser.Size.Width, webBrowser.Size.Height, graphics); webBrowser.DrawToBitmap(bitmap, webBrowser.ClientRectangle); string newFileName = Path.ChangeExtension(m_fileName, ".jpg"); bitmap.Save(newFileName, ImageFormat.Jpeg); } // Shamefully exit the application Application.ExitThread(); } } 

你可以加载一个页面的所有文件,并使用这个lib html2canvas来隐藏。

您可以使用node-canvas在后台运行nodejs,或者使用node-webkit将其设置为桌面应用程序