From d57d3efcf46d2dccae376d9889a0cb0c9a29ffa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Thu, 27 Jul 2017 14:20:57 +0200 Subject: [PATCH] Added config option for standard font size in PDF. --- CHANGELOG | 3 ++- openslides/core/config_variables.py | 15 ++++++++++++++- openslides/core/static/js/core/pdf.js | 5 +++-- openslides/core/static/js/core/site.js | 3 ++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 10394a7bd..09ff5410f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -61,7 +61,8 @@ Core: (e. g. a list of speakers of a motion) [#3301]. - Select the projector resolution with a slider and an aspect ratio [#3311]. - Delay the 'could not load projector' error 3 seconds to not irritate users - with a slow internet connection [#3323] + with a slow internet connection [#3323]. +- Added config value for standard font size in PDF [#3332]. Mediafiles: - Fixed reloading of PDF on page change [#3274]. diff --git a/openslides/core/config_variables.py b/openslides/core/config_variables.py index 794e743bd..9395b355a 100644 --- a/openslides/core/config_variables.py +++ b/openslides/core/config_variables.py @@ -121,7 +121,7 @@ def get_config_variables(): name='general_export_pdf_pagenumber_alignment', default_value='center', input_type='choice', - label='Pagenumber alignment in PDF', + label='Page number alignment in PDF', choices=( {'value': 'left', 'display_name': 'Left'}, {'value': 'center', 'display_name': 'Center'}, @@ -130,6 +130,19 @@ def get_config_variables(): group='General', subgroup='Export') + yield ConfigVariable( + name='general_export_pdf_fontsize', + default_value='10', + input_type='choice', + label='Standard font size in PDF', + choices=( + {'value': '10', 'display_name': '10'}, + {'value': '11', 'display_name': '11'}, + {'value': '12', 'display_name': '12'}), + weight=148, + group='General', + subgroup='Export') + # Projector yield ConfigVariable( diff --git a/openslides/core/static/js/core/pdf.js b/openslides/core/static/js/core/pdf.js index 54f728b0e..618847593 100644 --- a/openslides/core/static/js/core/pdf.js +++ b/openslides/core/static/js/core/pdf.js @@ -224,12 +224,13 @@ angular.module('OpenSlidesApp.core.pdf', []) // Generates the document(definition) for pdfMake var getDocument = function(noFooter) { var content = contentProvider.getContent(); + var standardFontsize = Config.get('general_export_pdf_fontsize').value; return { pageSize: 'A4', pageMargins: [75, 90, 75, 75], defaultStyle: { font: 'PdfFont', - fontSize: 10 + fontSize: standardFontsize }, header: getHeader(), footerTpl: noFooter ? '' : getFooter(), @@ -246,7 +247,7 @@ angular.module('OpenSlidesApp.core.pdf', []) color: 'grey' }, preamble: { - fontSize: 10, + fontSize: standardFontsize, margin: [0,0,0,10], }, userDataTitle: { diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index 847f8e7b1..e369aa5ec 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -1883,10 +1883,11 @@ angular.module('OpenSlidesApp.core.site', [ gettext('Allow access for anonymous guest users'); gettext('Show this text on the login page'); gettext('Separator used for all csv exports and examples'); - gettext('Pagenumber alignment in PDF'); + gettext('Page number alignment in PDF'); gettext('Left'); gettext('Center'); gettext('Right'); + gettext('Standard font size in PDF'); gettext('Show logo on projector'); gettext('You can replace the logo by uploading an image and set it as ' + 'the "Projector logo" in "files".');