You are not logged in.
Pages: 1
I'm having trouble with this line:
e := pdfDoc.Canvas.TextWidth('some text');
It always returns 0 but doesn't give any errors.
Any ideas on where it could be going wrong?
Thanks,
Esmond
Offline
Just did a test program (was using cgi so hard to debug). The problem seemed to be HorizontalScaling was being initialised to zero. Setting this to 100 solved it. Could this property be initialised to 100 in TPdfPage, to save having to set it each time?
Thanks
Offline
I don't understand, normaly the 0 value inside this property will just ignore it:
See TPdfPage.TextWidth code:
tmpWidth := FFont.GetAnsiCharWidth(Text, i) * FFontSize / 1000;
if (FHorizontalScaling <> 0) and (FHorizontalScaling <> 100) then
tmpWidth := tmpWidth * FHorizontalScaling / 100;
What's appending here?
Offline
Looks like my source code was out of date. It went:
tmpWidth := FFont.GetAnsiCharWidth(Text, i) * FFontSize / 1000;
if FHorizontalScaling <> 100 then
tmpWidth := tmpWidth * FHorizontalScaling / 100;
Thanks for putting in createJpegDirect.
All working well
Offline
Pages: 1