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.