javascript - A problem with the code for saving web page printing pages as pdf
黄舟
黄舟 2017-07-05 10:43:30
0
2
970

This is what the printed page says

<button type="submit" class="btn btn-default navbar-btn " onclick="window.print();">打印</button>

When you print it out, you also need to select the target as Save as PDF to save it as a PDF.

Can I just click the button to download the pdf?

The project is for ASP.NET webform. Can it be implemented using js or C#?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
迷茫

To provide an idea, if you want to download PDF files directly, you may need to change the JS method to directly download the URL request, and return the Response in the background to directly return to the PDF file stream.

習慣沉默

The back-end uses phatomjs for rendering. After rendering the web page, a pdf file is generated, and then the front-end downloads the file directly.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!