访问者到我的网站可以点击“打印预览”按钮。 Javascript代码打开一个窗口,使用document.writelin()将创建一个显示动态内容的HTML页面(基本上,用户在看一个报告,这里的代码片断向你展示我的意思:
printerWindow = window.open("");
printerWindow.document.writeln("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
printerWindow.document.writeln("<html>");
printerWindow.document.writeln("<head>");
printerWindow.document.writeln("<title>Report Title</title>");
printerWindow.document.writeln("<link href='./css/schedule_print_preview.css' type='text/css' rel='stylesheet'>");
printerWindow.document.writeln("<link href='./css/schedule_printer.css' rel='stylesheet' type='text/css' media='print'>");
printerWindow.document.writeln("<script type='text/javascript'>");
printerWindow.document.writeln("function printcalc() {");
printerWindow.document.writeln("window.print();");
printerWindow.document.writeln("};");
printerWindow.document.writeln("<\/script>");
printerWindow.document.writeln("</head>");
printerWindow.document.writeln("<body>");
printerWindow.document.writeln("<div class='btns'>");
{...}
我想包括此页面上的“下载PDF”链接,以便访问者可以保存为PDF格式的报告。
这可能与ABCpdf 8.1吗? (我评价它。)我遇到的问题是搞清楚什么例子是最接近的一个什么,我需要做的。 有什么建议么? TIA。