简体   繁体   中英

The best way to convert web-page to pdf image

任何人都可以告诉我一个简单的方法将网页屏幕截图转换为PDF格式

If you are trying to do this from a desktop user standpoint
Windows: http://www.go2pdf.com/product.html
Linux: http://www.linux.com/archive/feed/35022

If you mean form code then:
PHP: http://www.imagemagick.org/script/formats.php

But more information would definitely be useful :D

PDFMyURLcom , hands down.

Perfect rendering, except for some custom fonts. Here's an example:

http://pdfmyurl.com?url=github.com/portfolio&-B=0mm&-T=0mm&-L=0mm&--margin-right=0mm&--page-size=A3&-O=Portrait .

Creating a PDF from HTML instead of letting the user just see the HTML should not be done without consideration. If you already have a usable HTML page you can display, ask yourself: what would the user benefit from having this in a PDF ? If the issue still stands, here are a few options:

  • Use the well known but buggy DOMPDF . All you need is PHP, and it renders somewhat decent. They had some security problems but those went relatively unnoticed because no big fish is using it. No CSS support.
  • Use wkhtmltopdf which is absolutely great, supports CSS etc. Thing is, it requires access to the box. Oh, and another pesky little issue, X client libraries must be installed. Aside from that, it renders great and the PDF you are producing ends up looking a lot like the original page.
  • If the HTML is dynamic (outputted by some script), have it outputted directly as a PDF, using PDFLIB or it's poor cousin FPDF .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM