Summary
A common requirement is to send a generated PDF straight to a printer from STARLIMS, without opening a viewer or prompting the user. This article collects the approaches raised by the engineering team, along with their constraints, and identifies the option that was confirmed to work on XFD.
Requirement
Print a PDF file directly to the default (or a named) printer from within STARLIMS. Before recommending an approach, two things need to be established: the TP version in use, and whether the functionality is needed in XFD or HTML. The behaviour and available options differ between the two clients.
Option 1: Built-in lims.PrintPdfFile (recommended for XFD)
On XFD there is a built-in function available:
lims.PrintPdfFile(filename, printerName, copies)This takes the path to the PDF, the target printer name, and the number of copies. This is the option that was confirmed working by the implementation team on XFD 12.0.1, and it should be the first thing tried on XFD installations.
Option 2: Enterprise_Utilities.PDFUtils server script
The standard Enterprise_Utilities.PDFUtils server script includes a print entry point:
Execfunction("Enterprise_Utilities.PDFUtils.Print",{sFilePath,sPrinterName});Note that this executes on the server, not the client. That introduces its own considerations: the printer must be visible and mapped from the server, and the service account running the process needs rights to it. Plan for that before choosing this route.
Recommendation
- On XFD, use lims.PrintPdfFile() first. It is built in and confirmed working.
- If server-side printing is acceptable and the printer is reachable from the server, use Enterprise_Utilities.PDFUtils.Print.
Comments
0 comments
Article is closed for comments.