Code Samples - Document Converter Pro

Example 16: Extract a page from an existing PDF file - Delphi Copy 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
   procedure TForm1.ExtractPageClick(Sender: TObject);
   var
     DC : Variant;
     RVal : Integer;
     pageToExtract : Integer;
   begin

      pageToExtract := 2;
      try
        DC := CreateOleObject('Neevia.docConverter');
        RVal := DC.extractPDFpages('c:\users\public\test.pdf', 'c:\users\public\page.pdf', pageToExtract, pageToExtract);
        If (RVal <> 0) Then
          ShowMessage('Error extracting PDF page!!! Code: '+IntToStr(RVal))
        Else
          ShowMessage('Done !!!');
      finally
        DC:= Unassigned;
      end;

   end;