0

I need to print a pdf file. The file names are listed from a database loop that contains the filenames of files within a folder. I have a script that can directly send to the printer, but I want to open the dialogue page instead. Depending on the file, I may only want certain pages printed.

<button type="button" onclick="printJS({printable:'NEWPDF/<%=VAR2%>.pdf', type:'pdf', showModal:true})">

Also using <script src="https://printjs-4de6.kxcdn.com/print.min.js"></script> <script src="https://printjs-4de6.kxcdn.com/print.min.css"></script>

How do I open the dialogue??

Thanks

user692942
  • 16,398
  • 7
  • 76
  • 175
Penguin
  • 13
  • 3
  • Also using ` ` – Penguin Sep 01 '21 at 17:11
  • Does this answer your question: [`window.print()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/print)? – Scott Marcus Sep 01 '21 at 17:21
  • No because I do jot wish to print the current page. I wish to print the page that is a variable that contains the link to the pdf file. – Penguin Sep 01 '21 at 18:57
  • Why don't you just make a link that opens a new window to that pdf file and then brings up the print dialog instead of trying to do this the hard way? – Scott Marcus Sep 03 '21 at 20:17
  • Fair question. I want to be amle to scroll down the list and click on what I want to print, select pages from file to print, and print without leaving the page I was on. It may seem petty but it is how i want it and how the others in my family wish for it to be. – Penguin Sep 03 '21 at 21:08
  • You can do that with dynamically generated links that open the PDF in question in a separate window so that the original window never goes away. – Scott Marcus Sep 03 '21 at 23:49
  • Can you give an example?? – Penguin Sep 04 '21 at 15:31

0 Answers0