Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2007, 05:46 AM
Registered User
 
Join Date: Sep 2007
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;






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





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