Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 14th, 2012  |  syntax: None  |  size: 0.42 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Backend generates pdf files (labels, packing slips, etc) - Need to automatic print to pre-selected printers from browser - Workaround?
  2. $file = "c:\path\to\file.pdf";
  3. $exec = '"C:\Program Files\bioPDF\Acrobat Wrapper\acrowrap.exe" /t ';
  4. session_write_close(); // prevents hanging
  5. pclose(popen($exec. $file . " \networked\printer",'r'));
  6.        
  7. $file = "/path/to/file.pdf";
  8. $command = "lpr -P /printer/path " . $file;
  9. exec($command);