Does anybody of you know how it's possible to print a section of my website using Angular 5? I tried finding a solution on the internet, but it seems to me that there are only solutions available for Angular.
To print the document, use the print method from document editor instance. Refer to the following example for showing a document and print it. import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { enableProdMode } from '@angular/core'; import { AppModule } from './app.
Print media is one of the oldest and basic forms of mass communication. It includes newspapers, weeklies, magazines, monthlies and other forms of printed journals. A basic understanding of the print media is essential in the study of mass communication.
Print. js was primarily written to help us print PDF files directly within our apps, without leaving the interface, and no use of embeds. For unique situations where there is no need for users to open or download the PDF files, and instead, they just need to print them.
There is 2 ways you can do it. 1. using print-js
npm install print-js
add the script route to the angular-cli.json
"../node_modules/print.js/src/index.js"
add the print functionality to the html file
<div class="welcome-screen-wrapper-new-test">
<div class="welcome-screen-header" id="what-needs-to-be-printed-page">
printing section goes here
</div>
<div class="new-test-print">
onClick function goes here
<div class="print-wrapper" onclick="printJS('print-page', 'html')">
<span class="icon print"></span>
</div>
</div>
</div>
DONE!
<script src="https://printjs-4de6.kxcdn.com/print.min.js"></script>
Add use the same html format.
GOODLUCK!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With