Hi guys whoever using bullzip,
If my SourcePathAndFilename is a word file (.doc / .docx), it goes well done.
If it is a image file (.jpg), it says:
Does anybody have idea how can image file be handled? TQ
CREATE(pdfSettings,FALSE,TRUE); CREATE(pdfUtil,FALSE,TRUE); // The status file is used to check for errors and determine when the PDF is ready. statusFileName := BaseFolder + '\status.ini'; // Set file name for output file. pdfFileName := OutputPathAndFilename; // Delete old output file if it already exist. IF EXISTS(pdfFileName) THEN ERASE(pdfFileName); // Multiple PDF printers could be installed. Let the automation know which one to control. pdfSettings.printerName := pdfUtil.DefaultPrinterName; // Set output file name pdfSettings.SetValue('Output', pdfFileName); // Make sure no dialogs are shown during conversion. pdfSettings.SetValue('ShowSaveAs', 'never'); pdfSettings.SetValue('ShowSettings', 'never'); pdfSettings.SetValue('ShowPDF', 'no'); pdfSettings.SetValue('ShowProgress', 'no'); pdfSettings.SetValue('ShowProgressFinished', 'no'); pdfSettings.SetValue('ConfirmOverwrite', 'no'); // Set file name of status file to wait for. pdfSettings.SetValue('StatusFile', statusFileName); // Do not show errors in PDF user interface. pdfSettings.SetValue('SuppressErrors', 'yes'); // Write settings to printer. // This writes a file name runonce.ini. It is a configuration that is used // for the next print job. The printer will delete the runonce.ini after it is read. pdfSettings.WriteSettings(TRUE); IF EXISTS(statusFileName) THEN ERASE(statusFileName); // Print out the physical file via bullzip printer pdfUtil.PrintFile(SourcePathAndFilename,pdfSettings.printerName); IF pdfUtil.WaitForFile(statusFileName, 20000) THEN BEGIN // Check status file for errors. IF pdfUtil.ReadIniString(statusFileName, 'Status', 'Errors', '') <> '0' THEN BEGIN ERROR('Error creating PDF. ' + pdfUtil.ReadIniString(statusFileName, 'Status', 'MessageText', '')); END; END ELSE BEGIN // The timeout elapsed. Something is wrong. ERROR('Error creating ' + pdfFileName) END; CLEAR(pdfSettings); CLEAR(pdfUtil);
If my SourcePathAndFilename is a word file (.doc / .docx), it goes well done.
If it is a image file (.jpg), it says:
Does anybody have idea how can image file be handled? TQ