Recommendations for a simple python 2D graphics library that can display pdf as well?

I am looking for an easy-to-use graphical library for python that can be displayed on screen as well as in pdf format. Thus, I would use the code to draw some things (simple primitives, such as ovals, rectangles, lines and points) for the screen, and then, when everything looks good, print it in pdf.

+3
source share
6 answers

You can use the Python Imaging Library to draw images that can be easily displayed in various user interfaces, for example. showing jpg. Then use ReportLab . Here's an example that shows how to use ReportLab with an image.

I'm not sure what you mean by the picture on the screen, i.e. if you are working with a specific set of user interface tools. But if it is acceptable for drawing and displaying PDF files without using an intermediate image (jpg, etc.), you can consider the PyX library , which makes it quite simple in graphical form using PDF files.

+1
source

Tkinter, Canvas, .postscript PostScript, PDF ps2pdf.

postscript (self, cnf = {}, ** kw) . : colormap, colormode, file, fontmap, , pageanchor, pageheight, pagewidth, pagex, pagey, rotate, witdh, x, y.

+3

matplotlib, , , , .

pygame. , pdf , 2D-.

, ReportLab, PDF . - , .

0

, - /.

, , - Postscript , , Ghostview; tyo PDF (ps2pdf). , Postscript , .

, Matplotlib, , " , ", .

.

0

PDF - , , .

: , , PDF , , HTML. ( HTML , )

, -, PDF , PDF . , WYSIWYG.

0

Source: https://habr.com/ru/post/1743087/


All Articles