CIB JCoMod technical documentation (EN)

5. Quick start

5.4. JCoMod Wrapper example for CIB pdf toolbox: Job for direct printing of a pdf document

import com.cib.comod.jobs.*;
public class DirectPrintPdf {
	public static void main(String[] args) {
		JCibPdfJoinJob t_PDFJob = new JCibPdfJoinJob();
		t_PDFJob.initialize();
		if (!t_PDFJob.isInitialized()) {
			System.out.println("Fehler beim Initialisieren der Dll");
			return;
		}
		//PDF-Datei festlegen z.B. ein Test.pdf
		t_PDFJob.setProperty(ICibPdfJoinJob.PROPERTY_INPUTFILE, "Test.pdf");
		//Druckernamen festlegen z.B. HP LaserJet 4100 Series PS
		t_PDFJob.setProperty("PrinterName", "HP LaserJet 4100 Series PS" );
		//Ausgabeformat festlegen
		t_PDFJob.setProperty(ICibPdfJoinJob.PROPERTY_OUTPUTFORMAT, "FormatPrinter");
		//Prozess starten
		t_PDFJob.execute();
		int t_ReturnValue =((Integer)t_PDFJob.getProperty(ICibFormatJob.PROPERTY_ERROR)).intValue();
		if (t_ReturnValue != 0) {
			System.out.println("Fehler! CIB pdf toolbox returns " + t_ReturnValue);
		}
		t_PDFJob.dispose();
	}
}