starting PdfCreator
This commit is contained in:
@@ -25,6 +25,14 @@
|
|||||||
<!-- Custom Theme Style -->
|
<!-- Custom Theme Style -->
|
||||||
<link href="../gentelella/build/css/custom.css" rel="stylesheet" />
|
<link href="../gentelella/build/css/custom.css" rel="stylesheet" />
|
||||||
<link href="../forkMeOnGitHub.css" rel="stylesheet" type="text/css" />
|
<link href="../forkMeOnGitHub.css" rel="stylesheet" type="text/css" />
|
||||||
|
<!-- FK-TODO: use pdfmake.min.js -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.10/pdfmake.js"
|
||||||
|
integrity="sha512-4kR+uTNZljL4J4SJ/1+p2c9P78rYzK7TIk4eg/KHUkb6zqr7ykxvK+XrXybmHWfkfLAHPKVHpJwatxjrygZ+uQ=="
|
||||||
|
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
|
<!--FK-TODO: use vfs_fonts.min.js -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.10/vfs_fonts.js"
|
||||||
|
integrity="sha512-nNkHPz+lD0Wf0eFGO0ZDxr+lWiFalFutgVeGkPdVgrG4eXDYUnhfEj9Zmg1QkrJFLC0tGs8ZExyU/1mjs4j93w=="
|
||||||
|
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<script src="../Utils.js"></script>
|
<script src="../Utils.js"></script>
|
||||||
<script src="../UIUtils.js"></script>
|
<script src="../UIUtils.js"></script>
|
||||||
<script src="../UrlUtils.js"></script>
|
<script src="../UrlUtils.js"></script>
|
||||||
@@ -33,6 +41,7 @@
|
|||||||
<script src="../NumberWithBarElementFactory.js"></script>
|
<script src="../NumberWithBarElementFactory.js"></script>
|
||||||
<script src="./js/PrrByKey2CsvConverter.js"></script>
|
<script src="./js/PrrByKey2CsvConverter.js"></script>
|
||||||
<script src="./js/PageInitializer.js"></script>
|
<script src="./js/PageInitializer.js"></script>
|
||||||
|
<script src="./js/PdfCreator.js"></script>
|
||||||
<script src="./js/PrrByVaccineProvider.js"></script>
|
<script src="./js/PrrByVaccineProvider.js"></script>
|
||||||
<script src="./js/PrrByKeyTable.js"></script>
|
<script src="./js/PrrByKeyTable.js"></script>
|
||||||
<script src="./js/PrrByKeyTableView.js"></script>
|
<script src="./js/PrrByKeyTableView.js"></script>
|
||||||
@@ -58,7 +67,8 @@
|
|||||||
prrBySymptomTableElement: $('#prrBySymptomTable'),
|
prrBySymptomTableElement: $('#prrBySymptomTable'),
|
||||||
downloadPrrBySymptomTableButton: document.querySelector("#downloadPrrBySymptomTable"),
|
downloadPrrBySymptomTableButton: document.querySelector("#downloadPrrBySymptomTable"),
|
||||||
valueName: name
|
valueName: name
|
||||||
}
|
},
|
||||||
|
pdfButton: document.querySelector("#PDF")
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -14305,6 +14315,7 @@
|
|||||||
<!-- page content -->
|
<!-- page content -->
|
||||||
<!-- footer content -->
|
<!-- footer content -->
|
||||||
<footer>
|
<footer>
|
||||||
|
<button class="a2a_button" id="PDF">PDF</button>
|
||||||
<!-- AddToAny BEGIN -->
|
<!-- AddToAny BEGIN -->
|
||||||
<div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-title="EU Safety Signal (All drugs)">
|
<div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-title="EU Safety Signal (All drugs)">
|
||||||
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
|
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
class PageInitializer {
|
class PageInitializer {
|
||||||
|
|
||||||
static initializePage({ symptom, vaccine }) {
|
static initializePage({ symptom, vaccine, pdfButton }) {
|
||||||
PageInitializer.#configureSymptom(symptom);
|
PageInitializer.#configureSymptom(symptom);
|
||||||
PageInitializer.#configureVaccine(vaccine);
|
PageInitializer.#configureVaccine(vaccine);
|
||||||
|
PageInitializer.#configurePDFButton(pdfButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
static #configureSymptom({ symptomSelectElement, urlSearchParam, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) {
|
static #configureSymptom({ symptomSelectElement, urlSearchParam, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) {
|
||||||
@@ -32,4 +33,10 @@ class PageInitializer {
|
|||||||
minimumInputLength: 0
|
minimumInputLength: 0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static #configurePDFButton(pdfButton) {
|
||||||
|
pdfButton.addEventListener(
|
||||||
|
'click',
|
||||||
|
() => PdfCreator.createPdf().open());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
docs/SymptomsCausedByDrugs/js/PdfCreator.js
Normal file
13
docs/SymptomsCausedByDrugs/js/PdfCreator.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
class PdfCreator {
|
||||||
|
|
||||||
|
static createPdf() {
|
||||||
|
const documentDefinition = {
|
||||||
|
content: [
|
||||||
|
{ text: 'Customizing Page Size and Orientation', fontSize: 16, bold: true },
|
||||||
|
{ text: 'This PDF has custom page size and orientation.' },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
return pdfMake.createPdf(documentDefinition);
|
||||||
|
// pdfMake.createPdf(documentDefinition).download();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user