473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

PDF viewer

I am using this code to open pdf it reads pdf file but it reads very odd text in the rich text box please help me to complete this project so that it can rerad the pdf file
Expand|Select|Wrap|Line Numbers
  1. DialogResult drs = openFileDialog1.ShowDialog();
  2.             openFileDialog1.Filter = "Pdf File|*.pdf";
  3.             openFileDialog1.Title = "Open pdf file";
  4.  
  5.             if (drs == DialogResult.OK)
  6.             {
  7.                 string file = openFileDialog1.FileName;
  8.                 byte[] byt = File.ReadAllBytes(file);
  9.                 ((RichTextBox)this.RichTextBoxes[i]).Text = Convert.ToBase64String(byt);
Nov 23 '11 #1
2 1771
Rabbit
12,516 Expert Mod 8TB
What are you expecting to see? PDF files aren't text files, you can't just display the "contents". What you're getting is what you should expect to get by just dumping the contents into a textbox.
Nov 23 '11 #2
Frinavale
9,735 Expert Mod 8TB
What type of application are you developing?
You can't use a OpenFileDialog in an ASP.NET application....

-Frinny
Nov 24 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Kris | last post by:
Hello, By accident I noticed that a hack to hide CSS from IE4.x/Mac also hides it from WebTV Viewer. Since I noticed a little while ago a post here that mentioned the 'incompatibility' of WebTV...
1
by: Rick Brown | last post by:
I'm trying to find a way to output a Access97 report to a file without losing any of the formatting. The Microsoft Snapshot Viewer does this perfectly but the person opening the file needs the...
9
by: bluedolphin | last post by:
Hello All: I have been brought onboard to help on a project that had some performance problems last year. I have taken some steps to address the issues in question, but a huge question mark...
4
by: Salad | last post by:
Hi: I have the following line: DoCmd.SendObject acSendReport, "TestReport", _ "SnapshotFormat (*.snp)", _ "joeblow@nowhere.com", , , "Report Test", _ "Does it open correctly?", True I have...
3
by: Robert Schuldenfrei | last post by:
Dear NG, I have Crystal Reports working to a file and directly to the printer with the following: private void mnuInvRep1301_Click(object sender, System.EventArgs e) {
5
by: Robert Schuldenfrei | last post by:
Hi Again, Forgive me for posting this again, but old items seem to get little review. I thought I could adjust the viewer properties without any further aid from the NG, but I was wrong. When...
1
by: Tressa | last post by:
I have a Csharp windows service that currently uses socketing to communicate to additional PC's to shutdown or restart. I need to also have this service open up the Event Viewer and search for...
0
by: Jerry J | last post by:
I have a third party image viewer that can display various types of images. The image viewer is ActiveX and lives inside of Internet Explorer. To get the image viewer to retrieve an image, java...
5
by: Dean Slindee | last post by:
I have looked everywhere I can think of for the .exe name of the Windows Picture and Fax Viewer. Anybody know what it's named? Thanks, Dean Slindee
1
by: monskie | last post by:
Hello to all, I have a problem which could be trivial to you guys. This concerns opening several crystal reports on the a crystal viewer on an ASPX page by calling window.open. My...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.