Use print dialog for custom PDF

I have a custom app that generates a PDF using the reportlab library. I can download the PDF just fine with a custom button. Is there any way I can pass it to the print dialog that is used by ERPNext print formats? I tried using an iframe and printing the iframe but it doesn’t work. I get a security error in the console