PageSourceSearch

https://www.etl-unternehmensberatung.de/wp-content/themes/etl-theme/lib/html2pdf/loadPdfGenerator.js

js etl-unternehmensberatung.de collected 2026-10-08 07:45:31 UTC 3,260 bytes, 83 lines download raw bytes

1function dateFormat(inputDate) {
2    let date, month, year;
3    date = inputDate.getDate();
4    month = inputDate.getMonth() + 1;
5    year = inputDate.getFullYear();
6    date = date.toString().padStart(2, '0');
7    month = month.toString().padStart(2, '0');
8    return `${date}.${month}.${year}`;
9}
10
11function addScript(url) {
12    var script = document.createElement('script');
13    script.type = 'application/javascript';
14    script.src = url;
15    document.head.appendChild(script);
16}
17
18var scrollTopPos;
19function preparePDFNews(){
20    scrollTopPos=jQuery(document).scrollTop();
21    jQuery(document).scrollTop(0);
22    jQuery('.langSwtich').removeClass('d-inline-flex');
23    jQuery('.noPrint, .langSwtich').hide();
24    jQuery('.nurPrint').hide().show();
25    jQuery('header>div.bg-lightgrey').removeClass('bg-lightgrey').addClass('bg-lightgreyXXX');
26    jQuery('.article-col+div').removeClass('col-md-3').removeClass('pt-5').removeClass('mb-5').addClass('pb-5');
27    jQuery('h2').css({'font-size':'2em'});
28    jQuery('.site-branding').addClass('p-0');
29    jQuery('.bcApplic').attr('style','margin-top: 90px');
30    jQuery('.apBox').attr('style','background: transparent;');
31    jQuery('.article-col').removeClass('col-md-9').removeClass('py-5');
32    jQuery('.sideBarItemWrapper, .apBox').removeClass('p-3');
33    jQuery('.article-col').append('<div class="removeAfterPrint mb-5">Druckdatum: '+dateFormat(new Date())+'<br /><a href="'+document.location.href+'">'+document.location.href+'</a></div>');
34    setTimeout(function(){generatePDF()}, 500);
35}
36
37function postprocessingPDFNews(){
38    jQuery('.langSwtich').addClass('d-inline-flex');
39    jQuery('.noPrint, .langSwtich').show();
40    jQuery('.nurPrint').hide();
41    jQuery('header>div.bg-lightgreyXXX').removeClass('bg-lightgreyXXX').addClass('bg-lightgrey');
42    jQuery('.article-col+div').addClass('col-md-3').addClass('pt-5').addClass('mb-5').removeClass('pb-5');
43    jQuery('h2').css({'font-size':'3.25em'});
44    jQuery('.site-branding').removeClass('p-0');
45    jQuery('.bcApplic').attr('style','margin-top: 180px');
46    jQuery('.apBox').attr('style','background: #f4f4f4;');
47    jQuery('.article-col').addClass('col-md-9').addClass('py-5');
48    jQuery('.sideBarItemWrapper, .apBox').addClass('p-3');
49    jQuery('.removeAfterPrint').remove();
50    jQuery(document).scrollTop(scrollTopPos);
51}
52
53function generatePDF(){
54    var element = document.getElementsByTagName('body')[0];
55    var opt = {
56        margin: [15,15],
57        filename:     location.pathname.replace("/", "-").substring(1)+'.pdf',
58        image:        { type: 'jpeg', quality: 0.98 },
59        html2canvas:  { scale: 2, letterRendering: true, useCORS: true },
60        jsPDF:        { unit: 'pt', format: 'a4', orientation: 'portrait', compress: true },
61        pagebreak:    { mode: ['avoid-all', 'css', 'legacy'] }
62    };
63    html2pdf().set(opt).from(element).save().then(function(){
64        postprocessingPDFNews();
65    });
66}
67
68function runPDF(what){
69    if(what=='news'){
70        preparePDFNews();
71    }
72}
73
74function startPDF(what){
75    addScript('/wp-content/themes/etl-theme/lib/html2pdf/html2pdf.bundle.min.js');
76    if(what=='news'){
77        setTimeout(function(){runPDF(what)}, 500);
78    }
79}
80
81/*-------------------*/
82
83/*startPDF('news');*/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.