PostscriptPrinter lazarus / 7-LCL ---------------------------------------------------------------------- critlopaco · 2010-01-04 11:22 PostscriptCanvas doesn't support unicode charset. Example: I'd like to make a postscript file with russion characters. They are OK on win32, but they aren't seen on Mac. (PostscriptCanvas.TextOut(...)); How can I set the options? (on english Lazarus) ---------------------------------------------------------------------- jesusr · 2010-01-04 20:20 Can you provide a sample?. What Lazarus version? see help->about lazarus -> version tab, then right click to copy version info to clipboard. ---------------------------------------------------------------------- critlopaco · 2010-01-05 07:15 Lazarus 0.9.29 r21438 FPC 2.2.4 i386-darwin-carbon (beta) ------------------------- procedure TForm1.Postscript1Click(Sender: TObject); var x:utf8string; PsCanvas: TPostscriptCanvas; Begin x:='абцдефгхиыйклмнопршщтвжъяю'; if SaveDialog1.Execute then begin Try PsCanvas := TPostscriptCanvas.Create; Canvas.BeginDoc; PsCanvas.TextOut(20,20,x); PsCanvas.SaveToFile(SaveDialog1.FileName); PsCanvas.EndDoc; finally     PsCanvas.Free;     ShowMessage('The PS file is ready.'); end; end; End; ---------------------------------------------------------------------- jesusr · 2010-01-05 21:53 The first problem in your sample is that you are calling PsCanvas.SaveToFile() before PsCanvas.EndDoc, EndDoc is important as it instructs ps interpreter to show the page, SaveToFile should be called after EndDoc. The second problem is that according to your version, postscriptcanvas now supports user defined resolution (by default 300 dpi is used) but there was a problem in Lazarus because no default paper height and width was assumed, so bounding box of output ended to be 0 width/height. In lazarus revision 23386 we have fixed this problem and now a A4 paper is assumed. Both problems may or not affect the output depending on the ps interpreter. if it worked for you on windows it might mean that ps interpreter under mac is stricter. In the mean time you can solve the problem by doing something like: Code: [Select]PsCanvas := TPostscriptCanvas.Create; PsCanvas.PaperWidth := round(PSCanvas.XDPI*595/72); PsCanvas.PaperHeight:=round(PSCanvas.YDPI*842/72); PsCanvas.BeginDoc; etc once these two points are fixed, your sample worked fine here. ---------------------------------------------------------------------- critlopaco · 2010-01-06 08:01 Sorry, I have copied briefly and wrongly. Really, the program work well and the created postscript file by Mac(Lazarus) is seen well with GSview on PC (russion characters). Maybe, Preview of Leopard doesn't work well with Lazarus Postscript. Thanks