Page 1 of 3

HMG_HPDF with pdf417?

Posted: Thu Aug 08, 2013 2:13 am
by paulomhouse
Hi

How can i make a report with HMG_HPDF with pdf417 codebar?

I donĀ“t know how to use HMG_CreateBarCode, is it possible with ?

Thank you

Re: HMG_HPDF with pdf417?

Posted: Thu Aug 08, 2013 3:02 am
by Rathinagiri
Definitely it is possible.

First create a barcode image file by giving the cImageFileName parameter to the HMG_CreateBarCode function. I will make a small sample soon.

Re: HMG_HPDF with pdf417?

Posted: Fri Aug 09, 2013 12:46 am
by paulomhouse
Could you show me a piece of this information?

Create a image -> HMG_CreateBarCode and insert it

Thank you

Re: HMG_HPDF with pdf417?

Posted: Fri Aug 09, 2013 4:24 am
by Rathinagiri
Hi,

Please try this!

Code: Select all

#include <hmg.ch>
#include "hfcl.ch"

Function Main
   define window barcode at 0, 0 width 400 height 100 title "Barcode PDF Sample" main
      define label l1
         row 10
         col 10
         width 100
         value 'Enter Barcode'
      end label
      define textbox t1
         row 10
         col 110
         width 100
      end textbox
      define button b1
         row 10
         col 220
         caption 'Create PDF'
         action createpdf()
      end button
   end window
   barcode.center
   barcode.activate
Return

function createpdf
   local cImage := 'barcode.png'
   local nReturn := 0
   local lSuccess := .f.
   nReturn := HMG_CreateBarCode( barcode.t1.value,;
                             "PDF417",;
                             2,;
                             100,;
                             .f.,;
                             cImage )
   if nReturn == 0
      msgstop( 'Barcode Creation error!' )
      return nil
   endif
   if file( 'barcode.png' )
      SELECT HPDFDOC 'HMG_barcode.pdf' TO lSuccess papersize HPDF_PAPER_A4
      if lSuccess
         START HPDFDOC
            START HPDFPAGE
               @ 10,  10 HPDFPRINT IMAGE "barcode.png" WIDTH 172 HEIGHT 78
            END HPDFPAGE   
         END HPDFDOC
      endif
   endif
   return nil
                   

Re: HMG_HPDF with pdf417?

Posted: Fri Aug 09, 2013 4:47 am
by bpd2000
Thank you for working sample
Image can be generated other than PNG format and is valid say .jpg

Re: HMG_HPDF with pdf417?

Posted: Fri Aug 09, 2013 7:09 am
by esgici
Thanks Rathi :D

Best regards

Re: HMG_HPDF with pdf417?

Posted: Fri Aug 09, 2013 7:22 am
by Rathinagiri
It is hard coded to be PNG file format. But it can be any extension like jpg, bmp or whatever.

Just change the line appropriately at line no. 59 of \hfcl\source\hmg_zebra.prg

And, don't forget to re-create the library.

Re: HMG_HPDF with pdf417?

Posted: Fri Aug 09, 2013 7:56 am
by bpd2000
Ok, Thank you

Re: HMG_HPDF with pdf417?

Posted: Mon Aug 12, 2013 1:15 am
by paulomhouse
Thanks a lot Rathinagiri

It is exacty I was waiting.

Now, I need to define papersize like HPDF_PAPER_USER, How can I do it? 4,00inX2,00in.

Best regards.

Re: HMG_HPDF with pdf417?

Posted: Mon Aug 12, 2013 5:00 am
by Rathinagiri
You can use the following sample for having user defined paper size. The sizes are in millimeters.

SELECT HPDFDOC "sample.pdf" PAPERLENGTH 300 PAPERWIDTH 300