Is it possible (how?) to calculate element size (heigh,width) before printing it?
I’m looking for solution to detect necessity to use (or not) directive NewPage if next component is to big to fixed in actual page.
Exactly I have problem with:
var
MemoBuf: TMemoBuf;
begin
MemoBuf := TMemoBuf.Create;
MemoBuf.Text:=some_text;
MemoBuf.PrintStart := 0.2;
MemoBuf.PrintEnd := SectionRight;
//here is the main problem
PrintMemo(MemoBuf, 0, false);
MemoBuf.Free;
end;
where I don’t know: have I insert “newpage” or not fixed hole MemoBuf in place of page for printing.
All advice will be appreciated.
I found solution:
It is using MemoBuf.ConstrainHeightLeft method.