I created a graph in pydot, e.g. the python graphviz interface. Now, I would like to enter this graph into my reportlab report. Is there any direct way of doing this?
Asked
Active
Viewed 113 times
2 Answers
0
After an endless search, I figured there is no way. So, in the end I exported the pydot as a pdf, imported the pdf via PyPDF2 and then merged it with the ReportLab document. Far from ideal, but it does the job.

Werner Trelawney
- 168
- 1
- 7
0
You can use a similar (but perhaps slightly better) path with pdfrw -- you can run pdfrw in conjunction with reportlab, and import the PDF you exported from pydot, and use it as a form XObject (similar to an image) on the reportlab canvas. There are a few examples showing how to do this sort of thing in the pdfrw examples/rl1 subdirectory. Disclaimer: I am the pdfrw author.

Patrick Maupin
- 8,024
- 2
- 23
- 42