i am using visual studio. i want to make an application in MFC which will take text from editbox and generate a pdf file with that text written on it. Is it possible to create pdf file in MFC. if Yes how i can do that? thanx :)
-
possible duplicate of [To generate a PDF page from an MFC MDI CView](http://stackoverflow.com/questions/1815602/to-generate-a-pdf-page-from-an-mfc-mdi-cview) – Leo Chapiro Mar 05 '14 at 11:25
-
i want that it should generate pdf file without any help of external application. in that link they are asking to download "CutePDF". is there any way to generate pdf without any help of external application, if possible? – Himanshu Mar 05 '14 at 11:31
-
No, IMHO it is not possible. – Leo Chapiro Mar 05 '14 at 11:32
-
So what should i do, sir? i am trying from last 2 days but got nothing . plz help. – Himanshu Mar 05 '14 at 11:35
-
Unfortunately you will need to use a third-pard software (CutePDF for example) to create a PDF file. – Leo Chapiro Mar 05 '14 at 11:37
-
thanx, but i am not much experienced in MFC so i dont know know how to work with third-party software. – Himanshu Mar 05 '14 at 11:41
3 Answers
Per answers to this question, you have a few good options:
-
Haru is a free, cross platform, open-sourced software library for generating PDF written in ANSI-C. It can work as both a static-library (.a, .lib) and a shared-library (.so, .dll).
-
PoDoFo is a library to work with the PDF file format. The name comes from the first letter of PDF (Portable Document Format). A few tools to work with PDF files are already included in the PoDoFo package.
The PoDoFo library is a free, portable C++ library which includes classes to parse PDF files and modify their contents into memory. The changes can be written back to disk easily. The parser can also be used to extract information from a PDF file (for example the parser could be used in a PDF viewer). Besides parsing PoDoFo includes also very simple classes to create your own PDF files. All classes are documented so it is easy to start writing your own application using PoDoFo.
PoDoFo is written in C++ and the code was sucessfully compiled under Unix, Mac OS X and Windows.
Also if you are willing to pay money for the library, here is another option:

- 1
- 1

- 17,853
- 3
- 55
- 72
Is it possible to create pdf file in MFC?
No, IMHO it is not possible. Unfortunately you will need to use a third-pard software (CutePDF for example) to create a PDF file.
Take a look at this example as well (using PDF Creator Pilot): http://www.colorpilot.com/pdfsamples/vc.pdf

- 13,678
- 8
- 61
- 92
-
Actually i had already seen that as it is using third-party software and it is for console application. ok, as we can not do it without third-party software so i will check it again. – Himanshu Mar 05 '14 at 11:53
I used zdll.lib library file and it worked good in my MFC application.
Thanks all for their reply and solutions.

- 4,327
- 16
- 31
- 39
-
Hi Himanshu. Did you export your CView contents with zdll.lib ? Can you give me more details ? – Flaviu_ Feb 26 '18 at 09:25