简体   繁体   English

如何使用HTML / JavaScript / Jquery以A4尺寸以横向打印网页,而不会丢失任何内容

[英]How to programatically print the web page in A4 size, Landscape orientation without loosing any contents using HTML/JavaScript/Jquery

Please reply with solution for: 请回答以下解决方案:

print the web page in A4 size, Landscape orientation without loosing content and clarity OR 以A4尺寸打印网页,横向放置而不会丢失内容和清晰度,或者

Convert web page to PDF or Image( A4 size, Landscape orientation without loosing content & image clarity) 将网页转换为PDF或图像(A4大小,横向放置而不丢失内容和图像清晰度)

Programming language: HTML/Javascript/jQuery 编程语言:HTML / Javascript / jQuery

My current code is : 我当前的代码是:

//patInstallBrochure.html //patInstallBrochure.html

  <!doctype html> <html> <head> <title>Generated at http://psd2htmlconverter.com - Your site's title should be here</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta name="description" content="Generated at http://psd2htmlconverter.com - Your site's description should be here"> <meta name="keywords" content="Generated at http://psd2htmlconverter.com - Your site's keywords should be here"> <meta name="generator" content="http://psd2htmlconverter.com"> <link rel="stylesheet" type="text/css" href="PatientInstallationBrochureFront/style.css"> </head> <body> <FORM NAME="joe"> <INPUT TYPE="hidden" NAME="burns"> <div class="front group"> <div class="left group"> <img class="android_icon" src="PatientInstallationBrochureFront/images/android_icon.png" alt="" width="267" height="310"> <p class="android">Android</p> <p class="downloading_installing_en"><strong><a href="#" style="text-decoration: underline; font-size: 58.33333px; font-variant: small-caps; color: #1e172b; font-weight: 600;">Downloading/Installing </a></strong><br><span style="line-height: 58px;">&nbsp;</span><br>Ensure you have a gmail account before starting<br><span style="line-height: 58px;">&nbsp;</span><br>Search for “247Patient” in the google playstore and download/install the app on your phone<br><span style="line-height: 58px;">&nbsp;</span><br><strong><a href="#" style="text-decoration: underline; font-size: 58.33333px; font-variant: small-caps; color: #1b1126; font-weight: 600;">Configuring 247Patient Application</a></strong><br><span style="line-height: 58px;">&nbsp;</span><br>Open the 247Patient App<br><span style="line-height: 58px;">&nbsp;</span><br>Enter the <em>Clinic mobile number</em>&nbsp;(found on first page of brochure) and click “Configure”<br><span style="line-height: 58px;">&nbsp;</span><br>You will be automatically redirected to the login screen of your clinic.<br><span style="line-height: 58px;">&nbsp;</span><br>You will also receive an SMS with your login details.<br><span style="line-height: 58px;">&nbsp;</span><br>Enter your login detials in the login page and hit login to access your clinic<br><span style="line-height: 58px;">&nbsp;</span><br>Now you will have full access to your 247Patient App and you can start booking appointments</p> </div> <div class="center"> <p class="support_information"><a href="#">Support Information</a></p> <p class="web_url"></p> <p class="inputTxt" id="webUrl" align="left" ></p> <p class="use_the_above_url_for_boo">(Use the above URL for booking appointments through the internet.)</p> <p class="for_a_full_list_of_featur">For a full list of features and more detailed instructions, visit<strong style="font-style: normal; font-weight: bold;">&nbsp;www.247doctorcare.com</strong></p> <p class="address"><div style="text-align: center;"> <span style="font-size: 75px; font-weight: bold;">Address:</span></div></p> <p class="inputTxt" id="addr1"></p> <p class="inputTxt" id="addr2"></p> <p class="inputTxt" id="addr3"></p> </div> <div class="right"> <p class="patient_installation_guid"><a href="#">Patient Installation Guide</a></p> <p class="clinic_name"></p> <p class="inputTxt" id="cName"></p> <p id="cCNo"></p> <p class="clinic_mobile_number_only"><span style="font-size: 60px;">Clinic Mobile Number</span><br><a href="#" style="text-decoration: underline; font-variant: small-caps;">(Only for Installation)</a></p> <div class="rectangle_1"><p id="cMobNo" class="inputTxt"></p></div> <img class="logo" src="PatientInstallationBrochureFront/images/logo.png" alt="" width="649" height="125"> </div> </div> </FORM> </body> <div style="zoom: 400%;"> <script type="text/javascript"> var pdfbuttonlabel="Save page as PDF" </script> <script src="http://www.web2pdfconvert.com/pdfbutton2.js" id="Web2PDF" type="text/javascript"></script> <!-- Web2PDF Converter Button END --> <p align="right">Page : <a href="patInstallBrochure.html">1 &nbsp; &nbsp; </a><a href="patInstallBrochureback.html">2 &nbsp; &nbsp; &nbsp; </a></p> </div> </html> 

You can use html2canvas js plugin for your requirement. 您可以根据需要使用html2canvas js插件。 It is capable of printing a webpage without loosing content & image clarity. 它能够打印网页而不会丢失内容和图像清晰度。

here is the link for html2canvas you can find the full documentations and usage in this link. 这是html2canvas的链接,您可以在此链接中找到完整的文档和用法。

For further queries you can find the github link on website. 对于进一步的查询,您可以在网站上找到github链接。

Happy Coding.... 编码愉快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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