PdfiumLib
PdfiumLib copied to clipboard
Feature request: continuous page scroll
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:
Once again many thanks
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.
I want this feature, too
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;
Try this https://github.com/TextEditorPro/TPDFiumControl
@TextEditorPro Are you interested in integrating your control into this repository?
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.