Merge pull request #4726 from GabrielInTheWorld/pdf-make
Adds config-variable for pdf-export
This commit is contained in:
commit
e907599cef
@ -165,12 +165,14 @@ export class PdfDocumentService {
|
||||
this.initFonts();
|
||||
this.imageUrls = imageUrls ? imageUrls : [];
|
||||
pdfMake.vfs = await this.initVfs();
|
||||
const pageSize = this.configService.instant('general_export_pdf_pagesize');
|
||||
const defaultMargins = pageSize === 'A5' ? [45, 30, 45, 45] : [75, 90, 75, 75];
|
||||
// needs to be done before, cause the footer is async
|
||||
this.loadFooterImages();
|
||||
const result = {
|
||||
pageSize: 'A4',
|
||||
pageSize: pageSize || 'A4',
|
||||
pageOrientation: landscape ? 'landscape' : 'portrait',
|
||||
pageMargins: customMargins || [75, 90, 75, 75],
|
||||
pageMargins: customMargins || defaultMargins,
|
||||
defaultStyle: {
|
||||
font: 'PdfFont',
|
||||
fontSize: this.configService.instant('general_export_pdf_fontsize')
|
||||
|
@ -186,6 +186,20 @@ def get_config_variables():
|
||||
subgroup="Export",
|
||||
)
|
||||
|
||||
yield ConfigVariable(
|
||||
name="general_export_pdf_pagesize",
|
||||
default_value="A4",
|
||||
input_type="choice",
|
||||
label="Standard page size in PDF",
|
||||
choices=(
|
||||
{"value": "A4", "display_name": "A4"},
|
||||
{"value": "A5", "display_name": "A5"},
|
||||
),
|
||||
weight=147,
|
||||
group="General",
|
||||
subgroup="Export",
|
||||
)
|
||||
|
||||
# Projector
|
||||
|
||||
yield ConfigVariable(
|
||||
|
Loading…
Reference in New Issue
Block a user