Hello Everyone,
Does anyone have a FWH example that creates a PDF with an image blob located in MS SQL and image as a file? I am looking to recreate the attached PDF.
https://s-c-technology.com/temp/SBMA05070.pdf
Thank you in advance for your help.
#include "FiveWin.ch"
#include "print.ch"
FUNCTION Main()
local oPrn, i, oFont1, oFont2, nRow,;
aLines := {"ESTA ES LA LINEA 1","ESTA ES LA LINEA 2","ESTA ES LA LINEA 3","ESTA ES LA LINEA 4",;
"ESTA ES LA LINEA 5","ESTA ES LA LINEA 6","ESTA ES LA LINEA 7","ESTA ES LA LINEA 8"}
DEFINE FONT oFont1 NAME "ARIAL" SIZE 60,80 BOLD
DEFINE FONT oFont2 NAME "CALIBRI" SIZE 24,36
PRINT oPrn NAME "Prueba" PREVIEW
oPrn:SetPortrait()
oPrn:SetPage(9)
PAGE
@ 1.6,.6 PRINT TO oPrn IMAGE "..\BITMAPS\Fw.bmp" SIZE 3, 1 CM
@ 5 , 1 PRINT TO oPrn TEXT "TITULO DEL DOCUMENTO" SIZE 18,1 CM FONT oFont1 ALIGN "C"
@ 6 , 1 PRINT TO oPrn TEXT "SUBTITULO DEL DOCUMENTO" SIZE 18,1 CM FONT oFont1 ALIGN "C" OUTLINE nRgb(170,150,12) SIZE .01
nRow := 7
FOR i := 1 TO LEN(aLines)
@ nRow,1 PRINT TO oPrn TEXT aLines[i] SIZE 10,1 CM FONT oFont2 LASTROW nRow
NEXT i
@ 13, 2 PRINT TO oPrn BAR CHART { { 14280, 20420, 12870, 25347, 7640 },;
{ 8350, 10315, 15870, 5347, 12340 },;
{ 12345, -8945, 10560, 15600, 17610 } } ;
SIZE 8,3 TITLE "Titulo De Grafico" CM
@ 13, 10.2 PRINT TO oPrn LINE CHART { { 14280, 20420, 12870, 25347, 7640 },;
{ 8350, 10315, 15870, 5347, 12340 },;
{ 12345, -8945, 10560, 15600, 17610 } } ;
SIZE 8,3 TITLE "Titulo De Grafico" CM
@ 18, 2 PRINT TO oPrn IMAGE "..\BITMAPS\OLGA1.jpg" SIZE 6, 9 CM
@ 18 ,16 PRINT TO oPrn TEXT "https://www.google.com" AS BARCODE SIZE 3, 1 CM
ENDPAGE
ENDPRINT
RETURN NIL
#include "fivewin.ch"
REQUEST FWHARU // Optional
function Main()
local oCn, oRs
local oPrn
TPrinter():lUseHaruPDF := .t. // optional
oCn := FW_MSSQLDB()
oRs := FW_OpenRecordSet( oCn, "wwonders" )
PRINT oPrn PREVIEW FILE "msimage.pdf"
PAGE
@ 1,1 PRINT TO oPrn IMAGE oRs:Fields( "Image" ):Value SIZE 4,4 INCHES
ENDPAGE
ENDPRINT
oRs:Close()
oCn:Close()
return nil
@ 1,1 PRINT TO oPrn IMAGE "c:\fwh\bitmaps\olga1.jpg" SIZE 3,4 INCHES
oPrn:Line( nTop, nLeft, nBottom, nRight, oPen, cUnits )
// cUnits can be "INCHES", "CM", "MM". If omitted, pixels
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: jmartial and 42 guests