function TifToPDF(TIFFilename, PDFFilename: string): boolean;
var
AcroApp: variant;
AVDoc: variant;
PDDoc: variant;
IsSuccess: Boolean;
begin
result := false;
if not fileexists(TIFFilename) then
exit;
try
AcroApp := CreateOleObject('AcroExch.App');
AVDoc := CreateOleObject('AcroExch.AVDoc');
AVDoc.Open(TIFFilename, '');
AVDoc := AcroApp.GetActiveDoc;
if AVDoc.IsValid then
begin
PDDoc := AVDoc.GetPDDoc;
PDDoc.SetInfo ('Title', '');
PDDoc.SetInfo ('Author', '');
PDDoc.SetInfo ('Subject', '');
PDDoc.SetInfo ('Keywords', '');
result := PDDoc.Save(1 or 4 or 32, PDFFilename);
PDDoc.Close;
end;
AVDoc.Close(True);
AcroApp.Exit;
finally
VarClear(PDDoc);
VarClear(AVDoc);
VarClear(AcroApp);
end;
end;
|