Code Samples - Neevia docCreator

Example 8: Convert a PostScript document into PDF - Delphi Copy 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
   procedure convertPStoPDF();
   var
     DC : Variant;
     RVal : Integer;
     docToConvert : String;
   begin
     docToConvert := 'c:\users\public\test.ps';

     try
       DC := CreateOleObject('Neevia.docCreator');
       DC.setParameter('DocumentOutputFormat', 'PDF');
       DC.setParameter('DocumentOutputName', 'testPS_Delphi');
       DC.setParameter('DocumentOutputFolder', 'c:\users\public\');

       RVal := DC.setInputDocument(docToConvert);
       If (RVal <> 0) Then
         ShowMessage('Error while creating document!!! Code: '+IntToStr(RVal))
       else
         ShowMessage('Done converting !!!');
     finally
       DC := Unassigned;
     end;
   end;