Fivewin creates beautiful .EMF files within the report object.
Does anyone know of a utility or library I can call from within my applications to convert these .EMF files to a .PDF file?
EnricoMaria wrote:Yes. Using PDFCreator you can make the process completely automatic.
EMG
Silvio wrote:http://www.herdsoft.com/ftp/downloads.html#davinci
here you can load the dll
// file: emf2pdf.cpp
//
// Converts an EMF file to a 1 page PDF file.
//
// To build, make sure the files pdfGDI.dll, pdfGDI.lib, pdfGDI.h
// are in the current directory, then from the command line:
//
// cl emf2pdf.cpp pdfGDI.lib gdi32.lib
#include <windows.h>
#include <stdio.h>
#include "pdfGDI.h"
void main(int argc, char *argv[])
{
HDC dc;
if (argc < 3)
{
printf("usage: emf2pdf filename.emf filename.pdf\n");
return;
}
HPDFGDI h = pdfGDI_open(argv[2]);
if (!h)
{
char msg[ ERROR_MSG_SIZE ];
pdfGDI_getErrorMsg(h, msg);
printf("pdfGDI_open failed: %s\n", msg);
return ;
}
dc = pdfGDI_startPage(h, "A4");
if (!dc)
{
char msg[ ERROR_MSG_SIZE ];
pdfGDI_getErrorMsg(h, msg);
printf("pdfGDI_startPage failed: %s\n", msg);
return ;
}
// now play the EMF file to our PDF dc
HENHMETAFILE metaFileHandle = GetEnhMetaFile(argv[1]);
if (metaFileHandle == 0)
{
printf("could not open metafile [%s]", argv[1]);
return ;
}
RECT rect = {0, 0, 1000, 1000};
if (!PlayEnhMetaFile(dc, metaFileHandle, &rect))
{
printf("PlayEnhMetaFile failed\n");
}
DeleteEnhMetaFile(metaFileHandle);
pdfGDI_close(h);
}
Richard Chidiak wrote:Enrico
PDF creator will install a virtual printer just like Adobe distiller.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 65 guests