You are not logged in.
Pages: 1
Hi everyone, i need help to create small pdf files with synpdf.
I use this Delphi code to transform scanned .jpg images into a single pdf :
pdfDoc := TPdfDocument.Create(false,0,false,TPdfEncryption.New(elRC4_128,LabeledEditPdfPw.text,LabeledEditPdfPw.text,PDF_PERMISSION_NOCOPYNORPRINT))
else
pdfDoc :=TPdfDocument.Create;
pdfDoc.Info.Author:='';
pdfDoc.Info.Creator:='';
pdfDoc.DefaultPaperSize:=psA4;
pdfDoc.DefaultPageLandscape:=PdfLandscape;
pdfDoc.CompressionMethod:=cmFlateDecode;
pdfDoc.ForceJPEGCompression:=Qualitapdf;
Sb.Panels[0].Text:='Create pdf wait...';
for i := 0 to ListBox1.Count - 1 do
begin
JpegImage:=TJpegImage.create;
Nomefile:=dir+ListBox1.Items.Strings[i];
JpegImage.LoadFromFile(nomefile);
pdfpage := pdfDoc.AddPage;
pdfImage := TPdfImage.Create(pdfDoc,jpegimage,true);
JpegImage.Free;
pdfDoc.AddXObject('image'+inttostr(i), pdfimage);
pdfDoc.Canvas.DrawXObject(0,0,pdfpage.PageWidth,pdfpage.PageHeight,'image'+inttostr(i));
ListBox1.Selected[i] := true;
Sb.Panels[0].Text:='Process page '+inttostr(i)+' of '+inttostr(ListBox1.Count)+' wait...';
Application.ProcessMessages;
// pdfImage.CleanupInstance;
end;
The pdf file I get is still too big... how can I minimize the outupt file size?
Thanks for the attention.
Offline
Pages: 1