Hi,
I am trying to figure out how to extract the 1st page from a pdf file using C. Once I have extracted it, I am going to save it into a new file. Can someone help me figure out how to do this?
Thanks.
Saad
Hi,
I am trying to figure out how to extract the 1st page from a pdf file using C. Once I have extracted it, I am going to save it into a new file. Can someone help me figure out how to do this?
Thanks.
Saad
Well. Have you looked at a PDF file in plain text? You could, I suppose, look for the page marks. You won't be able to just grab that data and have a valid PDF though, I don't think.
As tabstop indicates, it's not entirely trivial to read PDF. PDF is a binary and structured format, and it is compressed. Both of these mean that you need to write code to understand teh binary format, the structure and before you get there, you'd have to decompress the actual content into its uncompressed form.
If you want to succeed in that [and not spend a lot of time], you probably want to use a PDF library of some sort. I have no idea which of the ones listed here on wikipedia are good and which aren't, and which would do the task you want to solve - I expect even with a library, it's not an ENTIRELY trivial task.
Of course, PDF reader itself can save parts of a PDF document.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
http://www.gnu.org/software/ghostscr...ostscript.html
Has source code, and can deal with PDF files.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.