1

I am using ngx-print to perform the print action with css file, however, css is not working. Here is the example.

https://stackblitz.com/edit/demo-ngx-print-fmiwwr

Library reference.

https://www.npmjs.com/package/ngx-print

<button printSectionId="demo"
styleSheetFile="assets/css/print.css"
 ngxPrint>print</button>

All the css are in the print.css file.

3 Answers 3

2

please try to add this code, it works nicely for me

[useExistingCss]="true"

so it will be like this

<button [useExistingCss]="true" printSectionId="print-section" ngxPrint>print</button>
Sign up to request clarification or add additional context in comments.

Comments

0

I could fix your example by updating the ngx-print

"ngx-print": "^1.2.0-beta.5",

Comments

0

I also faced the same issue.try to give the CSS file in the assets folder itself, it won't work when we give the CSS in any other file.solved my issue.

<button printSectionId="print-section" class="btn save" printTitle="printHeading" styleSheetFile="assets/css/print-pdf.css" [useExistingCss]="true" ngxPrint>Print</button>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.