printing-web-page

scale html table before printing using css

不想你离开。 提交于 2019-12-02 20:30:27
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 the printer settings of IE, Firefox, and Chrome. Is there a way to scale the whole page (which in my

Specify hairline thickness in CSS for printing

大憨熊 提交于 2019-12-02 19:27:50
If I have a print CSS styling an element with: border:1px solid black; or: border:0.25pt solid black; The line is very thick when it prints – at least 1pt. If I try a much smaller value, such as 0.05pt, the line doesn't appear at all. How can I get a thin line? In programs like InDesign you set the thickness to 0.25pt for a 'hairline', i.e. a very thin line but not so thin that it won't be printable. Note: this question seems to ask the same thing, but nobody has addressed the actual issue of the line thickness, merely the best units of measure to use: pt or px for specifying border-width for

pt or px for specifying border-width for print

允我心安 提交于 2019-12-02 07:03:33
问题 should i use pt or px when specifying border-width in css for media print? i basically just want hairlines 回答1: For print you should use pt, as it's an absolute unit not based on the resolution of the media. 回答2: for hairlines use just px 回答3: In general you should use points or em's in place of pixels when possible. The reason is that points and ems both scale with the users' resolution or zoom setting where pixels do not. On many larger, high definition or wide screen monitors individual

pt or px for specifying border-width for print

会有一股神秘感。 提交于 2019-12-02 03:24:18
should i use pt or px when specifying border-width in css for media print? i basically just want hairlines For print you should use pt, as it's an absolute unit not based on the resolution of the media. for hairlines use just px In general you should use points or em's in place of pixels when possible. The reason is that points and ems both scale with the users' resolution or zoom setting where pixels do not. On many larger, high definition or wide screen monitors individual pixels are too small to be reliably useful for placement. 来源: https://stackoverflow.com/questions/3186925/pt-or-px-for

text-shadow and box-shadow while printing (Chrome)

荒凉一梦 提交于 2019-12-01 15:18:14
I'm making some printable calendar website using HTML, CSS and JS. Unfortunately I cannot use CSS property called text-shadow , because shadow behind text prints as solid black text without any blur or transparency. Same problem occurs when I'm trying to use box-shadow for any div - shadow prints like solid black color with no transparency. I'm using Chrome with style html {-webkit-print-color-adjust: exact;} to ensure all background colors will be printed. Any workaround? I would prefer not to use any background image. Edit: I don't want to hide shadows, it's very easy of course. I want to

How to make a printout of a div? [closed]

白昼怎懂夜的黑 提交于 2019-12-01 10:57:18
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago . How do I print out a particular div in my page using Javascript? 回答1: Here is an implementation that has been tested in IE8 and FF3.6.6 on windows There are some stuff that can be streamlined, but other that are

Print Stylesheets for pages with long horizontal tables

爷,独闯天下 提交于 2019-11-30 20:07:23
I have a page that spits out db data in long horizontal tables. I need to print it nicely so it does not cut off. Any tips ? If it doesn't fit on the paper in a readable font, it just doesn't.. In my opinion, huge horizontal tables (be it a HTML table or an Excel sheet with many columns) don't lend well to printing. For that matter, they don't lend well to viewing on a screen either. Remember vertical scrolling is much easier for your users than horizontal scrolling - all thanks to that little wheel on your mouse. Worst case, you might need to write a seperate print version which uses a

Bootstrap 3 Pages Printing Mobile Version

柔情痞子 提交于 2019-11-30 19:31:19
When we print pages from our web site, which is based on Bootstrap 3, they are printing on some browsers showing the mobile version. I have Googled to try and find a good solution, but not really found anything that works. Using the same CSS for the screen and adding the "print-hidden" class to specific DIV's our pages look fine using Safari on a Mac, but using Chrome on the Mac or Firexof and Chrome on the PC the print preview shows the mobile version. Is there an easy way to tell the browser that the viewport width is a regular screen not a phone (XS), or do we have to incorporate a lot of

Determine If Print/Cancel Button in Google Chrome's Print Preview is Clicked

ぐ巨炮叔叔 提交于 2019-11-30 18:00:00
I've been printing my page using the code below: window.print(); An image below is what the print preview in Google chrome browser looks like. It has two main buttons: print and cancel . I want to know if the user has clicked the print or cancel buttons. What I did uses jquery: HTML Code of the Print Preview: <button class="print default" i18n-content="printButton">Print</button> <button class="cancel" i18n-content="cancel">Cancel</button> Jquery Code: $('button > .cancel').click(function (e) { alert('Cancel'); }); $('button > .print').click(function (e) { alert('Print'); }); I tried the code

Using CSS and/or jQuery for Printed Pages with Page Breaks

末鹿安然 提交于 2019-11-30 14:07:26
问题 I have a dynamically generated html page which is designed to be printed. I would like to create page breaks based upon div sections - where any given div - if it DOES NOT fully fit on the page, insert a page break before it. In theory, anywhere from a single div, up to perhaps 10, may fit on a single printed page, so I am thinking I will need to use jQuery to to the insertions after the page is loaded. If this were a desktop application, I would approach it something like this: Measure the