简体   繁体   English

我希望能够将一系列特定的网页作为一个文档(最好是PDF)进行打印。

[英]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.

相关问题 像一系列的ppt一样自动执行 - automate the walk of a ppt like series of web pages 通过JavaScript将网页打印为pdf - Print web pages to pdf via JavaScript 我想更新MongoDb文件 - I would like to update MongoDb document 我想知道如何与网络中的打印机进行通信,而无需通过chrome打印弹出窗口 - I would like to know how to communicate with a printer in the web without going through the chrome print pop-up 我将如何清理这个字符串? (最好在 JQuery 中)? - How would I sanitize this string? (preferably in JQuery)? 尝试动态打印服务器列表,当我单击一个服务器时,我想显示我刚刚单击的内容 - Trying to dynamically print a list of servers and when i click on one i would like to display what i just clicked on 如何在 ReactToPrint 库中自定义打印 pdf 的按钮链接? - How would I customize the button link of print pdf in the library ReactToPrint? 如何在Squarespace之类的网页上制作预加载器 - How would I be able to make a preloader on a webpage like Squarespace 想要在一个特定页面上使用不同的导航菜单...不起作用 - Would like a different nav menu on one specific page… not working 我是否可以安全地访问特定的电子API? - Would I be able to give access to specific electron APIs safely?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM