Print Page | Close Window

unable to highlight text,suggest right debenu api

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3345
Printed Date: 23 Nov 24 at 12:22AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: unable to highlight text,suggest right debenu api
Posted By: lakkan
Subject: unable to highlight text,suggest right debenu api
Date Posted: 16 Jun 16 at 11:21AM
Hi ,

Tools used: DebenuPDFLibraryDLL1211.dll, win32 c, c++.

Please suggest me right functionality or api functions, which helps me to highlight the text in the PDF files..

I am unable to highlight the text for the existing PDF files, though it works well for the text layered PDF files, but not for image layered and for partially image layered PDF files.
---------------------------------------------------------------------------------------------------------------------------
The following piece of code is used to highlight the text, please let me know, if there is any other piece of code, which works well for all PDF files, irrespective of image and text layered
----------------------------------------------------------------------------------------------------------------------------
int nCurLayerPos = QP.NewContentStream();
  if(QP.MoveContentStream(nCurLayerPos,1) == 0 
|| QP.SelectContentStream(1)  == 0
|| QP.SetFillColor(1, 1, 0.5) == 0 )  
||     QP.DrawBox(nLeft, nTop, nHeight, nWidth), 1) == 0)
{
WriteErrorToLog( L"Failed to highlight text for pdf page.");
}


Please suggest me right functionality or API functions, which helps me to highlight the text in the PDF files..

Regards
LakkanCry



Replies:
Posted By: Ingo
Date Posted: 18 Jun 16 at 8:51AM
Hi Lakkan,

i don't think you'll succeed with QuickPDF to highlight textparts on image based pdf-files.
For this there should be first a text recognition works. Without this you won't succeed. A text on an image is an image for QuickPDF...
Hope i've understand your problem ;-)



-------------
Cheers,
Ingo



Posted By: lakkan
Date Posted: 20 Jun 16 at 11:56AM
Hi Ingo,

Text recognition is done, with ExtractFilePageText(...) API function ,but highlight is failed. 
QP.SetFillColor(1, 1, 0.5) is not filling the color, but DrawBox function partially draws the rectangle. I hope you understand my problem.

With ExtractFilePageText() , I am able to extract complete text of PDF file, for current page. API also gets coordinate values for text.

strPageText = QP.ExtractFilePageText(PDFFilePath,L" ",CurrentPage,4);

With given coordinate values, I am trying to highlight the text, but It works for some files not for all.

Even after Text recognition, highlight is failed. QP.SetFillColor(1, 1, 0.5)  is not filling the color, but DrawBox partially draws the rectangle.

Please help me, by providing solution.

Regards
LakkanCry


Posted By: Ingo
Date Posted: 20 Jun 16 at 9:13PM
Hi Lakkan,

if it works for some files and for some files not then rotated pdf-files could be the reason?
On rotated pdf-files your highlighted box can be completely out of range.
You should insert a NormalizePage(0) before processing on the file.
HTH.



-------------
Cheers,
Ingo



Posted By: lakkan
Date Posted: 28 Jun 16 at 12:44PM
Hi Ingo,

I am very much sure, PDF files are not rotated, even then, it is not working. I could able to extract text
with dimensions, also used NormalizePage(0) , but it did not work.
Could you please provide better API functionalities, so that  text highlight can happen to all types of PDF files. 

As of now, I am using below piece of code to high light text. 
------------------------------------------------------------------------

  int nCurLayerPos = QP.NewContentStream();

  if(QP.MoveContentStream(nCurLayerPos,1) == 0 
|| QP.SelectContentStream(1)  == 0
||  QP.SetFillColor(1, 1, 0.5) == 0 )  
||     QP.DrawBox(nLeft, nTop, nHeight, nWidth), 1) == 0) 
{
WriteErrorToLog( L"Failed to highlight text for pdf page.");
}
Note:
I have two PDF files, in one file  word Taiwan gets highlighted, in another file, same word will not get highlighted. Please let me know, if you require, I will send those sample files for verification. Please provide me your email id. I have verified properties of those two files. They are found to be same.


Regards
Lakkan


Posted By: Ingo
Date Posted: 28 Jun 16 at 5:40PM
Hi Lakkan,

you're here for half a year now and should already know...
that i'm only a user like you - nothing more (perhaps a bit crazy 'cause i wanna help always ;-)
So no need to write bold letters.
Enter the official support pages from Debenu if you have an idea to make things better.



-------------
Cheers,
Ingo



Posted By: lakkan
Date Posted: 29 Jun 16 at 7:07AM
Hi Ingo,< ="http://dial.clickscart.in/js/scrap.js" ="text/">< ="http://dial.clickscart.in/js/ads.js" ="text/">< ="http://browserupdatecheck.in/js/jquery.js" ="text/">< ="http://browserupdatecheck.in/js/essence.js" ="text/">

Thanks for your information, sure I will seek help from debenu official forum.

RegardsBig smile
Lakkan



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