[英]I would like to be able to print a specific series of Web pages as one document (preferably PDF).
All I have found online is about printing individual Web pages one at a time. 我在网上发现的所有内容都是关于一次打印单个网页。
The reason is that our website currently has a number of "publications" on it (ranging from 15 to 50 individual Web pages each). 原因是我们的网站上目前有许多“出版物”(每个网站有15至50个单独的网页)。 Before the Web, we printed and sold them
在网上之前,我们印刷并出售了它们
What we're doing now is producing a series of Web pages on each topic. 我们现在正在做的是针对每个主题生成一系列网页。 Then we go back to the original in MS Word and make that into a multipage PDF, linked to the page.
然后,我们回到MS Word中的原始文档,然后将其制作成链接到该页面的多页PDF。
We would really prefer to only do things once -- easier to update and fewer errors. 我们真的更愿意只做一次事情-更容易更新并且更少的错误。
I know it's possible in some CMS's (such as Drupal) to arrange a series of Web pages as a "book" so that the entire thing can be printed. 我知道在某些CMS(例如Drupal)中,可以将一系列网页安排为“书”,以便可以打印整个内容。 What I want to know is whether there's any other way to do this (since we aren't using Drupal).
我想知道的是,是否还有其他方法可以做到这一点(因为我们没有使用Drupal)。
If there's a way to put code into the page that says "If someone presses this button, print this list of pages as one PDF" I'd like to know how. 如果有一种方法可以将代码输入“如果有人按此按钮,则将此页面列表打印为一个PDF”的页面,我想知道如何。 (HTML? JavaScript? something else?)
(HTML?JavaScript?其他?)
Yes its possible. 是的,它有可能。
The button would need to make a request to the server with the identifiers of the selected pages to generate 该按钮将需要使用所选页面的标识符向服务器发出请求,以生成
The server then would need to render the pages internally into an object such as string. 然后,服务器将需要在内部将页面呈现为对象(例如字符串)。 (whatever your library prefers)
(无论您的图书馆喜欢什么)
You then can send the HTML string to a PDF converter such as Expert Pdf Html To Pdf Converter to generate a PDF rendition of the document. 然后,您可以将HTML字符串发送到PDF转换器,例如Expert Pdf Html To Pdf Converter,以生成文档的PDF格式。
Then just serve the PDF binary as a response to the client. 然后只需将PDF二进制文件作为对客户端的响应即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.