PdfiumLib icon indicating copy to clipboard operation
PdfiumLib copied to clipboard

Feature request: continuous page scroll

Open chukkan opened this issue 4 years ago • 6 comments

Many thanks indeed for such a great useful product. May I suggest a feature? How to Implement/achieve a continuous scrolling of pages using mouse and keyboard as in acrocat as well as other pdf readers? A screen shot has added below:

image

Once again many thanks

chukkan avatar Sep 14 '20 15:09 chukkan

For this to work, I think a design change is necessary. Currently, for every page (TPdfControl), a new PDFDocument (TPdfDocument) is created. For your suggestion (which I tried to implement, too) to work, for each pdf document 1 TPdfDocument must be created, which then must be connected to 1 TPdfControl per page. All connected TPdfControls can then be displayed on 1 TScrollBox. I think this should not be tried without cooperation of the original author. If you do not want to wait for that, have a look at www.winsoft.sk.

Ayuus avatar Nov 09 '20 08:11 Ayuus

I want this feature, too

yhgroup avatar Mar 19 '21 09:03 yhgroup

I couldn't push into this repo You can rewrite this code in PdfiumCtrl.pas:

function TPdfControl.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; var PagePt: TPdfPoint; begin Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos);

if not Result then begin if IsPageValid and AllowFormEvents then begin PagePt := DeviceToPage(MousePos.X, MousePos.Y); if CurrentPage.FormEventMouseWheel(Shift, WheelDelta, PagePt.X, PagePt.Y) then Exit; end;

if ssCtrl in Shift then
begin
  if ScaleMode = smZoom then
  begin
    ZoomPercentage := ZoomPercentage + (WheelDelta div WHEEL_DELTA) * 5;
    Result := True;
  end;
end
else
begin
  if ssShift in Shift then
    Result := ScrollContent(-WheelDelta, 0, SmoothScroll)
  else
    Result := ScrollContent(0, -WheelDelta, SmoothScroll);

  if not Result then
  begin
    if WheelDelta < 0 then
      Self.GotoNextPage()
    else
      Self.GotoPrevPage();
  end;
  Result := True;
end;

end; end;

VasyutkinVeniamin avatar Jun 25 '21 12:06 VasyutkinVeniamin

Try this https://github.com/TextEditorPro/TPDFiumControl

TextEditorPro avatar Aug 16 '21 06:08 TextEditorPro

@TextEditorPro Are you interested in integrating your control into this repository?

landrix avatar May 12 '23 06:05 landrix

I don't mind, the code is completely free to use for any purpose. However, this repo already has its own code for the control.

TextEditorPro avatar May 12 '23 08:05 TextEditorPro