Print Page | Close Window

Problem with text extraction

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2788
Printed Date: 08 Feb 26 at 2:59AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Problem with text extraction
Posted By: rstojnic
Subject: Problem with text extraction
Date Posted: 23 Nov 13 at 8:56PM
Hi all,

I am trying to extract text from this PDF (on Mac):

http://research.microsoft.com/pubs/145347/bodypartrecognition.pdf

These are the results of my current efforts:

[pdfText appendString:[DQPL ExtractFilePageText:pdfFilePath :@"" :nPage+1 :0]];

-> crashes with unmapped memory exception deep in the Debenu code. Options 7 and 8 work, but return the text only partially, roughly half of the text is missing. 

[pdfText appendString:[DQPL ExtractFilePageText:pdfFilePath :@"" :nPage+1 :5]];

Returns only half of the text on the page. The last line of CSV file is only partially written to the string which makes me think it silently crashes, although the code apparently runs fine and outputs to the file. The same is true for options 3,4 and 6. 

Using the following code:

        int textblockID = [DQPL ExtractFilePageTextBlocks:pdfPath :@"" :1 :3];

        int count = [DQPL GetTextBlockCount:textblockID];        

        for(int i=0;i<count;i++){

            NSString *line = [DQPL GetTextBlockText:textblockID :i+1];

            NSLog(@"Page 1 block %d = %@", i+1, line);

        }

I can extracts only every alternate text block on the page, but manages to get to the end of the page. Therefore, again half is missing, but a different half than before! 

Any pointers on what I might be doing wrong would be greatly appreciated! The PDF renders fine, which makes me thing that the problem is the text extraction code.

On a related note: is it possible to get glyph information _before_ it is put into blocks. E.g. the CSV file on the individual glyph basis, without any processing? I think that would be very useful. 

Cheers, R.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk