PageSourceSearch

https://findmylandlord.netlify.app/assets/js/createPDF.js

js findmylandlord.netlify.app collected 2026-10-03 10:44:43 UTC 1,959 bytes, 81 lines download raw bytes

1function createPDF(title, list) {	
2	// Set global defaults
3	jsPDF.autoTableSetDefaults({
4		// Black table style
5		headStyles: {fillColor: 0},
6	});
7
8	// Create PDF
9	var doc = new jsPDF({orientation: "landscape"});
10
11	// Set column titles
12	var col = [
13		i18next.t('PROPERTY_ADDRESS'),
14		i18next.t('COMMUNITY_AREA'),
15		i18next.t('KNOWN_UNITS'),
16		i18next.t('AFFILIATED_WITH'),
17		i18next.t('PROPERTIES_OWNED'),
18		i18next.t('PROPERTY_TAXPAYER')
19	];
20	
21	// Create empty rows array
22	var rows = [];
23
24	// Create rows
25	(function () {
26		for (var i = 0; i < list.features.length; i++) {
27			// Clean up known units
28			var knownUnits;
29			if (list.features[i].properties[unitColumn] == 0) {
30				knownUnits = "--";
31			} else {
32				knownUnits = list.features[i].properties[unitColumn];
33			};
34
35			// Clean up affiliated with
36			var affiliatedWith;
37			if (list.features[i].properties[affiliatedWithColumn] == 0) {
38				affiliatedWith = "--";
39			} else {
40				affiliatedWith = list.features[i].properties[affiliatedWithColumn];
41			};
42
43			// Set row values
44	        var temp = [
45				list.features[i].properties[propertyAddressColumn],
46				list.features[i].properties[communityAreaColumn],
47				knownUnits,
48				affiliatedWith,
49				list.features[i].properties[ownedColumn],
50				list.features[i].properties[taxpayerColumn]
51			];
52			rows.push(temp);
53	    };
54	}());
55
56	// Create table
57	doc.autoTable({
58		styles: {font: "ManifoldDSA"},
59		columns: col,
60		body: rows,
61		didDrawPage: function (data) {
62  			// Set header
63  			doc.setFont("ManifoldDSA");
64  			doc.setFontSize(20);
65  			doc.setTextColor(40);
66  			doc.setFontStyle("bold");
67  			doc.text(title, data.settings.margin.left, 20);
68		},
69		didParseCell: function (data) {
70			// Style empty cells
71			if(data.section === "body" && data.cell.raw == "--"){
72				data.cell.styles.textColor = gray;
73			};
74		},
75		margin: {top: 30}
76		});
77	
78	// Save with trimmed filename
79	doc.save(title.replace(/\s+/g, "")+".pdf");
80	console.log("PDF saved");
81};

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.