Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 12th, 2007, 05:46 AM
Registered User
Join Date: Sep 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default read pdf files in C#

Hi all,
Please reply asap.
The control goes into infinite loop when i try reading pdf file in my C# file.
I have to return a string as it is my requirement.
can anyone suggest what to do?

FileStream ReadPdf = new FileStream(@"D:\abc.pdf", FileMode.Open);
            long FileSize;
            FileSize = ReadPdf.Length;
            UTF8Encoding temp = new UTF8Encoding(true);
            Int16 i;
            string returnstring = null;

            byte[] Buffer = new byte[(Int64)FileSize];
            ReadPdf.Read(Buffer, 0, (int)ReadPdf.Length);
            for (i = 0; i <= Buffer.Length - 1; i++)
                returnstring = temp.GetString(Buffer);
            return returnstring;

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Handler to read and load a PDF file Mehdi6002 ASP.NET 2.0 Professional 0 May 8th, 2007 04:39 PM
creating read-only files Fat_and_immoral Excel VBA 4 December 20th, 2006 09:24 AM
how to read files in evc++ iriskab Visual C++ 1 September 1st, 2006 04:19 AM
Writing Files that can't be read Ron_Bingham BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 April 23rd, 2005 02:25 PM
How to create a Read-Only PDF in C#.NET? jjjooooohhnnn General .NET 1 September 15th, 2004 08:52 AM

All times are GMT -4. The time now is 07:51 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.