You are not logged in.
Pages: 1
Hi.
When I run DrawText with a large string I got the error "canvas does not allow drawing" on line result := TMetafileCanvas.Create(Page,fPtrHdl); of function TGDIPages.CreateMetafileCanvas(Page: TMetafile): TMetafileCanvas; function.
Offline
I was not able to reproduce this "canvas does not allow drawing" error, but we did have an exception in TrimLine() when calling DrawText() with huge text.
Sounds like if GetTextExtentExPointNoPartials() API is a bit slow, but at least we found out a new algorithm which should fix the issue.
See http://synopse.info/fossil/info/0447736743
Offline
I managed to solve the problem.
I was calling SetPrinter after calling BeginDoc.
I changed SetPrinter to before BeginDoc and the problem stopped.
Offline
Pages: 1