ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PDFium property to detect text base PDF

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jrpcguru Posted - Feb 20 2022 : 14:40:53
After your updates last year, we now have a property to identify PDFs that are fill in the blank forms. I wonder if we can get a property to identify PDFs that are text based? I would like to enable/disable right click menu options for selecting text and searching text depending on the status of the PDF.

The help file recommends:
// Allow user to select images or text and copy to clipboard (automatically detecting selection based on what is under the cursor)
ImageEnView1.MouseInteractGeneral := [ miPdfSelectText, miPdfSelectRgn ];
ImageEnView1.PdfViewer.Enabled := True;

But that appears to be tricky for getting the mouse cursor at just the right place to select the desired text, or it selects as an image instead. Separating these options into two menu options and disabling the text options when appropriate would make the program easier to use and understand.

Presently, the best I can do is use CanCopyToClipboard to warn the user and then disable text options.

J.R.
2   L A T E S T    R E P L I E S    (Newest First)
jrpcguru Posted - Mar 24 2022 : 14:33:08
I forgot to subscribe to this topic so I missed your reply for awhile. I'm pleased to report that your suggestion for detecting a text based PDF worked well and my right click menus are now customized appropriately. Thanks!

J.R.
xequte Posted - Feb 20 2022 : 15:43:58
Hi JR

Probably the easiest way is just to test whether the page contains text:

// Enable the "Export Text" button if page contains text
btnSaveText.Enabled := Length( ImageEnView1.PdfViewer.GetText( 0, 100 )) > 10;


Nigel
Xequte Software
www.imageen.com