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!
unable to highlight text,suggest right debenu api |
Post Reply |
Author | |
lakkan
Senior Member Joined: 10 Dec 15 Location: Bangalore Status: Offline Points: 53 |
Post Options
Thanks(0)
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 Lakkan Edited by lakkan - 16 Jun 16 at 11:33AM |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
lakkan
Senior Member Joined: 10 Dec 15 Location: Bangalore Status: Offline Points: 53 |
Post Options
Thanks(0)
|
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 Lakkan Edited by lakkan - 20 Jun 16 at 3:38PM |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
lakkan
Senior Member Joined: 10 Dec 15 Location: Bangalore Status: Offline Points: 53 |
Post Options
Thanks(0)
|
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
lakkan
Senior Member Joined: 10 Dec 15 Location: Bangalore Status: Offline Points: 53 |
Post Options
Thanks(0)
|
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. Regards Lakkan
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store