Comments (9)
Sure. It's nothing special. This prints qr codes. Code below:
var printContents = document.querySelector('.print-content').innerHTML;
var popupWin = window.open('', '_blank', 'width=600,height=600');
popupWin.document.open();
popupWin.document.write('<html><head><style>* {font-family: Arial}.qr-code {display: inline-block; margin-top: 20px; position: relative; } .qr-title {display: inline-block; position: absolute; right: 0; width: 50%; text-align: center;} .qr-code-code {display: block; margin-top: 20px;}</style></head><body onload="window.print()">' + printContents + '</body></html>');
popupWin.document.close();
from angularprint.
Hey guys,
I've fought a lot against browser printing and it seems most problems are related to the browser itself.
I ended up by avoiding using any overflow hiddens elements, or event position relative/absolute. @MaximilianLloyd 's solution is great because putting the content into a popup creates a "printable" version of your content, with a much simpler layout.
from angularprint.
Hi,
I am also having the same issues in creating multiple page inside the table row. Page break is not working. Did you get any solution. Can you help me how to insert page break inside ng-repeat?
from angularprint.
Sadly i have still not found a solution to this problem :-(.
from angularprint.
I have the same issue too, any solution yet?
from angularprint.
No, sadly not. I ended up just coding a custom solution.
from angularprint.
Would you mind sharing you custom solution here?
On Fri, Aug 19, 2016 at 17:42 Maximilian Lloyd [email protected]
wrote:
No, sadly not. I ended up just coding a custom solution.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#26 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC1H_lW5GnQnZPvAy6Icfhsq-tJDBqvLks5qhiNBgaJpZM4I8RgL
.
from angularprint.
It works! Thank you very much @MaximilianLloyd
from angularprint.
No problem @yuanda, glad to help ;).
from angularprint.
Related Issues (20)
- Print View Uses Entire Site CSS HOT 1
- Firefox only Prints 1 Page HOT 4
- table not printer headers on page breaks
- License file
- Bower can't find this package HOT 3
- PrintIf doesn't remove space HOT 1
- Doesn't get all data when I have a scroll on inner div HOT 4
- print-if does not work
- print-btn and ng-click HOT 1
- Chrome 54 suddenly changes my right and bottom margin HOT 1
- White space HOT 1
- print-landscape does not work
- print-btn directive causing click event on element is fired after print window closed
- Prints extra page HOT 1
- print-section width
- Create new release
- npm package / other forks?
- PrintSection and ngBindHTML directive
- Page printed multiple times
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 angularprint.