Hi,
I'm looking for a way to convert from pdf to jpg and viceversa.
An alternative to pdf creator
many thanks
function pdftest()
******************************************************************
local oStatic1,oBitmap,nPageID,nPages,abuffer := {}
//TQuickPdf():Register(QUICKPDF_KEY) // wird beim Programmstart nur einmal gemacht !!!
cFile := "laststrokes.pdf"
WITH OBJECT ( oPdf := TQuickPdf():New() )
nPageID := .:LoadFromFile(cFile)
nPages := .:PageCount()
for x := 1 to nPages
aadd(aBuffer,substr(.:RenderPagetoString(96,x,0),15))
next x
.:Destroy()
END WITH
@ 0,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX SIZE 100,50 OBJECT oStatic1
oBitmap := xbpBitmap():new():create()
oBitmap:setbuffer(aBuffer[1]) // nur erste Seite für Test
@ .1,.1 DCSTATIC TYPE XBPSTATIC_TYPE_BITMAP SIZE 100,50 CAPTION oBitmap OBJECT oBitmap1 PARENT oStatic1
dcread gui fit
return nil
MarcoBoschi wrote:Hi,
I'm looking for a way to convert from pdf to jpg and viceversa.
An alternative to pdf creator
many thanks
oPdf := FWPDF():New( cNewPdfFile )
oJpgBuf := MemoRead( <jpegfile> )
oPdf:nPage := 1
oPdf:WritePage( oJpgBuf )
oPdf:Close()
Also, if I try to generate a pdf > 100 pages, it produces an hb_out.log at Harbour.
Application Internal Error - C:\Users\Elvira\Desktop\0956_2013\fivedbu_20130909\fivedbu.exe
Terminated at: 2013.09.17 12:25:20
Unrecoverable error 9006: hb_xgrab can't allocate memory
Called from DIBTOSTR(0)
Called from EMF2JPEG(76) in .\source\function\PRV2PDF.PRG
Called from FWPDF:ADDMETA(141) in .\source\function\PRV2PDF.PRG
Called from (b)FWSAVEPREVIEWTOPDF(38) in .\source\function\PRV2PDF.PRG
Called from AEVAL(0)
Called from FWSAVEPREVIEWTOPDF(38) in .\source\function\PRV2PDF.PRG
Called from (b)TPREVIEW_BUILDBUTTONBAR(342) in .\source\classes\RPREVIEW.PRG
Called from TBTNBMP:CLICK(471) in .\source\classes\BTNBMP.PRG
Called from TBTNBMP:LBUTTONUP(662) in .\source\classes\BTNBMP.PRG
Called from TCONTROL:HANDLEEVENT(1719) in .\source\classes\CONTROL.PRG
Called from TBTNBMP:HANDLEEVENT(1465) in .\source\classes\BTNBMP.PRG
Called from _FWH(3183) in .\source\classes\WINDOW.PRG
Called from SYSREFRESH(0)
Called from STOPUNTIL(60) in .\source\function\MSGRUN.PRG
Called from TPREVIEW:ACTIVATE(143) in .\source\classes\RPREVIEW.PRG
Called from RPREVIEW(1759) in .\source\classes\RPREVIEW.PRG
Called from (b)TREPORT_NEW(170) in .\source\classes\REPORT.PRG
Called from TREPORT:ACTIVATE(850) in .\source\classes\REPORT.PRG
Called from TXBROWSE:REPORT(7132) in .\source\classes\XBROWSE.PRG
Called from (b)OPEN(290) in C:\fwteam\samples\fivedbu.prg
Called from TBTNBMP:CLICK(471) in .\source\classes\BTNBMP.PRG
Called from TBTNBMP:LBUTTONUP(662) in .\source\classes\BTNBMP.PRG
Called from TCONTROL:HANDLEEVENT(1719) in .\source\classes\CONTROL.PRG
Called from TBTNBMP:HANDLEEVENT(1465) in .\source\classes\BTNBMP.PRG
Called from _FWH(3183) in .\source\classes\WINDOW.PRG
Called from WINRUN(0)
Called from TMDIFRAME:ACTIVATE(996) in .\source\classes\WINDOW.PRG
Called from MAIN(57) in C:\fwteam\samples\fivedbu.prg
------------------------------------------------------------------------
HB_FUNC( DIBTOSTR ) // ( hDib ) --> lSuccess
{
long lSize;
char * pDib;
#ifndef _WIN64
pDib = DibToStr( ( HGLOBAL ) hb_parnl( 1 ), &lSize );
#else
pDib = DibToStr( ( HGLOBAL ) hb_parnll( 1 ), &lSize );
#endif
hb_retclen( pDib, lSize );
hb_xfree( ( void * ) pDib ); // Here !!!
}
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 45 guests