Neevia Technology Sites:   www.neevia.com  |  docuPub.com  |  www.neeviaPDF.com
:: Home :: Products :: Technical Support :: About Us :: Contact Us
Technical support > Neevia Document Converter Pro code samples
Example 3: How to convert an URL from Delphi  Print Example 

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, 
  Controls, Forms, Dialogs, StdCtrls, ComObj;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  DC : Variant;
  rv : Integer;
  urlToConvert : String;
begin

  urlToConvert := 'http://neevia.com';

  DC := CreateOleObject('Neevia.docConverter');

  DC.setParameter("DocumentOutputFormat", 'PDF');
  DC.setParameter("DocumentOutputFolder", 'c:\');
  DC.setParameter("PDFAutoRotatePage", 'All');

  rv := DC.submitUrl(urlToConvert, 'neevia.url', '');

  If (rv <> 0) then
  begin
    Application.MessageBox(' SubmitURL error','Error', MB_OK);
    Exit;
  end;

  rv := 2;
  While (rv = 2) do
  begin
    rv := DC.checkStatus('neevia.url', '');
    Application.ProcessMessages;
    DC.doSleep(1000);
  end;

  if (rv = 0) then
    Application.MessageBox(' Converted successfully ','Success', MB_OK)
  else
    Application.MessageBox(' Error converting ','Error', MB_OK);

end;

end.




Copyright © 1999-2016 Neevia Technology. All Rights Reserved. Home | Products | Technical Support | About Us | Contact Us