printing-web-page

Window.print() sets default copies to 2

主宰稳场 提交于 2020-07-09 03:55:10
问题 I have a requirement that by clicking on a button, the printer dialog will open with the number of copies set to 2 instead of the default number 1. 回答1: No it is not possible using pure javascript with window.print(). However, if you are open to using Java Applet, take a look at qz-print aka jzebra. I have personally used this in some past projects for some advance printing requirements and the result is very satisfying. Take a look at their printHTML() method ********************************

Printing with bootstrap css

给你一囗甜甜゛ 提交于 2020-01-23 06:32:14
问题 I have a page with bootstrap css layout. I am trying to print off a table. However the table looks nothing like it does on screen. I include the css file like this: <link href='../bootstrap.min.css' rel='stylesheet' type='text/css'> Is there a way to get the printed table to look the same as on screen or do I have to create a specific css file just for the table I want to print? 回答1: You can apply the style sheet too both print and screen using media='screen,print' <link ../bootstrap.min.css'

how to print the gridview of page in require format

ε祈祈猫儿з 提交于 2020-01-15 05:25:06
问题 I have a gridview from database and the issue is i want to print the whole page when the user click the print button each row of gridview print in given format as 3 row on 1 A4 size page. gridview Printing format 回答1: if you want to using javascript so you can try this function printItn() { //In my case i have append gridview in Panel that y..you can put your contentID which is you want to print. var printContent = document.getElementById('<%= pnlForm.ClientID %>'); var windowUrl = 'about

How to print formatted html in Linux server

核能气质少年 提交于 2020-01-11 13:01:51
问题 ASP.NET MVC 4 application runs in Debian Squeeze Linux using Mono. Controller creates html document like code below. html contains simple positioning divs and formatting instructions. Linux server is running in internet provider and there are no desktop components installed. Additional components can installed if required. This is older, squeze x64 linux. How to print this html file to Samsung printer connected to server ? It there some executable which can used for this ? wkhtmltopdf and

How to print formatted html in Linux server

浪子不回头ぞ 提交于 2020-01-11 13:01:26
问题 ASP.NET MVC 4 application runs in Debian Squeeze Linux using Mono. Controller creates html document like code below. html contains simple positioning divs and formatting instructions. Linux server is running in internet provider and there are no desktop components installed. Additional components can installed if required. This is older, squeze x64 linux. How to print this html file to Samsung printer connected to server ? It there some executable which can used for this ? wkhtmltopdf and

Alternative for page-break-inside: avoid

笑着哭i 提交于 2020-01-02 00:53:05
问题 I have a page which generates coupons. Each coupon is a div with a height varying depending on the content. I want to print as many coupons on each page as possible, but I do not want the coupons to be split out over several pages. The CSS property page-break-inside does exactly what I need. However, I need this to work for Firefox and/or Chrome. And this is not supported. Two years and one year ago the same question was asked, and there was no good alternative for this. We are a lot of CSS3

Keep contents of a div together for printing in IE8

泄露秘密 提交于 2019-12-22 05:11:49
问题 Given the following HTML document, I need to keep the "Table title" line on the same page as the <table> when being printed in IE8. Despite the page-break-inside:avoid; , there is still a page break between the title and the table. My understanding of this suggests a page break should be avoided and the whole div pushed on to page 2. The doctype is XHTML 1.0 Transitional, I have <meta http-equiv="X-UA-Compatible" content="IE=8" /> set to force IE8 into Standards Mode which supposedly supports

print from html pages in A4

余生颓废 提交于 2019-12-21 21:05:24
问题 I am designing this site which is for technical engineers to take prints from and the page sizes are varied. When pages are printed tables get cut up into 2 halves which makes it difficult for them to read. Is there any code which can make the prints fit into one A4 sheet per page. The other solution is that i make PDF's of each page in A4 size and put a 'print this page' button on every page, but that seems a little unprofessional, any ideas? 回答1: Try using the CSS media attribute to specify

scale html table before printing using css

给你一囗甜甜゛ 提交于 2019-12-20 09:49:53
问题 I have a table as the entire content of an HTML document (for legitimate table purposes...it is table data, not for layout). Some cells have widths and heights specified (not through css but using the old sizing inline in a table structure), but the overall table does not have a width or height specified. This is a fairly large table, but with proper scaling (about 70%) it can be printed to fit nicely on a single sheet of paper. This can be accomplished by using the scale page function within

Unable to insert stylesheet/script into window.open

怎甘沉沦 提交于 2019-12-19 21:59:11
问题 I have been fighting this issue for quite some time now, and have been (still) unable to print my div with its styling. Currently, my script is: $('#printMeButton').click(function () { //alert("a"); var data = document.getElementById('thisPrintableTable').outerHTML; var mywindow = window.open('', data); mywindow.document.write('<html><head><title>Print Me!!!</title>'); // mywindow.document.write('<link rel="stylesheet" type="text/css" href="Site.css" media="screen">'); mywindow.document.write