Image Viewer CP Pro SDK ActiveX

Image Viewer CP Pro SDK ActiveX

Platform : Windows 10, Windows 8, Vista, Windows 7, XP

It is a PDF Viewer and Document Viewer SDK , Export to PDF ,Image processing, 1D and 2D Barcode Reader, Writer, DICOM and OCR with C#, C , VB.NET , VB, Delphi, Vfp, MS Access.

Popular Solution Go   Back

Delphi - Rotate a PDF

Step 1: To install the Image Viewer CP Pro ActiveX Control, begin by launching the setup file (imageviewercpprosetup.exe). Select the desired installation folder for the Image Viewer CP Pro ActiveX and continue with the installation on your development computer.

Step 2: Started Delphi, the next step is to install Image Viewer CP Pro ActiveX in Delphi. Select Component/Import ActiveX Control/Image Viewer CP Pro ActiveX Control. Click Install...



Step 3: Select ActiveX Tab, you will see Image Viewer CP Pro ActiveX Control's icon.

Step 4: Drag Image Viewer CP Pro ActiveX Control to your form and design the UI same as following
 


Step 5: In Rotate button click event, add the following code, it will call PDFEditRotate method, it will pass the path of input pdf , output path of pdf file, page number, first page is zero and rotating degrees.

procedure TForm1.Button2Click(Sender: TObject);
var
  bResult : Bool;
begin
   SaveDialog1.Filter :='pdf (*.pdf) | *.pdf||';
     savedialog1.DefaultExt :='pdf';

  if Savedialog1.Execute then begin
    bResult:=ImageViewer1.PDFEditRotate(Edit1.Text, savedialog1.FileName, strToint(EditPage.Text)-1,  strToint(cboRotation.Items[cboRotation.itemindex]));

    if bResult then
    ShowMessage('PDF Created')
    else
         ShowMessage('Failed');
    end;

end;

end.


Step 6:
If you run this project now, you will see black color rectangle. In this sample, you do not need display the image. You may set the width and height properties to 1 pixel, then the user will not see it.



Step 7: Download the sample source code from pdf-rotation-delphi-sample.zip