I wanted to print pdf which i generate from FPDF in PHP automatically from server's folder.
Is there any way to automatically print PDF from a printer connected to the server from a specified folder?
Or to print the pdf generated in a device accessing that server, from that server's default printer.
Best How To :
We do this, albeit in a slightly hacky way. Here are the steps:
- Generate the PDF with FPDF and save it to a location on disk
Note: our method has us confirm the print dialogue button before it prints. This is possibly something you can set with your printer settings.
If you want to just print without that hassle, there are ways to directly connect to your printer from PHP, but the only one I know of is via a PECL extension, and I think that's Windows only.