HMG_HPDF with pdf417?

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

paulomhouse
Posts: 30
Joined: Fri Aug 02, 2013 11:47 am

HMG_HPDF with pdf417?

Post 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

User avatar
Rathinagiri
Posts: 5321
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 198 times
Been thanked: 210 times
Contact:

Post 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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

paulomhouse
Posts: 30
Joined: Fri Aug 02, 2013 11:47 am

Post by paulomhouse »

Could you show me a piece of this information?

Create a image -> HMG_CreateBarCode and insert it

Thank you

User avatar
Rathinagiri
Posts: 5321
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 198 times
Been thanked: 210 times
Contact:

Post 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
                   
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
bpd2000
Posts: 1172
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 257 times
Been thanked: 153 times

Post by bpd2000 »

Thank you for working sample
Image can be generated other than PNG format and is valid say .jpg
BPD
Convert Dream into Reality through HMG

User avatar
esgici
Posts: 4537
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 409 times
Been thanked: 118 times
Contact:

Post by esgici »

Thanks Rathi :D

Best regards
Viva INTERNATIONAL HMG :D

User avatar
Rathinagiri
Posts: 5321
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 198 times
Been thanked: 210 times
Contact:

Post 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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
bpd2000
Posts: 1172
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 257 times
Been thanked: 153 times

Post by bpd2000 »

Ok, Thank you
BPD
Convert Dream into Reality through HMG

paulomhouse
Posts: 30
Joined: Fri Aug 02, 2013 11:47 am

Post 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.

User avatar
Rathinagiri
Posts: 5321
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 198 times
Been thanked: 210 times
Contact:

Post 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
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

Post Reply