36

Im trying to use pyreverse to generate UML images for a project source code. When I run the pyreverse command and specify to generate png images, it runs and then after a while, it shows:

dot: graph is too large for cairo-renderer bitmaps. Scaling by 0.271394 to fit
dot: graph is too large for cairo-renderer bitmaps. Scaling by 0.333083 to fit

Then if I open either image, the text is unreadable because it got scaled. Is there a way to just not scale, and let the image be large size?

Thanks

MatthewMartin
  • 32,326
  • 33
  • 105
  • 164
omega
  • 40,311
  • 81
  • 251
  • 474

3 Answers3

41

the option

-T svg

worked for me

wall
  • 411
  • 4
  • 4
  • 2
    Just confirming that this worked for me (though I used `-Tsvg` - with no space, but maybe there's no difference). I was using `sfdp` and here was my command: `sfdp -Tsvg -Goverlap=prism input.dot -o output.svg -v` –  May 05 '17 at 07:22
9

Cairo's maximum bitmap size is 32767x32767 pixels, and dot will scale your graph to fit inside that area. As an alternative, you can tell pyreverse to generate PDF files, and use some other tool to convert to PNG, if you really need bitmaps.

pdw
  • 8,359
  • 2
  • 29
  • 41
  • 1
    When I change from -o png to -o pdf, the diagram appears empty. Any idea how to fix this? – zom-pro Jun 12 '15 at 11:03
  • 1
    no way to fix this. cairo is broken and can't generate real large images. it's a toy – Leo Jun 22 '16 at 00:19
6

in 2019, you can simply output the diagram as svg using:

-o svg

rekinyz
  • 6,576
  • 2
  • 29
  • 32