How can I read PDF line by line?

Q: I am using PdfNet sdk for Java and .Net and I want to read pdf line
by line including blank spaces. How can I implement this using
PDFTron?
-------
A: Assuming that you are referring to text extraction, you could use
TextExtractor (as shown in TextExtract sample project -
http://www.pdftron.com/net/samplecode.html#TextExtract) to extract
text content line by line and word by word. Unless they are explicitly
represented in PDF TextExtractor will not extract blank space
characters, however it will provide precise positioning information
for each character/word/line/block on the page (using GetBBox()
methods). The information could be used to generate blank spaces in
case you need to convert PDF to plain text and approximate the layout
information of the original PDF.