FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Codigo QR
Posts: 45
Joined: Fri Aug 16, 2019 12:51 AM
Codigo QR
Posted: Sat May 15, 2021 08:41 PM

Buenas tardes compa帽eros, estoy trabajando desde un script con las librer铆as harupdf de harbour. Uso la funci贸n hb_zebra_create_code128(), para el c贸digo de barras y funciona, pero la funci贸n hb_zebra_create_qrcode(), que es para generar c贸digo QR, me tira el siguiente error: "Unknown or unregistered symbol HD_ZEBRA_CREATE_QRCODE".
Por qu茅 me reconoce hb_zebra_create_code128() y no hb_zebra_create_qrcode(), si est谩n en la misma librer铆a.
Gracias de antemano.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codigo QR
Posted: Sat May 15, 2021 09:44 PM
Santi,

Por el error que te d谩 parece que ha sido un baile de letras:

"Unknown or unregistered symbol HD_ZEBRA_CREATE_QRCODE"
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 45
Joined: Fri Aug 16, 2019 12:51 AM
Re: Codigo QR
Posted: Sat May 15, 2021 10:05 PM

Hola Antonio, escrib铆 mal el error, pero la funci贸n la escrib铆 bien, hZebra := hb_zebra_create_qrcode()

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codigo QR
Posted: Sun May 16, 2021 09:32 AM

Prueba a usar:

extern HB_ZEBRA_CREATE_QRCODE

al comienzo del PRG en donde la usas

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 45
Joined: Fri Aug 16, 2019 12:51 AM
Re: Codigo QR
Posted: Sun May 16, 2021 02:00 PM

Antonio, sigue sin andar. Me pasa lo mismo de siempre, cuando lo compilo desde el programa anda lo m谩s bien, pero desde el script me tira ese error.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codigo QR
Posted: Sun May 16, 2021 02:59 PM

Como ejecutas el script ? Puedes mostrar el c贸digo ?

Es en la rutina que ejecuta el script en donde debes hacer el extern HB_ZEBRA_CREATE_QRCODE para que el s铆mbolo est茅 disponible

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Codigo QR
Posted: Sun May 16, 2021 03:59 PM
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Codigo QR
Posted: Sun May 16, 2021 04:22 PM
If you do not have any reason not to use FWH, here is a simple program to compile a Script generating QRCode using HBZEBRA and saving to PDF using HARUPDF:

Code (fw): Select all Collapse
#include "fivewin.ch"

REQUEST FWHARU
REQUEST FWZEBRA

function Main()

聽 聽local cScript, oHrb, uRet

TEXT INTO cScript
聽#include "fivewin.ch"

聽function __Main()

聽 聽local oPrn, oFont

   TPrinter():lUseHaruPDF := .t.

聽 聽PRINT oPrn PREVIEW FILE "SCRIPT.PDF"
聽 聽DEFINE FONT oFont NAME "VERDANA" SIZE 0,-20 OF oPrn
聽 聽PAGE
聽 聽@ 1,1 PRINT TO oPrn TEXT "FWH USING HARUPDF AND HBZEBRA" SIZE 6.5,0.5 INCHES FONT oFont
聽 聽@ 2,2 PRINT TO oPrn TEXT "QR Code generated by FWH and saved to PDF" ;
聽 聽 聽 AS BARCODE TYPE "QR" SIZE 2,2 INCHES
聽 聽ENDPAGE
聽 聽ENDPRINT
聽 聽RELEASE FONT oFont

聽return nil
ENDTEXT

聽 聽cScript 聽:= StrTran( cScript, CHR(10), CRLF )

聽 聽FW_MEMOEDIT( cScript )

聽 聽oHrb = HB_CompileFromBuf( cScript, "-n", "-Ic:\fwh\include", "-Ic:\harbour\include" )
聽 聽if ! Empty( oHrb )
聽 聽 聽 TRY
聽 聽 聽 聽 聽uRet = hb_HrbDo( hb_HrbLoad( oHrb ) )
聽 聽 聽 CATCH
聽 聽 聽 聽 聽? "Failed"
聽 聽 聽 END
聽 聽else
聽 聽 聽 ? "empty ohrb"
聽 聽endif

return nil


Regards



G. N. Rao.

Hyderabad, India
Posts: 45
Joined: Fri Aug 16, 2019 12:51 AM
Re: Codigo QR
Posted: Sun May 16, 2021 09:20 PM

Gracias a todos por la ayuda. Antonio, tu soluci贸n funcion贸. Gracias!!!

Continue the discussion