Comments (6)
Hi Dave,
it looks like you will need to add some specific css to handle this
scenario.
You can use the @page directive to remove the default print margins, in
addition to overriding any css margins/padding/alignment in your css.
@page {
size: auto; /* auto is the initial value */
/* this affects the margin in the printer settings */
margin: 25mm 25mm 25mm 25mm; } /* try 0 */
body {
/* this affects the margin on the content before sending to printer */
margin: 0px; }
Change the margin under @page and let me know how that works out.
-Jason
from printthis.
Hi Jason,
Thank you so much. That worked an absolute treat. Just for info, here is the output of the working image.
Dave
from printthis.
Hi Jason,
I think I spoke to soon, I just tried it in IE and it looks the same as per the image in my first post. Can I check that my settings are correct:
debug: false, // show the iframe for debugging
importCSS: false, // import parent page css
printContainer: false, // print outer container/$.selector
loadCSS: "/style/printbarcode.css", // load an additional css file
pageTitle: "", // add title to print page
removeInline: false // remove all inline styles
Dave
from printthis.
Hi Jason,
Sorry to drive you mad. I just embedded my CSS directly in the page and set the importCSS to true and the margins do get set in IE, however I still get the Page1 of 1. So I must be somehow using the URL incorrectly in loadCSS ?
Dave
from printthis.
Dave,
try the full path - or embed the print styles into one of your other stylesheets.
Because the plugin creates an iframe, a relative path won't work correctly.
Thanks,
jason
from printthis.
Hi Jason, I fed in the css from my calling document (importCSS) which worked fine. For info I could not get the loadCSS to work.
Anyway thanks for the function and your assistance - all much appreciated.
Dave
from printthis.
Related Issues (20)
- importCSS: true disables orientation HOT 1
- custom style sheets and bootstrap not workinf HOT 4
- Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0 HOT 1
- Sketchfab Iframe with print option HOT 3
- My css not loading HOT 6
- Direct download PDF without popup preview. HOT 1
- debug: true not working HOT 2
- Disable page reload after printing? HOT 5
- Quality Reduction when printing from the browser HOT 6
- Custom CSS not loading on preview and not in pdf
- Working with datatables. HOT 1
- Blob image not printing HOT 1
- Printable Area HOT 1
- afterPrint event not working HOT 1
- RTL Page Print HOT 1
- Table is overlapping with footer image. HOT 1
- Loading a Style Sheet HOT 7
- Different footer in bottom of each page HOT 1
- how print on lanscape, any property HOT 1
- How to obtain the page numbers and total number of pages for each page when printing a bootstrap table, and fill them in the header of the table? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from printthis.