diff --git a/gramps/gen/plug/docgen/graphdoc.py b/gramps/gen/plug/docgen/graphdoc.py index 53880fbd7..45d21508f 100644 --- a/gramps/gen/plug/docgen/graphdoc.py +++ b/gramps/gen/plug/docgen/graphdoc.py @@ -123,6 +123,7 @@ class GVOptions(): self.h_pages = None self.v_pages = None self.page_dir = None + self.dpi = None def add_menu_options(self, menu): """ @@ -217,9 +218,10 @@ class GVOptions(): dpi = NumberOption(_("DPI"), 75, 20, 1200) dpi.set_help(_( "Dots per inch. When creating images such as " ".gif or .png files for the web, try numbers " - "such as 100 or 300 DPI. When creating PostScript " - "or PDF files, use 72 DPI.")) + "such as 100 or 300 DPI. PostScript and PDF files " + "always use 72 DPI.")) menu.add_option(category, "dpi", dpi) + self.dpi = dpi nodesep = NumberOption(_("Node spacing"), 0.20, 0.01, 5.00, 0.01) nodesep.set_help(_( "The minimum amount of free space, in inches, " diff --git a/gramps/gui/plug/report/_graphvizreportdialog.py b/gramps/gui/plug/report/_graphvizreportdialog.py index 3beb28330..23b1ee8b6 100644 --- a/gramps/gui/plug/report/_graphvizreportdialog.py +++ b/gramps/gui/plug/report/_graphvizreportdialog.py @@ -211,6 +211,24 @@ class GraphvizReportDialog(ReportDialog): fname = spath self.target_fileentry.set_filename(fname) + format_str = obj.get_format_str() + if format_str in ['gvpdf', 'gspdf', 'ps']: + # Always use 72 DPI for PostScript and PDF files. + self.__gvoptions.dpi.set_value(72) + self.__gvoptions.dpi.set_available(False) + else: + self.__gvoptions.dpi.set_available(True) + + if format_str in ['gspdf', 'dot']: + # Multiple pages only valid for dot and PDF via GhostsScript. + self.__gvoptions.h_pages.set_available(True) + self.__gvoptions.v_pages.set_available(True) + else: + self.__gvoptions.h_pages.set_value(1) + self.__gvoptions.v_pages.set_value(1) + self.__gvoptions.h_pages.set_available(False) + self.__gvoptions.v_pages.set_available(False) + def make_document(self): """Create a document of the type requested by the user. """