I am trying to implement a print button that allows users to print specific content on the page, however, the default print preview does not meet my requirements.
Specifically, I want to print only this visualization:
https://i.sstatic.net/gDhlM.png
Unfortunately, clicking the print button also includes the sidebar in the printed output:
https://i.sstatic.net/Uc3rV.png
Is there a way to extract a particular div for printing purposes? I'm unsure how to achieve this.
<div class="home-content wrapper-component ">
<!-- Portfolio Securities-->
<h1 class="text-center pt-4 pb-3">Portfolio Securities</h1>
...
In my TS file, I have the following function:
printPage() {
window.print();
}