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 ShowAllPages versus FindDialog

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 17 2022 : 17:03:53
When ShowAllPages is true, the FindDialog uses the PdfViewerDefaults.SelectionColor and as you click Next, the previously found text loses its highlight and returns to normal display.

If ShowAllPages = false, the FindDialog successfully searches and finds the desired text. But when you click Next, the previously found text turns opaque black or sometimes even shows some graphical artifact. In any case the previously found text is unreadable.

Is there a property that I haven't found that controls the color of the newly unselected text?

This is consistent if I use code to turn on ShowAllPages or use the icon in the PDFViewer autotoolbar.

I just noticed that the graphical artifacts that show up when I highlight some text is an image of the toolbar! This was obvious when I just tried to select some text and copy it to the clipboard.

Extra note: today I've been trying to find a crucial difference between the demo, which works correctly, and my program. No luck so far. But I've noticed that just a slight change in zoom fixes the artifacts left behind by clicking Next and text becomes readable again. Clicking Next again causes the same problem.

One possible difference is that my program shifts back and forth between PDFium and regular ImageEnView, as needed, but the demo is purely PDFium.

Additional note: I now find that a similar thing happens when selecting text but not images via:
ImageEnView1.MouseInteractGeneral := [ miPdfSelectText, miPdfSelectRgn]
The selection of text is a combination of graphical artifacts and black, and after copying to the clipboard via PdfViewer.CopyToClipboard()the selection is properly hi-lited. The actual clipboard copy works correctly.

It gets even crazier if I use the buttons on the toolbar. Selecting text works the same, but when I click the button to copy to the clipboard, the selection remains black. Until I change focus to another program.

J.R.
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Feb 20 2022 : 15:45:16
Hi JR

I'd like to fix the issue on my end, so if you can narrow down the source of the issue it would be a great help.

Nigel
Xequte Software
www.imageen.com
jrpcguru Posted - Feb 20 2022 : 14:28:30
Your suggestion about painting has proven correct.


procedure TForm1.FindNextintextPDF1Click(Sender: TObject);
begin
if not ImageEnView1.PdfViewer.FindNext( false ) then         
    MessageDlg( 'The text could not be found', mtInformation, [ mbOK ], 0 )
else
  ImageEnView1.PdfViewer.Refresh;

end;

By refreshing the PDFViewer after each FindNext, the display is correct. This will require my own TFind since I can't refresh the display when searching using the toolbar.

Similarly, if I want to select text in a PDF the image is messed up with graphic artifacts from the document above the cursor location, but putting this code in the ImageEnView1.OnMouseUp works to fix things:

if (ImageEnView1.PdfViewer.Enabled) and ( ImageEnView1.PdfViewer.PageCount > 0 ) then
    begin
      if SelectPDFtext.Checked = true then
        ImageEnView1.PdfViewer.Refresh ;
    end;


Clearly I'm going to have to convert the demo to view both .JPG and .PDF using my code and see if I can pin down what is causing this!

J.R.
xequte Posted - Feb 18 2022 : 22:10:49
Hi JR

As you said, I cannot reproduce the issue in our demos. Clearly there is an issue erasing the previous selection rect, either the repaint is not occurring or the position is not valid. Unfortunately there is nothing in the code that looks amiss. Are you able to simplify your demo to something that we can debug?



Nigel
Xequte Software
www.imageen.com