Add enhanced PDF exporter implementing the Exporter interface for professional vulnerability scan reports
Generate reports with executive summary dashboard, color-coded severity visualization, structured findings table, and detailed findings sections with automatic pagination
Include comprehensive unit tests with thread-safety verification and concurrent export testing
New: pkg/reporting/exporters/pdf/pdf.go - Enhanced PDF exporter implementation (216 lines)
New: pkg/reporting/exporters/pdf/pdf_test.go - 4 comprehensive unit tests (all passing)
Modified: pkg/types/types.go - Added PDFExport field to Options struct
Modified: pkg/reporting/options.go - Registered PDF exporter in configuration
Modified: cmd/nuclei/main.go - Added -pdf-export / -pe CLI flag
Modified: go.mod/go.sum - Added github.com/go-pdf/fpdf dependency (community-maintained fork)
Professional Layout:
Executive Summary Dashboard:
Detailed Findings Section:
Robust Handling:
# Basic usage
nuclei -u http://example.com -pdf-export report.pdf
# With custom template
nuclei -u http://example.com -t template.yaml -pdf-export scan_results.pdf
go test -v ./pkg/reporting/exporters/pdf/
Test Coverage:
TestNewExporter - Verifies exporter initializationTestExportConcurrency - Tests thread-safety with 100 concurrent exportsTestExportEmpty - Validates empty report generationTestExportWithVariousSeverities - Tests all severity levels (Critical, High, Medium, Low, Info, Unknown)Results:
=== RUN TestNewExporter
--- PASS: TestNewExporter (0.00s)
=== RUN TestExportConcurrency
--- PASS: TestExportConcurrency (0.01s)
=== RUN TestExportEmpty
--- PASS: TestExportEmpty (0.00s)
=== RUN TestExportWithVariousSeverities
--- PASS: TestExportWithVariousSeverities (0.00s)
PASS
ok github.com/projectdiscovery/nuclei/v3/pkg/reporting/exporters/pdf 0.644s
go fmt ./pkg/reporting/exporters/pdf/... # Formatting passed
go vet ./pkg/reporting/exporters/pdf/... # Linting passed
make build # Builds successfully
✅ Active Maintenance - Uses github.com/go-pdf/fpdf (community-maintained fork, not archived)
✅ Color-Coded Visualization - Severity-based color coding (Critical=Purple, High=Red, Medium=Orange, Low=Yellow, Info=Blue, Unknown=Grey)
✅ Thread-Safe Operations - Mutex-protected concurrent exports verified with 100 simultaneous operations
✅ Smart Sorting - Automatic severity-based sorting (Critical → Info) for prioritized review
✅ Professional Output - A4 layout with headers, footers, page numbers, and proper pagination
/claim #2063
New Features
Added professional PDF export for scan results with executive summary dashboard, color-coded severity visualization, structured findings table, detailed findings sections, automatic pagination, and timestamps; shows a friendly message when no findings exist.
Tests
Added 4 comprehensive unit tests covering exporter creation, concurrent exports (thread-safety with 100 operations), empty report generation, and multiple severity levels; all tests passing.
Chores
Updated dependencies with github.com/go-pdf/fpdf (community-maintained fork).
New Features
Tests
SrijaVuppala
@SrijaVuppala295
ProjectDiscovery
@projectdiscovery