In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article Xiaobian introduces in detail "how to convert HTML files into pdf files", with detailed contents, clear steps and proper handling of details. I hope that this article "how to convert HTML files into pdf files" can help you solve your doubts.
In fact, it can be achieved without additional software, which requires the use of headless chrome. You can first prepare the HTML files that need to be converted, and then run the following command:
Chrome-headless-disable-gpu-print-to-pdf file://
If the above features are too simple to meet your needs, you can use node.js puppeteer. The difference between headless chrome and puppeteer is that puppeteer is a module with more specific functions, through which HTML can be easily converted to PDF.
Code:
Const puppeteer = require ('puppeteer'); (async () = > {const browser = await puppeteer.launch (); const page = await browser.newPage (); await page.setContent (html: {waitUntil:' networkidle2'}); await page.pdf ({path: 'page.pdf', format:' A4'}); await browser.close ();}) () Read here, this "how to convert HTML files into pdf files" article has been introduced, want to master the knowledge of this article also need to practice and use in order to understand, if you want to know more about the article, welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.