Hi ALl,
I'm a little new to this but any help would be appreciated , I'm using Delphi 2009 and ImageEn Ver 6.0.0, The bit of code below take an input *.tif file ( multi page in most cases and All I want to do is save it to a pdf file ,the pdf ends up being huge so the compression is cleary not being applied. where have I gone wrong in this. Appreciate any help guys / girls.
function TForm3.fCreatePDFFile(fInFile,fOutFile: String): boolean;
const
PDFCompression: array[0..3] of TIOPDFCompression = (ioPDF_RLE, ioPDF_G3FAX2D, ioPDF_G4FAX, ioPDF_JPEG);
var iPageNum : Integer;
StreamedDoc : TMemoryStream;
begin
StreamedDoc := TMemoryStream.Create;
ScanImg.Clear;
ScanImg.MIO.LoadFromFileTIFF(fInFile) ;
try
for iPageNum := 0 to ScanImg.ImageCount - 1 do
begin
ScanImg.MIO.Params[iPageNum].PDF_Creator := 'Company X';
ScanImg.MIO.Params[iPageNum].PDF_PaperSize := IEStrToPaperSize('A4', iepA4);
ScanImg.MIO.Params[iPageNum].PDF_Compression := PDFCompression[0];
end;
ScanImg.MIO.SaveToStreamPDF(StreamedDoc);
StreamedDoc.Position := 0;
StreamedDoc.SaveToFile(fOutFile);
finally
StreamedDoc.Free;
ScanImg.Clear;
end;
end;
Trevor Chant