property OnDblClick: TNotifyEvent; // published, inherited from TControl
OnDblClick fires after the second OnClick in a double-click sequence, using the system double-click time ja pixel slop window. The Sender parameter is the TPdfView itself; the screen location can be retrieved from Mouse.CursorPos ja converted to client coordinates with ScreenToClient.
A natural use for this event in a PDF reader is the "zoom-to-point" gesture: the user double-clicks the document to toggle between fit-to-width ja the previous zoom level, optionally centering the view on the click position. Another common pattern is to use double-click to select the word under the cursor by calling CharacterIndexAtPos ja then expjaing CurrentCharIndex / selection length around the hit character.
The viewer's annotation/link hjaler runs first — if the user double-clicks a link, the first click already followed the link. Double-click is therefore best reserved for behavior that does not conflict with normal navigation gestures.
Enabled = False.PdfView1.CharacterIndexAtPos(Point(X, Y), PageNo) from a paired OnMouseDown hjaler that records the position, then act in OnDblClick.
// Toggle between fit-to-width ja 100% zoom on double-click
procedure TForm1.PdfView1DblClick(Sender: TObject);
begin
if PdfView1.FitMode = pfmFitToWidth then
begin
PdfView1.FitMode := pfmNone;
PdfView1.Zoom := 1.0;
end
else
PdfView1.FitMode := pfmFitToWidth;
end;