-
January 16th, 2014, 05:55 AM
#1
Show all the .pdf contents in to a grid view or any other control ...
Hi all,
I am able to read a .pdf file and show it on a text box.... But my requirement is that i shld be able to show all the content and if any images in to the .pdf file in the o/p.... Please help me out... Which control will support for this work...
I have written the below code...
Here is the link for dll --- http://sourceforge.net/projects/itextsharp/
Code:
Imports System.IO
Imports System.Text
Imports iTextSharp.text.pdf
Imports iTextSharp.text
Imports Read_Write_PDF_Files
Imports iTextSharp
Imports System.Collections.Generic
Imports iTextSharp.text.pdf.parser
Imports iTextSharp.text.xml
' Dim PdfReader As New System.IO.StreamReader("E:\PDF program in vb.net\Read Write PDF Files\sample.pdf")
Dim text As StringBuilder = New StringBuilder()
'Dim pdfReader1 As PdfReader = New PdfReader("E:\PDF program in vb.net\Read Write PDF Files\sample.pdf")
Dim pdfReader1 As PdfReader = New PdfReader(" C:\Users\aseema\Desktop\UGSI - URL Access Request Process.pdf")
Dim page As Integer
For page = 1 To pdfReader1.NumberOfPages Step page + 1
Dim strategy As ITextExtractionStrategy = New SimpleTextExtractionStrategy()
Dim currentText As String = PdfTextExtractor.GetTextFromPage(pdfReader1, page, strategy)
currentText = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(currentText)))
'text.Append(currentText)
TextBox1.Text = currentText
'DataGridView1.Rows.Add(line.Split(","))
' DataGridView1.Rows.Add(New String() {currentText})
' currentText = "djjoiduieropire"
text.Append(currentText)
Next
pdfReader1.Close()
Return
add a .dll -- iTextSharp
If u send me any code or any link that will be of great help....
NOTE: i have to show word by work or line by line what ever i read from the .pdf file in the o/p.... Also u ppl can suggest me which ever control is good for this....
-
January 16th, 2014, 03:14 PM
#2
Re: Show all the .pdf contents in to a grid view or any other control ...
You'd have to buy a license for the format of the PDF file. Unless you know someone at ADOBE
-
January 17th, 2014, 05:32 AM
#3
Re: Show all the .pdf contents in to a grid view or any other control ...
Originally Posted by dglienna
You'd have to buy a license for the format of the PDF file. Unless you know someone at ADOBE
Nope.
You're already using iTextSharp. All you need to do now is use its libraries and functionalities to display the control. You cannot display it otherwise, as the VB / C# controls have no idea of PDF. Even if you were to try a RichTextBox, you would still have to convert the PDF content to RTF.
My advice would be to interrogate all iTextSharp's capabilities.
* I do actually have a lot of experience with iTextSharp, just in case you're wondering Good luck!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|