Hola
Alguien sabe si el EasyPreview permite exportar a pdf ? me he bajado la demo y no me aparece ese opción por ningun sitio.
Frafive wrote:Hola
Alguien sabe si el EasyPreview no permite exportar a pdf ? me he bajado la demo y no me aparece ese opción por ningun sitio.
*-------------------------------------------------------------------------------------------------------------------------------
FUNCTION BuildPDF( aFiles, cPdfFileName )
LOCAL imageFilename := " "
LOCAL ix
LOCAL iErr := 0
LOCAL errorText := " "
LOCAL hLib := LoadLib32( "image2PDF.dll" )
TRY
if ValType( aFiles ) == "A"
iErr := IPMeta( ) // Flag that his is a meta file
iErr := IPSize( ) // Reset the size
FOR ix := 1 TO LEN( aFiles ) // Build the pages using the array of temp files
imageFilename := aFiles[ix]
iErr := IPAddImg(imageFilename)
NEXT
iErr := IPSetDPI(0) // Set DPI to the default for PDF's. It works better.
iErr := IPMakePDF(cPdfFileName, 0, errorText, 40 ) // Create the PDF.
Endif
CATCH
FreeLib32( hLib )
END
RETURN( cPdfFilename )
*-------------------------------------------------------------------------------------------------------------------------------
DLL32 STATIC FUNCTION COPYEMF( hEMF AS LONG, cEMF AS LPSTR ) AS LONG;
PASCAL FROM "CopyEnhMetaFileA" LIB "gdi32.dll"
DLL32 STATIC FUNCTION WMF2EMF( cWMF AS LPSTR ) AS LONG ;
PASCAL FROM "Wmf2Emf" LIB "emf.dll"
DLL32 STATIC FUNCTION DELETEEMF( hEMF AS LONG ) AS BOOL ;
PASCAL FROM "DeleteEMF" LIB "emf.dll"
DLL32 STATIC FUNCTION I2PLic( cLicCode AS LPSTR) AS LONG;
PASCAL FROM "I2PDF_License" LIB "Image2PDF.dll"
DLL32 STATIC FUNCTION IPMeta( ) AS LONG;
PASCAL FROM "I2PDF_MetaToNativePDF" LIB "Image2PDF.dll"
DLL32 STATIC FUNCTION IPSize( ) AS LONG;
PASCAL FROM "I2PDF_UseEMFDeviceSize" LIB "Image2PDF.DLL"
// static unsigned int I2PDF_AddImage(char *image);
DLL32 STATIC FUNCTION IPAddImg( cImage AS LPSTR ) AS LONG;
PASCAL FROM "I2PDF_AddImage" LIB "Image2PDF.dll"
// static unsigned int I2PDF_SetDPI(unsigned int dpi);
DLL32 STATIC FUNCTION IPSetDpi( nDpi AS LONG ) AS LONG;
PASCAL FROM "I2PDF_SetDPI" LIB "Image2PDF.dll"
// static unsigned int I2PDF_MakePDF(char *output, int options, char *errorText, unsigned int maxErrorTextSize);
DLL32 STATIC FUNCTION IPMakePDF( cOutFile AS LPSTR, nOptions AS LONG, cErrTxt AS LPSTR, nMaxESize AS LONG ) AS LONG;
PASCAL FROM "I2PDF_MakePDF" LIB "Image2PDF.dll"
reinaldocrespo wrote:Llamas la funcion de abajo enviando como parametro las pagianas que genera treport (ameta) y como segundo parametro envias el nombre que le quieres dar al pdf.
Observa que no hay nada nuevo ni diferente a lo que hace Tim Stone en el link que te envié y que tienes que adquirir Image2pdf.dll. Ese es el truco. Para adquirir el .dll sigue el link donde Tim Stone explica como y donde adquirirlo. Funciona muy bien.
- Code: Select all Expand view RUN
*-------------------------------------------------------------------------------------------------------------------------------
FUNCTION BuildPDF( aFiles, cPdfFileName )
LOCAL imageFilename := " "
LOCAL ix
LOCAL iErr := 0
LOCAL errorText := " "
LOCAL hLib := LoadLib32( "image2PDF.dll" )
TRY
if ValType( aFiles ) == "A"
iErr := IPMeta( ) // Flag that his is a meta file
iErr := IPSize( ) // Reset the size
FOR ix := 1 TO LEN( aFiles ) // Build the pages using the array of temp files
imageFilename := aFiles[ix]
iErr := IPAddImg(imageFilename)
NEXT
iErr := IPSetDPI(0) // Set DPI to the default for PDF's. It works better.
iErr := IPMakePDF(cPdfFileName, 0, errorText, 40 ) // Create the PDF.
Endif
CATCH
FreeLib32( hLib )
END
RETURN( cPdfFilename )
*-------------------------------------------------------------------------------------------------------------------------------
DLL32 STATIC FUNCTION COPYEMF( hEMF AS LONG, cEMF AS LPSTR ) AS LONG;
PASCAL FROM "CopyEnhMetaFileA" LIB "gdi32.dll"
DLL32 STATIC FUNCTION WMF2EMF( cWMF AS LPSTR ) AS LONG ;
PASCAL FROM "Wmf2Emf" LIB "emf.dll"
DLL32 STATIC FUNCTION DELETEEMF( hEMF AS LONG ) AS BOOL ;
PASCAL FROM "DeleteEMF" LIB "emf.dll"
DLL32 STATIC FUNCTION I2PLic( cLicCode AS LPSTR) AS LONG;
PASCAL FROM "I2PDF_License" LIB "Image2PDF.dll"
DLL32 STATIC FUNCTION IPMeta( ) AS LONG;
PASCAL FROM "I2PDF_MetaToNativePDF" LIB "Image2PDF.dll"
DLL32 STATIC FUNCTION IPSize( ) AS LONG;
PASCAL FROM "I2PDF_UseEMFDeviceSize" LIB "Image2PDF.DLL"
// static unsigned int I2PDF_AddImage(char *image);
DLL32 STATIC FUNCTION IPAddImg( cImage AS LPSTR ) AS LONG;
PASCAL FROM "I2PDF_AddImage" LIB "Image2PDF.dll"
// static unsigned int I2PDF_SetDPI(unsigned int dpi);
DLL32 STATIC FUNCTION IPSetDpi( nDpi AS LONG ) AS LONG;
PASCAL FROM "I2PDF_SetDPI" LIB "Image2PDF.dll"
// static unsigned int I2PDF_MakePDF(char *output, int options, char *errorText, unsigned int maxErrorTextSize);
DLL32 STATIC FUNCTION IPMakePDF( cOutFile AS LPSTR, nOptions AS LONG, cErrTxt AS LPSTR, nMaxESize AS LONG ) AS LONG;
PASCAL FROM "I2PDF_MakePDF" LIB "Image2PDF.dll"
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 110 guests