Software Bill of Materials (SBOM) Generator

Software Bill of Materials (SBOM) Generator

Generates an SPDX-compatible JSON document from your software component list.

Generated SBOM (SPDX Format)

Product Identification

Document Details

Add Component

Component List (0 Components)

Name Version License Actions

Generated on ${dateInput.value} by ${creatorInput.value}

1. Product Information

  • Supplier: ${supplierInput.value}
  • Format: SPDX 2.3 (Simplified)

2. Component List (${components.length} Dependencies)

`; if (components.length > 0) { reportHTML += ` `; components.forEach(comp => { reportHTML += ` `; }); reportHTML += `
Name Version License
${comp.name} ${comp.version} ${comp.license}
`; } else { reportHTML += `

No open-source components found/listed.

`; } reportHTML += `

3. Raw SPDX JSON

${codeOutput.value}
`; pdfReportContent.innerHTML = reportHTML; // Append to body temporarily for capture pdfReportContent.style.position = 'absolute'; pdfReportContent.style.left = '-9999px'; pdfReportContent.style.width = '800px'; document.body.appendChild(pdfReportContent); html2canvas(pdfReportContent, { scale: 2 }).then(canvas => { document.body.removeChild(pdfReportContent); const imgData = canvas.toDataURL('image/png'); const { jsPDF } = window.jspdf; const pdf = new jsPDF('p', 'mm', 'a4'); const pdfWidth = pdf.internal.pageSize.getWidth(); const imgProps = pdf.getImageProperties(imgData); const contentWidth = pdfWidth - 20; const contentHeight = (imgProps.height * contentWidth) / imgProps.width; let heightLeft = contentHeight; let position = 10; // Top margin pdf.addImage(imgData, 'PNG', 10, position, contentWidth, contentHeight); heightLeft -= pdf.internal.pageSize.getHeight(); while (heightLeft >= 0) { position = heightLeft - contentHeight + 10; pdf.addPage(); pdf.addImage(imgData, 'PNG', 10, position, contentWidth, contentHeight); heightLeft -= pdf.internal.pageSize.getHeight(); } pdf.save(projectNameInput.value.replace(/[^a-zA-Z0-9]/g, '_') + "_SBOM_Report.pdf"); }); }); // --- Initial Render --- renderComponentList(); generateSBOM(); showTab(0); });
Scroll to Top