Skip to content

generatePdfReport()

SIP Protocol API Reference v0.7.0


SIP Protocol API Reference / generatePdfReport

generatePdfReport(report, options?): Uint8Array

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:7081

Generate a PDF document from an audit report

Creates a professionally formatted PDF report with:

  • Header with report metadata
  • Summary statistics
  • Optional transaction details table
  • Footer with generation timestamp

This implementation uses PDF 1.4 format and works in both Node.js and browsers.

AuditReport

The audit report to export

PdfExportOptions

PDF export options

Uint8Array

PDF document as Uint8Array

const report = await reporter.generateAuditReport({...})
const pdfBytes = generatePdfReport(report, {
title: 'Q1 2025 Audit Report',
organization: 'ACME Corp',
})
// Save to file (Node.js)
fs.writeFileSync('audit-report.pdf', pdfBytes)
// Download in browser
const blob = new Blob([pdfBytes], { type: 'application/pdf' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = 'audit-report.pdf'
a.click()