发布于 2015-09-11 16:20:18 | 175 次阅读 | 评论: 0 | 来源: 网络整理

The PSDraw module provides simple print support for Postscript printers. You can print text, graphics and images through this module.

class PIL.PSDraw.PSDraw(fp=None)[source]

Sets up printing to the given file. If file is omitted, sys.stdout is assumed.

begin_document(id=None)[source]

Set up printing of a document. (Write Postscript DSC header.)

end_document()[source]

Ends printing. (Write Postscript DSC footer.)

image(box, im, dpi=None)[source]

Draw a PIL image, centered in the given box.

line(xy0, xy1)[source]

Draws a line between the two points. Coordinates are given in Postscript point coordinates (72 points per inch, (0, 0) is the lower left corner of the page).

rectangle(box)[source]

Draws a rectangle.

参数:box

A 4-tuple of integers whose order and function is currently undocumented.

Hint: the tuple is passed into this format string:

%d %d M %d %d 0 Vr
setfont(font, size)[source]

Selects which font to use.

参数:
  • font – A Postscript font name
  • size – Size in points.
setink(ink)[source]

This has been in the PIL API for ages but was never implemented.

text(xy, text)[source]

Draws text at the given position. You must use setfont() before calling this method.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务