<< Click to Display Table of Contents >> Navigation: Tasks > Page rotation |
It is possible to rotate certain or all pages by increments of 90 degrees or to the angle 0,90,180 and 270.
This can be done with command COMPDF_RotatePage
it expects 2 parameters:
a) a string parameter
- a page number in the range 1...pagecount, i.e. "1"
- a page number list
- "selected" to modify the selected pages
- "all" to modify all pages
b) the rotation angle
either +- 90, +-180 or
1, 2, 3 or 4 * 90
Example:
for i:=1 to 10 do
WPViewPDF1.CommandStrEx(COMPDF_RotatePage, IntToStr(i), 90);
does the same as
WPViewPDF1.CommandStrEx(COMPDF_RotatePage, '1-10', 90);
Hint:
You can rotate the selected pages using
WPViewPDF1.CommandStrEx(COMPDF_RotatePage, 'selected', 90);
To disable/enable this action use the event OnViewerMessage:
procedure TWPViewPDFDemo.DoViewerMessage(
Sender: TObject;
var ID : Integer;
Param: Integer);
begin
case ID of
...
MSGPDF_CHANGESELPAGE:
begin
RotateAction.Enabled := Param>0;
end;
end;
end;