Click here to Skip to main content
15,887,822 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
I want to get each word co-ordinates from the text pdf using iTextSharp. in the below mentioned link i have uploaded text pdf.i had no idea on  itextsharp.can anybody have sample code to get word co-ordinates?

https://docs.google.com/file/d/0B_nzYHWVJJ7KQ0dPLWdyS2FBWUk/edit?usp=sharing
Posted
Comments
Dave Kreskowiak 16-Aug-13 10:07am    
You're going to have to be a bit more specific. Are you talking about the coordinates of a word in the document relative to a known point, such as the start of a paragraph, the corner of a page or the corner of the page margins, ..., in the document in the scaling of the document? Are you talking about screen coordinates relative to the upper left corner of the window displaying the document? Are you talking about coordinates relative to the upper left corner of the desktop as the document is displayed? Or...What??
jai_mca 16-Aug-13 23:46pm    
i am talking about each word of paragraph in text pdf.
jai_mca 17-Aug-13 1:49am    
Any other idea?
jai_mca 17-Aug-13 2:17am    
This is the code i have used to extract text from the below attached textpdf.

https://docs.google.com/file/d/0B3ZAyYMW9DEMMUNQVEFYNWRDZjg/edit?usp=sharing

Public Sub GetPDFText(ByVal pdfpath As String)
Dim reader As New PdfReader(pdfpath)
Dim output As New StringWriter()
For i As Integer = 1 To reader.NumberOfPages
output.WriteLine(PdfTextExtractor.GetTextFromPage(reader, i, New SimpleTextExtractionStrategy()))
Next
pdftext.Text = output.ToString
Dim filenam As String = "D:\Temp\itext\test.txt"
Dim testss As New System.IO.StreamWriter(filenam)
testss.Write(pdftext.Text)
testss.Close()
End Sub

i don't know how to get co-ordinates of each word.
can anybody have idea

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900