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:
#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
