From: Peter G. <pet...@gm...> - 2009-05-01 11:02:00
|
Hello, I'm maintaining an MFC application, and I'd like to be able to export some simple GDI generated documents to PDF. I see that wxPdfDocument has the capability of reading a Windows metafile (which essentially consists of a series of GDI function calls and their parameters): http://wxcode.sourceforge.net/docs/wxpdfdoc/classwx_pdf_document.html : See "bool wxPdfDocument::Image" It ought to be possible for me to serialise my document as a windows Metafile using some MFC facility, perhaps to a temp directory, and subsequently open that file using bool wxPdfDocument::Image. Is this practical, sensible and possible? How tightly coupled is wxPdfDocument to WxWidgets? The only other way that I can find of doing this entails purchasing an extremely overpriced licence for a commercial library. Regards, Peter Geoghegan |
From: Ulrich T. <ulr...@gm...> - 2009-05-01 15:37:06
|
Hi Peter, > I'm maintaining an MFC application, and I'd like to be able to export > some simple GDI generated documents to PDF. I see that wxPdfDocument > has the capability of reading a Windows metafile (which essentially > consists of a series of GDI function calls and their parameters): wxPdfDocument's support of WMF files is limited. Not all GDI commands are supported. Especially font support is lacking. > It ought to be possible for me to serialise my document as a windows > Metafile using some MFC facility, perhaps to a temp directory, and > subsequently open that file using bool wxPdfDocument::Image. > > Is this practical, sensible and possible? How tightly coupled is > wxPdfDocument to WxWidgets? wxPdfDocument makes intensive use of the wxWidgets core library (for handling file streams, GIF images, stream compression and so on), so you can't use it without the wxWidgets library itself. Of course you could create a stand-alone command line utility which could perform the WMF to PDF conversion task and call this utility via system call (CreateProcess) from your own application. > The only other way that I can find of doing this entails purchasing > an extremely overpriced licence for a commercial library. There exist low cost solutions for WMF to PDF conversion. You might even consider to use an open source solution like ImageMagick. Regards, Ulrich |
From: Peter G. <pet...@gm...> - 2009-05-01 16:15:27
|
Ulrich, Thanks for your help, and thanks for getting back to me. > wxPdfDocument's support of WMF files is limited. Not all GDI commands > are supported. Especially font support is lacking. I saw that, but thought it was unlikely to matter - I'm just using TextOut and DrawLine. We're talking about very simple documents. >> The only other way that I can find of doing this entails purchasing >> an extremely overpriced licence for a commercial library. > > There exist low cost solutions for WMF to PDF conversion. You might even > consider to use an open source solution like ImageMagick. I couldn't find any that I'd consider low cost - perhaps we have different definitions of low cost. I would consider perhaps €200 or €300 an acceptable amount to pay. I can find plenty of utilities (as oppose to libraries) that do it though. I could find this, but it seems fairly crappy: http://www.soft-album.com/Development/Components-Libraries/Image-to-PDF-Dynamic-Link-Library-6428-Review.html . I'd like to have source code, and they are suspiciously reticent about whether or not they provide it. ImageMagick looks good, but I'm not sure I want to use such a monolithic library - I already use FreeImage+. So, looks like I'll be using some commercial library (there is something about these commercial library sites that puts me off.....they have the look of snake oil salesmen). Regards, Peter Geoghegan |
From: Ulrich T. <ulr...@gm...> - 2009-05-01 21:44:31
|
Peter, >> wxPdfDocument's support of WMF files is limited. Not all GDI commands >> are supported. Especially font support is lacking. > > I saw that, but thought it was unlikely to matter - I'm just using > TextOut and DrawLine. We're talking about very simple documents. Unfortunately TextOut is one of the GDI commands currently *not* supported by wxPdfDocument. Better WMF support is on my to-do list, but with relatively low priority. >> There exist low cost solutions for WMF to PDF conversion. You might even >> consider to use an open source solution like ImageMagick. > > I couldn't find any that I'd consider low cost - perhaps we have > different definitions of low cost. I would consider perhaps €200 or > €300 an acceptable amount to pay. I can find plenty of utilities (as > oppose to libraries) that do it though. We have about the same definition of low cost, but you are right I had utilities in mind. > I could find this, but it seems fairly crappy: > http://www.soft-album.com/Development/Components-Libraries/Image-to-PDF-Dynamic-Link-Library-6428-Review.html > . I'd like to have source code, and they are suspiciously reticent > about whether or not they provide it. As I understand it they only provide the DLL. No source code. > ImageMagick looks good, but I'm not sure I want to use such a > monolithic library - I already use FreeImage+. > > So, looks like I'll be using some commercial library (there is > something about these commercial library sites that puts me > off.....they have the look of snake oil salesmen). Well, that's one of the reasons I started to develop wxPdfDocument. ;-) Regards, Ulrich |