Question:
Hi, with your command line printing, can I use it with Foxpro (I guess I could use a shell.execute and run the DOS command), and does it sort the documents how I want them to before printing? Thanks.
https://www.verypdf.com/app/pdf-print-cmd/try-and-buy.html
Answer:
Yes, you can use the PDFPrint SDK to integrate PDF printing with FoxPro. The SDK allows you to print PDFs directly via the command line, and it includes a FoxPro example folder to make integration easier. You can use the shell.execute
function in FoxPro to run DOS commands and leverage PDFPrint SDK for printing.
Here’s how you can do it:
-
First, download the PDFPrint SDK from this link.
-
The SDK package contains a folder specifically for FoxPro. You can refer to the examples in that folder.
-
To use the SDK with FoxPro, write a command like this to call the PDFPrint SDK:
strCmd = 'pdfprint -prompt ' + m.File_String nRet = VeryPDF_PDFPrint(strCmd) _cliptext = strCmd MESSAGEBOX("Return Code: " + ALLTRIM(STR(nRet)), 48, _screen.Caption)
This script executes the pdfprint command with the -prompt
option to show the print dialog. The m.File_String
variable should contain the file path of the PDF you wish to print.
Regarding sorting the documents before printing, you can customize the order by organizing the file paths in your FoxPro script. PDFPrint SDK doesn't automatically reorder files for printing, so you would need to ensure that your files are listed in the order you want them printed in the script itself. You can build a list or array of file names in the correct order and loop through it to print each document one by one.
Key Background Information:
-
PDFPrint SDK: A software development kit (SDK) by VeryPDF designed to allow command-line printing of PDF documents. It offers features like direct printing, setting print options, and managing multiple print tasks. It’s particularly useful for automating PDF printing without needing to open the document manually.
-
FoxPro: A data-centric, procedural, and object-oriented language from Microsoft, often used for database management and application development. While it is not commonly used in modern development, many legacy systems still rely on FoxPro for their operations. FoxPro can run external commands via the
shell.execute
function, making it compatible with many command-line tools, such as PDFPrint SDK. -
Command-line printing: This refers to printing documents using a command-line interface rather than relying on GUI-based applications. It’s especially useful for automating printing tasks and integrating printing functionality into custom software or systems.
By integrating PDFPrint SDK with FoxPro, you can automate the printing of PDFs, control the print order, and improve efficiency in your workflow.