diff --git a/src/gui/plug/report/_graphvizreportdialog.py b/src/gui/plug/report/_graphvizreportdialog.py index 06e67af38..1539a7ee4 100644 --- a/src/gui/plug/report/_graphvizreportdialog.py +++ b/src/gui/plug/report/_graphvizreportdialog.py @@ -35,6 +35,7 @@ import threading import time from types import ClassType, InstanceType from gen.ggettext import gettext as _ +from subprocess import Popen, PIPE #------------------------------------------------------------------------------- # @@ -446,8 +447,13 @@ class GVPsDoc(GVDocBase): # If I take a correct multip page PDF and convert it with pdf2ps I get multip pages, # but the output is clipped, some margins have disappeared. I used 1 inch margins always. # See bug tracker issue 2815 + # :cairo does not work with Graphviz 2.26.3 See issue 4164 - os.system( 'dot -Tps:cairo -o"%s" "%s"' % (self._filename, tmp_dot) ) + command = 'dot -Tps:cairo -o"%s" "%s"' % (self._filename, tmp_dot) + dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1] + if dotversion.find('2.26.3'): + command=command.replace(':cairo','') + os.system(command) # Delete the temporary dot file os.remove(tmp_dot) @@ -775,7 +781,12 @@ class GVPdfGsDoc(GVDocBase): # Generate PostScript using dot # Reason for using -Tps:cairo. Needed for Non Latin-1 letters # See bug tracker issue 2815 + # :cairo does not work with Graphviz 2.26.3 See issue 4164 + command = 'dot -Tps:cairo -o"%s" "%s"' % ( tmp_ps, tmp_dot ) + dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1] + if dotversion.find('2.26.3'): + command=command.replace(':cairo','') os.system(command) # Add .5 to remove rounding errors.