emf to pdf

emf to pdf

Postby don lowenstein » Wed Feb 01, 2006 7:12 pm

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?
Don Lowenstein
www.laapc.com
User avatar
don lowenstein
 
Posts: 197
Joined: Mon Oct 17, 2005 9:09 pm

Re: emf to pdf

Postby Enrico Maria Giordano » Wed Feb 01, 2006 7:17 pm

Yes. Using PDFCreator you can make the process completely automatic.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: emf to pdf

Postby Richard Chidiak » Wed Feb 01, 2006 9:20 pm

EnricoMaria wrote:Yes. Using PDFCreator you can make the process completely automatic.

EMG


Enrico

PDF creator will install avirtual printer just like Adobe distiller.
Is there a way to have a lib linked within an app (avoid installing the printer) that can allow converting from Emf to Pdf. If anyone has done the job and is willing to share,

If we can Enhance the FW preview to support Pdf creation and email (this part is easy), then it will be great. I would be personnally get rid of Easypreview that is not compatible with fwh anymore since over a year now.

Richard
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Silvio » Wed Feb 01, 2006 9:24 pm

It would be fine to have as a fw function ......as EMF2PDF()....

Regards
silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Wed Feb 01, 2006 9:26 pm

I know there is a DLL ( davinci) it can converte from emf to pdf ...but i not Know how I can make it
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Wed Feb 01, 2006 9:34 pm

User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Wed Feb 01, 2006 9:52 pm

Now I found a C source (emf2pdf.cpp)
there is someone Know how make a fw function...?
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Richard Chidiak » Wed Feb 01, 2006 10:12 pm

Silvio wrote:http://www.herdsoft.com/ftp/downloads.html#davinci

here you can load the dll


Silvio,

Davinci is copyright protected, we can not include it in our apps just like this.

I want to check the pdf.lib from xharbour

Richard
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Silvio » Wed Feb 01, 2006 10:22 pm

I found a file cpp now...
Code: Select all  Expand view
// 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);
}



I have also these files : pdfGDI.dll, pdfGDI.lib, pdfGDI.h but I think not have the source of pdfgdi.lib

Can you create a fw function ?
Regards
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Wed Feb 01, 2006 10:27 pm

pdf of xharbour (contrib) support only jpeg", "tiff", "gif", and "png"... I already test it
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: emf to pdf

Postby Enrico Maria Giordano » Wed Feb 01, 2006 10:50 pm

Richard Chidiak wrote:Enrico

PDF creator will install a virtual printer just like Adobe distiller.


Yes, but you can drive it using an INI file. You can get the PDF file without any user action. And it is free.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 93 guests