Developing your own code to extract text from PDF files isn't trivial. I would suggest you looked to create a wrapper for an existing library.
You can find developer information at www.pdfzone.com
The example above extractPDFText.aspx assumes one kind of filter/encoding. ASCII85 encoding is also potentially used. PDF files are not required to store data in page order which means this code extracts text sequentially in the file, but it may be out of logical page order. If the file has been linearized or incrementally updated, then you may also find "legacy" objects that aren't even used by the file anymore.
PDF is a bear of a format to work with when it comes to dealing with pre-existing files. There are more libraries to generate PDFs because it's easier.
You can find developer information at www.pdfzone.com
The example above extractPDFText.aspx assumes one kind of filter/encoding. ASCII85 encoding is also potentially used. PDF files are not required to store data in page order which means this code extracts text sequentially in the file, but it may be out of logical page order. If the file has been linearized or incrementally updated, then you may also find "legacy" objects that aren't even used by the file anymore.
PDF is a bear of a format to work with when it comes to dealing with pre-existing files. There are more libraries to generate PDFs because it's easier.