I need a scheduled mechanism that generates a PDF of records from a view and prints it

David Lundy
Tera Contributor

We have a requirement for a project where the manager wants a set of records printed out every week.  These records are work orders that generated every Monday morning at 12:00am.  Ideally, he would like the list of records waiting on the printer when they arrive in the morning.

I have a view and form layout designed and was planning to use GwtPollDialog with the unload_pdf+ option, but I honestly don't understand the function enough to code with it.  

Is there a better way to go about doing this other than a scheduled scripted job that collects the records and uses GwtPollDialog to generate the PDF?  To be clear, I need the actual records printed out and not just a list view.  I need each record printed on its own page as these work orders will be distributed to technicians in the field.

TIA for any assistance.

1 ACCEPTED SOLUTION

_ChrisHelming
Tera Guru

Your biggest challenge is going to be automating the printing portion. Ideally, the printer isn't going to have a public IP address so you'll need to go through your MID server at the very least, or have a dedicated "box" like a Raspberry Pi to proxy the print job to the printer (an API running on the Pi that accepts PDFs?).

If it were me, I'd probably look at doing something like an automated report that goes out via email and looking for some sort of automation tool that can print the attachment. But again, you're going to need either a machine that's on the same network as the printer, or some sort of printing service like PaperCut to actually get the job to the printer.

Perhaps a script running on the Pi that checks an email account, downloads the attachment, prints the attachment, then deletes the file and email?

View solution in original post

2 REPLIES 2

_ChrisHelming
Tera Guru

Your biggest challenge is going to be automating the printing portion. Ideally, the printer isn't going to have a public IP address so you'll need to go through your MID server at the very least, or have a dedicated "box" like a Raspberry Pi to proxy the print job to the printer (an API running on the Pi that accepts PDFs?).

If it were me, I'd probably look at doing something like an automated report that goes out via email and looking for some sort of automation tool that can print the attachment. But again, you're going to need either a machine that's on the same network as the printer, or some sort of printing service like PaperCut to actually get the job to the printer.

Perhaps a script running on the Pi that checks an email account, downloads the attachment, prints the attachment, then deletes the file and email?

Yeah, we're wrestling with that concept too.  At this point, I'm just looking to get the PDF generated.  If they can't handle loading a PDF and printing, then there's a whole different set of issues we need to address.

It's getting the PDF made that's confounding me at the moment.  I'll worry about printing later.  🙂