FoxPro Programming
printing
Gravatar is a globally recognized avatar based on your email address. printing
  Nechama
  All
  May 2, 2017 @ 08:59am

To print a pdf file, I put

Response.DownloadFile(lcPdfFile,"application/pdf","roster.pdf")

First it downloads and then I can print after opening the pdf.

How can I put in that it should print to the default downloading and without any user interaction?

Also, is there a way to getprinter() at the beginning of the procedure and then subsequently have it print to that for the duration that the procedure runs without user interaction.

Thanks in advance.

Gravatar is a globally recognized avatar based on your email address. re: printing
  Tore Bleken
  Nechama
  May 2, 2017 @ 09:53am

Except for downloading a file, it's nothing you can do with it on the client side, for security reasons.

Gravatar is a globally recognized avatar based on your email address. re: printing
  Rick Strahl
  Nechama
  May 3, 2017 @ 09:36am

As Tore points out - you can't.

It is possible to automate a Print operation from code (using document.ExecCommand) but this works only with the active document and then still requires the user to confirm and actually press the print button.

As Tore points out it's a security issue - you can't automate a process like this otherwise a nefarious site could just start randomly activating your printer and printing reams of paper. So yeah - all these types of operations - print, save and open file, all require that the user explicit select the options.

+++ Rick ---

© 1996-2024