使用PHP脚本以PDF格式打印预览
问题描述:
您好,
我需要使用PHP脚本进行PDF格式的打印预览,例如 Google Chrome打印预览
答
您可以在指向Google Doc Viewer的php页面中嵌入iframe,并指定要显示的PDF文件。这是您应该添加到页面的代码:
You can embed an iframe in your php page pointing to Google Doc Viewer and specifying the PDF file you want to display. This is the code you should add to your page:
<iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
然后你只需要设置自己的文档文件到url查询字符串param,就是这样!
Then you just need to set up your own document file to the "url" query string param and that's it!