获取网站的网址,并使用PHP将该链接的html页面转换为PDF [复制]

This question already has an answer here:

I have created a form. Whenever someone pastes the url of a website such as https://google.com in that form and after hitting the submit button, it will convert the webpage to pdf and prompt us to save in the disk. Can anyone please tell me how to do this ? I know about DOMPDF

</div>

You can try HTML2PDF library - Html2PDF - We have had good luck with that - however there are several caveats with using it -

  • HTML must be correct
  • Images must be full path (http:// ... )
  • Not all style makes it through.