Generating/exporting a PDF from my MFC application, for reports that are created by overloading OnDraw in a view
-
Hello, I'd like to be able to directly support exporting various reports from my MFC application. The reports are drawn to a device context using standard GDI techniques, overloading OnDraw in a view. Ideally, there'd be a library that I could just drop in that provides a hDc that I'd draw to in the usual manner. This library would be either available under a copy-centre licence (BSD/MIT/COL) or would be commercially available. Could someone suggest a library/approach? Regards, Sternocera
-
Hello, I'd like to be able to directly support exporting various reports from my MFC application. The reports are drawn to a device context using standard GDI techniques, overloading OnDraw in a view. Ideally, there'd be a library that I could just drop in that provides a hDc that I'd draw to in the usual manner. This library would be either available under a copy-centre licence (BSD/MIT/COL) or would be commercially available. Could someone suggest a library/approach? Regards, Sternocera
Please, let me google that for you [^]. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hello, I'd like to be able to directly support exporting various reports from my MFC application. The reports are drawn to a device context using standard GDI techniques, overloading OnDraw in a view. Ideally, there'd be a library that I could just drop in that provides a hDc that I'd draw to in the usual manner. This library would be either available under a copy-centre licence (BSD/MIT/COL) or would be commercially available. Could someone suggest a library/approach? Regards, Sternocera
-
Rajesh, I took a look at LibHaru, but I found that it cannot draw to a windows GDI device context...thus, I'd have to rewrite my reports from scratch. What I'd really like is a drop-in replacement for my GDI device context. I read somewhere that it is somehow possible to do this using WxWidgets' PDF support. I can't seem to find any more information though, Regards, Sternocera
-
Rajesh, I took a look at LibHaru, but I found that it cannot draw to a windows GDI device context...thus, I'd have to rewrite my reports from scratch. What I'd really like is a drop-in replacement for my GDI device context. I read somewhere that it is somehow possible to do this using WxWidgets' PDF support. I can't seem to find any more information though, Regards, Sternocera
You can always create a bitmap of the stuff that's stored on your device context and then Haru can print it to a PDF. Sounds viable?
It is a crappy thing, but it's life -^ Carlo Pallini
-
You can always create a bitmap of the stuff that's stored on your device context and then Haru can print it to a PDF. Sounds viable?
It is a crappy thing, but it's life -^ Carlo Pallini
Rajesh, Obviously, I'd much rather preserve my reports as vector graphics. At the moment, I'm looking at wxPdfDocument - It's designed to be used from WxWidgets, but it may be possible to use from MFC, Regards, Sternocera
-
Rajesh, Obviously, I'd much rather preserve my reports as vector graphics. At the moment, I'm looking at wxPdfDocument - It's designed to be used from WxWidgets, but it may be possible to use from MFC, Regards, Sternocera
If you succeed in making it work with MFC, it must make a good article for CP. :)
It is a crappy thing, but it's life -^ Carlo Pallini
-
If you succeed in making it work with MFC, it must make a good article for CP. :)
It is a crappy thing, but it's life -^ Carlo Pallini
Rajesh, Yes, indeed. I have a high level idea of how it might be possible. http://wxcode.sourceforge.net/docs/wxpdfdoc/classwx_pdf_document.html[^] Look at the function "bool wxPdfDocument::Image". It ought to be possible to export my GDI data to a WMF file ( see http://en.wikipedia.org/wiki/Windows_Metafile[^] ), perhaps to a temp directory, and open that using wxPdfDocument afterwards. More research is required, Regards, Sternocera