Options

bullzip, print image file into pdf

cwhmycwhmy Member Posts: 24
Hi guys whoever using bullzip,
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:
qtkpebknztx3.jpg

Does anybody have idea how can image file be handled? TQ

Answers

  • Options
    archer89archer89 Member Posts: 337
    What is the Image format?
    When you Double Click the image, wich application is started?
    You could embed the Image in a HTML document. The Try to print that.
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • Options
    cwhmycwhmy Member Posts: 24
    Thx archer89.

    A jpg file, when it's double clicked, it's opened in Windows app "Photos".
    HTML document? How would you suggest the system coding flow? (the image file is stored in BLOB field of Nav)
  • Options
    archer89archer89 Member Posts: 337
    it can be that bullzip needs an appropriate application for a specific file format for a successful rendering/converting to pdf.
    html: first check, if bullzip can render/convert html pages. the associated program is your current internet browser.
    if that works fine, you can create a simple text/html file in nav, where the image is linked. for that read the image from the blob field, save the image to a temp folder. after creating and saving the html file, print that out.
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • Options
    cwhmycwhmy Member Posts: 24
    edited 2016-08-24
    Hi archer89, well, again, html, you were referring to html saved page, right?
    No, bullzip is having exactly the same error as what I uploaded the error msg picture in above for image processing.

    I thought you had some experience with bullzip.
  • Options
    mdPartnerNLmdPartnerNL Member Posts: 802
    don't think such a statement is helpful. Why don't you explain it again in baby steps?
  • Options
    cwhmycwhmy Member Posts: 24
    Anybody any close to solid clue/idea? TQ
  • Options
    cwhmycwhmy Member Posts: 24
    up
  • Options
    cwhmycwhmy Member Posts: 24
    up
Sign In or Register to comment.