declarations_download_pdf
Generates the ANAF-ready PDF for a declaration, with the XML embedded, so you can upload it manually to SPV or the e-guvernare portal. Validates first and returns errors instead of a broken file.
Instructions
The PDF ANAF accepts for this declaration (DUKIntegrator's form with the XML embedded and, for C168, the attachment zip), generated on demand from the current data. Use it when the user files by hand: they upload this file in SPV (persoane fizice: SPV → Depunere declarații) or on the e-guvernare portal with their own certificate. Written to outFile. Storno's rules and ANAF's validator run first; errors come back instead of a broken file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Declaration UUID | |
| outFile | Yes | Where to write the PDF | |
| refresh | No | Regenerate even if a PDF was already produced (drafts only) | |
| companyId | No | Company UUID (overrides STORNO_COMPANY_ID env var) |