Hello, I noticed that when I save a pdf file I have a loss of about 400 kb of memory.
The code is very simple:
Code
begin
wp:=TWPViewPDF.CreateParented(application.handle);
wp.plus.Enable(0);
wp.LoadFromFile(strpas(fileName)) ;
if true then
begin
StampMeta:=TmetaFile.create;
StampMetaCan := TMetafileCanvas.Create(StampMeta,0);
try
StampMetaCan.Font.Height := dati.font_height;
StampMetaCan.Font.Color := dati.text_color;
StampMetaCan.Font.Name := dati.font_name;
StampMetaCan.Font.size:=dati.font_size;
StampMetaCan.Brush.Style := bsClear;
aForm.eM11 := 1;
aForm.eM12 := 0;
aForm.eM21 := 0;
aForm.eM22 := 1;
aForm.eDx := Screen.PixelsPerInch;
aForm.eDy := Screen.PixelsPerInch*2;
SetWorldTransform(StampMetaCan.Handle, aForm);
y:=WPCentimeterToPixel(dati.posY_cm,72);
x:=WPCentimeterToPixel(dati.posx_cm,72);
lst:=TStringlist.create;
lst.text:=strpas(dati.testo);
idx:=0;
for n := lst.count - 1 downto 0 do
begin
StampMetaCan.TextOut(x,y-(15*(n+1)), lst[idx]);
inc(idx);
end;
lst.free;
nrP:=wp.CommandEx(COMPDF_GetPageCount,0);
finally
StampMetaCan.Free;
end;
wp.CommandStrEx(495,inttostr(nrP)+'-'+inttostr(nrP), StampMeta.Handle)
wp.Plus.SetSecurityMode(wpNoSecurity);
wp.Plus.SaveToFile(pchar(szNomeFile));
StampMeta.free;
end;
wp.clear;
wp.free;
end;
Alles anzeigen
Can you help me ?