When it comes to printing PDF files programmatically, three powerful solutions stand out: VeryPDF PDFPrint Command Line, VeryPDF PDFPrint SDK, and Adobe Acrobat Wrapper. These tools provide flexible and efficient ways to automate the printing of PDF documents from the command line, using APIs, and integrating with Adobe Acrobat. This article explores each of these methods in detail.
1. Printing PDF Files from the Command Line
PDF Command Line Tool
The VeryPDF PDFPrint Command Line is a robust tool that allows users to print PDF files directly from the command line. It supports a wide range of printers, including physical and virtual printers. With this tool, users can customize print settings such as page orientation, paper size, scaling, resolution, and duplex printing.
https://www.verypdf.com/app/pdf-print-cmd/index.html
Supported File Formats
VeryPDF PDFPrint Command Line is not limited to just PDFs. It also supports various document and image formats, including:
- PDF Document Format (.pdf)
- OpenOffice Documents (.odt, .ott, .odg, .odp, .ods)
- MS Word Documents (.doc, .docx, .rtf, .txt, .xml)
- MS PowerPoint Documents (.ppt, .pptx, .pps, .ppsx)
- MS Excel Documents (.xls, .xlsx, .xlsm)
- HTML Documents (.htm, .html, .mht, .mhtml)
- Vector Drawing Formats (.wmf, .emf)
- Image Formats (.bmp, .jpg, .jpeg, .tif, .tiff, .gif, .png, .pcx, .tga, .jp2, .j2k, .jpc, .jpx, .pbm, .pgm, .ppm, .pnm)
- XML Paper Specification File Format (.xps)
Key Features of VeryPDF PDFPrint Command Line
- Specify Page Range: Print selected pages (-firstpage, -lastpage)
- Printer Selection: Choose the target printer (-printer)
- Page Scaling: Adjust document scaling (-scalex, -scaley)
- Print Quality: Set resolution (-xres, -yres)
- Orientation Control: Customize document orientation (-pdforient, -orient)
- Duplex Printing: Enable double-sided printing (-duplex)
- Watermarking: Add text-based watermarks (-wtext, -wtype, -wo)
- Collation Support: Manage collation for multiple copies (-collate)
- Silent Mode: Suppress user interaction (-silent)
- Logging & Debugging: Output detailed logs (-debug, -logtofile)
Example Commands
pdfprint.exe -printer "HP LaserJet" C:\example.pdf
pdfprint.exe -printer "HP LaserJet" -firstpage 1 -lastpage 5 C:\example.pdf
pdfprint.exe -printer "HP LaserJet" -duplex 2 C:\example.pdf
pdfprint.exe -printer "HP LaserJet" -wtext "Confidential" -wo 50 C:\example.pdf
More PDFPrint Command Line Examples:
pdfprint.exe -printer "PDFcamp Printer" -copies 3 -paper 9 C:\input.pdf
pdfprint.exe -printer "PDFcamp Printer" -paper "pdf" C:\input.pdf
pdfprint.exe -printer "PDFcamp Printer" -paper "11x17in" C:\input.pdf
pdfprint.exe -printer "PDFcamp Printer" -paper "215.9x279.4mm" C:\input.pdf
pdfprint.exe -printer "PDFcamp Printer" -paper "612x792pt" C:\input.pdf
pdfprint.exe -printer "docPrint" -paper "612x792pt" -orient 1 C:\input.pdf
pdfprint.exe -printer "docPrint" -paper "612x792pt" -orient 2 C:\input.pdf
pdfprint.exe -printer "docPrint" -paper "11x14in" -pdforient 3 C:\input.pdf
pdfprint.exe -printer "docPrint" -firstpage 1 -lastpage 1 C:\input.pdf
pdfprint.exe -prompt C:\input.pdf
pdfprint.exe -debug -printer VeryPDF -stoponwrongprinter D:\input.pdf
pdfprint.exe -firstpage -1 -lastpage -1 C:\lastpage.pdf
pdfprint.exe -scalex 50 -scaley 50 C:\input.pdf
pdfprint.exe -scalex 0 -scaley 0 C:\input.pdf
pdfprint.exe -scalex -1 -scaley -1 C:\input.pdf
pdfprint.exe -duplex 3 C:\input.pdf
pdfprint.exe -color 1 C:\input.pdf
pdfprint.exe -xres 600 -yres 600 C:\input.pdf
pdfprint.exe -xres -4 C:\input.pdf
pdfprint.exe -xoffset 200 -yoffset 200 C:\input.pdf
pdfprint.exe -scale 50 C:\input.pdf
pdfprint.exe -shell -shelltime 5000 C:\input.pdf
pdfprint.exe -vector C:\input.pdf
pdfprint.exe -vector -printermargins -nochgprinter C:\input.pdf
pdfprint.exe -raster C:\input.pdf
pdfprint.exe -raster2 -rasterbitcount 1 C:\input.pdf
pdfprint.exe -raster2 -rasterbwtext -rasterbitcount 1 -xres 600 -yres 600 C:\input.pdf
pdfprint.exe -raster2 -raster2center -printermargins C:\input.pdf
pdfprint.exe -shell C:\input.pdf
pdfprint.exe -shell2 C:\input.pdf
pdfprint.exe -preproc C:\input.pdf
pdfprint.exe -printermargins C:\input.pdf
pdfprint.exe -nochgprinter -printer "docPrint" C:\input.pdf
pdfprint.exe -mergeprintjobs -copies 3 C:\input.pdf
pdfprint.exe -mergeprintjobs C:\*.pdf
pdfprint.exe -mergeprintjobs C:\test*.pdf
pdfprint.exe -mergeprintjobs C:\files.txt
pdfprint.exe C:\files.txt
pdfprint.exe -printtofile C:\out.pcl -printer "HP PCL Printer" C:\input.pdf
pdfprint.exe -listprinter
pdfprint.exe -listjobs -printer "docPrint"
pdfprint.exe -listall
pdfprint.exe -listbins -printer "docPrint"
pdfprint.exe -listpapers -printer "docPrint"
pdfprint.exe -chgbin 15 -printer "docPrint" C:\input.pdf
pdfprint.exe -papersource "auto" -printer "docPrint" C:\input.pdf
pdfprint.exe -papersource "Tray 1" -printer "docPrint" C:\input.pdf
pdfprint.exe -papersource "Manual Feed" -printer "docPrint" C:\input.pdf
pdfprint.exe -papersource "Media Tray" -printer "docPrint" C:\input.pdf
pdfprint.exe -papersource "Tray 3" -settraytopclfile C:\test.pcl
pdfprint.exe -getpagecount C:\input.pdf
pdfprint.exe -jobusername TestUser C:\input.pdf
pdfprint.exe -savedevmode C:\file.dat -printer "VeryPDF PCL Writer"
pdfprint.exe -loaddevmode C:\file.dat -printer "VeryPDF PCL Writer" C:\input.pdf
pdfprint.exe -jobdocname "test.doc" -jobusername "MyName" C:\input.pdf
pdfprint.exe -useownerservice -jobdocname "test.doc" -jobusername "MyName" C:\input.pdf
pdfprint.exe -winfont -winfont2 C:\input.pdf
pdfprint.exe -charset 130 C:\input.pdf
pdfprint.exe -useembedfont C:\input.pdf
pdfprint.exe -debug -shell2 -shelltime 1000 -nochgprinter C:\input.pdf
pdfprint.exe -debug -logtofile D:\debug.log C:\input.pdf
pdfprint.exe http://online.verypdf.com/examples/pdfeditor.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -drawinrect "0x0x1.25x3.90in" D:\test.pdf
pdfprint.exe -debug -vector -nochangeprintersettings -drawinrect "0x0x1.25x3.90in" D:\test.pdf
pdfprint.exe -debug -vectorplus -nochangeprintersettings -drawinrect "0x0x1.25x3.90in" D:\test.pdf
pdfprint.exe -debug -vectorgray -nochangeprintersettings -drawinrect "0x0x1.25x3.90in" D:\test.pdf
pdfprint.exe -debug -nochangeprintersettings -drawinrect "0x0x1.25x3.90in" D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -drawinrect "0x0x612x792pt" D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -drawinrect "0x0x4960x7015px" D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -drawinrect "0x0x8.5x11in" D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -drawinrect "0x0x215.9x279.4in" D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -printermargins -raster2width 0 -raster2height 0 D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -printermargins -raster2width -1 -raster2height -1 D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -printermargins -raster2width -2 -raster2height -2 D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -printermargins -raster2width -3 -raster2height -3 D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -printermargins -raster2center D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -printermargins -xoffset 500 -yoffset 500 -raster2width 1000 -raster2height 1000 D:\test.pdf
pdfprint.exe -debug -raster2 -nochangeprintersettings -drawinrect "500x500x2000x2000px" D:\test.pdf
Watermark options during printing:
pdfprint.exe -wtext "Watermark" C:\input.pdf
pdfprint.exe -wtext "Watermark" -wtype 1 C:\input.pdf
pdfprint.exe -wtext "Watermark" -wf "Arial" C:\input.pdf
pdfprint.exe -wtext "Watermark" -wh 200 C:\input.pdf
pdfprint.exe -wtext "Watermark" -wb -wi -wu -ws C:\input.pdf
pdfprint.exe -wtext "Watermark" -wo 80 C:\input.pdf
pdfprint.exe -wtext "Watermark" -wo 80 -wa 75 C:\input.pdf
pdfprint.exe -wtext "Watermark" -wc "FF0000" C:\input.pdf
pdfprint.exe -wtext "Watermark" -wc "00FF00" C:\input.pdf
pdfprint.exe -wtext "Watermark" -wc "0000FF" C:\input.pdf
pdfprint.exe -wtext "Watermark" -wx 100 -wy 100 C:\input.pdf
pdfprint.exe -wtext "Watermark" -wfirstpage 10 -wlastpage 20 C:\input.pdf
pdfprint.exe -wtext "Watermark" -wfirstpage -1 -wlastpage -1 C:\input.pdf
pdfprint.exe -wtext "Watermark" -wfirstpage -2 -wlastpage -2 C:\input.pdf
Print WMF and EMF files with vector information:
pdfprint.exe C:\input.wmf
pdfprint.exe C:\input.emf
Print Raster Image formats:
pdfprint.exe C:\input.bmp
pdfprint.exe C:\input.jpg
pdfprint.exe C:\input.tif
pdfprint.exe C:\input.gif
pdfprint.exe C:\input.png
pdfprint.exe C:\input.pcx
pdfprint.exe C:\input.tga
pdfprint.exe C:\input.jp2
pdfprint.exe C:\input.j2k
pdfprint.exe C:\input.pnm
Print multipage TIFF file format:
pdfprint.exe C:\multipage.tif
Print MS Office, TXT, HTML files:
pdfprint.exe C:\test.odt
pdfprint.exe C:\test.ott
pdfprint.exe C:\test.doc
pdfprint.exe C:\test.docx
pdfprint.exe C:\test.ppt
pdfprint.exe C:\test.pptx
pdfprint.exe C:\test.pps
pdfprint.exe C:\test.ppsx
pdfprint.exe C:\test.xls
pdfprint.exe C:\test.xlsx
pdfprint.exe C:\test.rtf
pdfprint.exe C:\test.txt
pdfprint.exe C:\test.html
pdfprint.exe C:\test.mhtml
pdfprint.exe C:\test.xml
Print XPS file format:
pdfprint.exe D:\VeryPDF.xps
pdfprint.exe -printtofile D:\downloads\out.spl D:\VeryPDF.xps
pdfprint.exe -printer "VeryPDF Postscript Writer" -printtofile D:\downloads\out.ps D:\VeryPDF.xps
pdfprint.exe -printer "Adobe PDF" -printtofile D:\downloads\out.pdf D:\VeryPDF.xps
pdfprint.exe -printer "VeryPDF PCL Writer" -printtofile D:\downloads\out.pcl D:\VeryPDF.xps
pdfprint.exe -printer "Microsoft XPS Document Writer" -printtofile D:\downloads\out.xps D:\VeryPDF.xps
pdfprint.exe -printer "docPrint" -printtofile D:\downloads\out.emf D:\VeryPDF.xps
Print XPS file to PDF file:
pdfprint.exe -printer "PDFcamp Printer" -printtofile D:\downloads\out.pdf D:\VeryPDF.xps
Print PDF file to XPS file:
pdfprint.exe -printer "Microsoft XPS Document Writer" -printtofile D:\downloads\out.xps D:\VeryPDF.pdf
2. VeryPDF PDFPrint SDK
The VeryPDF PDFPrint SDK provides a set of APIs that developers can integrate into their applications for automated PDF printing. It is ideal for software solutions that need to embed printing functionality without requiring a command-line interface.
https://www.verypdf.com/app/pdf-print-cmd/pdfprint-sdk-manual.html
Key Benefits of PDFPrint SDK
- API Integration: Seamlessly integrates into C++, C#, Java, and other programming environments.
- Advanced Print Customization: Offers options to adjust paper size, resolution, and orientation.
- Batch Printing Support: Allows multiple PDF files to be printed simultaneously.
- Support for Virtual & Physical Printers: Works with both local and network printers.
Use Cases
- Enterprise document management systems
- Automated invoice printing
- Batch printing applications
A C# example to print the PDF file,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using pdfprintcom;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
pdfprintcom.pdfprint pdfPrintObj = new pdfprintcom.pdfprint();
pdfPrintObj.com_PDFPrint("pdfprint -printer \"docPrint\" D:\\temp\\5.pdf");
}
}
}
3. Adobe Acrobat Wrapper
For users who rely on Adobe Acrobat, the Adobe Acrobat Wrapper provides an alternative approach to printing PDFs using Adobe’s built-in printing capabilities. This method wraps around Adobe’s API to enable programmatic printing.
Advantages of Adobe Acrobat Wrapper
- Utilizes Adobe’s high-quality rendering engine.
- Ensures accurate printing of complex PDF layouts.
- Supports advanced PDF features like annotations and embedded multimedia.
Example VB Script for Printing with Adobe Acrobat
Set objAcroApp = CreateObject("AcroExch.App")
Set objAcroDoc = CreateObject("AcroExch.PDDoc")
objAcroDoc.Open "C:\example.pdf"
objAcroDoc.PrintPages 0, objAcroDoc.GetNumPages()-1, 2, 1, 1
objAcroDoc.Close False
objAcroApp.Exit
Conclusion
When choosing a PDF printing solution, the right tool depends on your specific needs:
- VeryPDF PDFPrint Command Line is ideal for batch printing, scripting, and automation.
- VeryPDF PDFPrint SDK provides a programmatic approach with seamless API integration.
- Adobe Acrobat Wrapper leverages Adobe’s engine for high-fidelity printing.
Each of these tools offers robust features that can streamline your PDF printing workflow efficiently.