Angular ngx-print Example to Print HTML Section to PDF in Modal Window With CSS in Browser Using TS

 

Install ngx-print

 

Install the ngx-printlibrary via npm:

 

npm i ngx-print

 

 

Import NgxPrintModule

 

Add the NgxPrintModule to your application. Open app.module.ts and update it as follows:

 

 

4. Add a Basic Print Example

 

Now let’s add a simple example of creating print modal window in app.component.ts and app.component.html.

 

app.component.ts

 

Here we define sample typescript file

 

 

app.component.html

 

Display avatars based on user data:

 

 

 

 

FULL SOURCE CODE

 

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *