Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open print preview dialog programmatically?

I am creating an invoice tool within Google Sheets. The way it works is that after all the data is entered, a script is running, creating a sheet with the actual layed-out invoice.

I know that there is a way to automatically export sheets as PDF (by calling the document url with the "export?exportFormat=pdf" argument). But I don't want to export directly, I just need the "Print" dialog (File->Print) to pop up automatically so the user can adjust the settings before printing. (I know, it's not a big deal to press cmd+P yourself, but having the dialog open automatically would streamline the whole process a bit).

Is there any way to do that? I haven't found anything helpful within the documentation.

like image 530
Markus Avatar asked Apr 30 '26 11:04

Markus


1 Answers

There isn't a way to do that with Google Apps Script services but you might do that by using client side code.

Related

  • JavaScript print preview
like image 73
Rubén Avatar answered May 02 '26 22:05

Rubén



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!