var
mdevice : array[0..255] of char;
mdriver : array[0..255] of char;
mport : array[0..255] of char;
mhdmode : thandle;
mpdmode : pdevmode;
begin
printer.getprinter(mdevice, mdriver, mport, mhdmode);
printer.setprinter('fineprint pdffactory pro', mdriver, mport, mhdmode); //设置打印机

printer.begindoc;
printer.canvas.moveto(0, 0);
printer.canvas.lineto(300, 300);
printer.canvas.textout(20, 20, '打印文字');
printer.enddoc;
end;