Adds config-variable for pdf-export
- Adds the page-size 'A5' for pdf-export
This commit is contained in:
parent
a09269cf2a
commit
eb7b203b33
@ -165,12 +165,14 @@ export class PdfDocumentService {
|
|||||||
this.initFonts();
|
this.initFonts();
|
||||||
this.imageUrls = imageUrls ? imageUrls : [];
|
this.imageUrls = imageUrls ? imageUrls : [];
|
||||||
pdfMake.vfs = await this.initVfs();
|
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
|
// needs to be done before, cause the footer is async
|
||||||
this.loadFooterImages();
|
this.loadFooterImages();
|
||||||
const result = {
|
const result = {
|
||||||
pageSize: 'A4',
|
pageSize: pageSize || 'A4',
|
||||||
pageOrientation: landscape ? 'landscape' : 'portrait',
|
pageOrientation: landscape ? 'landscape' : 'portrait',
|
||||||
pageMargins: customMargins || [75, 90, 75, 75],
|
pageMargins: customMargins || defaultMargins,
|
||||||
defaultStyle: {
|
defaultStyle: {
|
||||||
font: 'PdfFont',
|
font: 'PdfFont',
|
||||||
fontSize: this.configService.instant('general_export_pdf_fontsize')
|
fontSize: this.configService.instant('general_export_pdf_fontsize')
|
||||||
|
@ -186,6 +186,20 @@ def get_config_variables():
|
|||||||
subgroup="Export",
|
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
|
# Projector
|
||||||
|
|
||||||
yield ConfigVariable(
|
yield ConfigVariable(
|
||||||
|
Loading…
Reference in New Issue
Block a user