> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export to PDF

> Generate a formatted PDF from your Nextedy RISKSHEET data with support for rating tables, downstream traceability, custom layouts, and multi-language fonts via Velocity templates.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Prerequisites

* A saved risksheet document with no unsaved changes
* The document must not be in comparison mode
* Version 24.2.2 or later for color-preserved exports

## Export the Risksheet to PDF

1. Open your risksheet document in Polarion.
2. **Save all changes** -- PDF export requires a clean, saved state.
3. Select **Export to PDF** from the toolbar or context menu.
4. A progress notification appears: "Exporting to PDF -- Please wait while the file is being generated."
5. Risksheet loads the PDF export configuration (`risksheetPdfExport.vm`), generates the document, and triggers a file download.

<Warning title="Save before exporting">
  PDF export is blocked if the sheet has unsaved changes or if comparison mode is active. Save all changes and exit comparison view before exporting. Unlike Excel export, PDF export strictly requires a clean state.
</Warning>

## Validation Requirements

PDF export enforces two checks before proceeding:

| Check               | Condition                               | Result                                |
| ------------------- | --------------------------------------- | ------------------------------------- |
| **Dirty state**     | Sheet has unsaved changes               | Export blocked                        |
| **Comparison mode** | Document is in revision comparison view | Export blocked; exit comparison first |

The exported PDF reflects the current state, including your active saved view, visible columns, and top panel settings.

## PDF Export Configuration

PDF export behavior is controlled by a Velocity template called `risksheetPdfExport.vm` -- the PDF export configuration. This template is loaded from one of two locations:

1. **Document attachment** -- a `risksheetPdfExport.vm` file attached directly to the LiveDoc
2. **Template inheritance** -- loaded from the parent template if no document-level file exists

The template receives a full Velocity context (document metadata, transaction access, macros from `pdfExportMacros.vm`) plus an exporter object with built-in methods for the main sheet, rating tables, enum tables, downstream tables, and custom tables.

For details, see [Customize PDF Export Scripts](/risksheet/guides/export/pdf-custom-scripts).

## Content Types in PDF Export

**Main sheet** -- The primary grid exports with all visible columns, preserving cell colors (v24.2.2+), headers, and hierarchical row merging. Hide columns via the `hideColumns` parameter (comma-separated `bindings` names).

**Rating tables** -- Three-column tables (ID, Label, Description) describing rating scales, emitted via the `#exportRatingTable("<enumId>")` macro (`exporter.exportRatingTable("<enumId>")` in script form). Values come from the Polarion enumeration referenced by each rating column (`type: rating:<enumId>`), not from any sheet-configuration section. Multiple tables (severity, occurrence, detection, RPN) can be emitted in one export.

**Downstream traceability tables** -- Export linked downstream items (mitigation tasks, verification activities) with deduplication based on `controlColumn` values.

**Enum value tables** -- Export Polarion enumeration definitions via the `#exportEnumTable("<enumId>")` macro (`exporter.exportEnumTable("<enumId>")` in script form), with `enumId` matching the enumeration referenced by an `enum:<enumId>` or `multiEnum:<enumId>` column type. Values come from the Polarion enumeration (Administration > Enumerations), not from any sheet-configuration section.

**Custom tables** -- Build arbitrary tables via `exportCustomTableData` with custom column definitions (`bindings`, `header`, `width`) and optional absolute positioning (`xpos`/`ypos`).

## Cell Rendering in PDF

| Column Type     | PDF Rendering                                           |
| --------------- | ------------------------------------------------------- |
| Text, numeric   | Direct value display                                    |
| Boolean         | Text "true" or "false"                                  |
| Enum            | Comma-separated display names                           |
| Item link       | Label text from linked work item                        |
| Multi-item link | Label from each linked item                             |
| Server-rendered | Stripped HTML converted to plain text                   |
| Empty cells     | Blank by default, or custom text via `emptyPlaceholder` |

<Tip title="Configure empty cell display">
  Set `emptyPlaceholder` in your custom export template to display text like "N/A" or "-" instead of leaving null cells blank.
</Tip>

<Warning title="Inconsistent enum display in PDF">
  Regular enums export with display titles (e.g., "High"), but rating enums (numeric IDs) and user/assignee fields may show internal IDs instead of names. Use [saved views](/risksheet/guides/customization/saved-views) for more consistent formatting.
</Warning>

## Comparison Mode Export

When exporting in comparison mode, custom templates have access to these scope variables:

* `isInCompare` -- whether the export is in comparison mode
* `compareRevision` -- the revision being compared against
* `currentRevision` -- the current document revision
* `showUnchanged` -- whether to include unchanged items

## Multi-Language Font Support

PDF export detects Latin characters by default. For non-Latin scripts, enable the appropriate font areas via the Polarion server property `risksheet.pdf.additionalFonts`:

| Setting              | Behavior                       |
| -------------------- | ------------------------------ |
| empty / missing      | Latin only (default)           |
| `chinese,japanese`   | Latin + Chinese + Japanese     |
| `hebrew,thai,arabic` | Latin + Hebrew + Thai + Arabic |

Supported areas: `latin chinese korean japanese hebrew thai arabic`. Values can be separated by spaces, commas, or semicolons. Latin is always enabled and covers the math symbol fallback. Unsupported values are ignored and logged to the browser console.

## Performance Tips

<Tip title="Use flat table view for large exports">
  Cell merging is the primary bottleneck. Switching to flat table view can reduce export time from hours to minutes. The `masterMergeOnly` property controls hierarchical versus flat structure. Version 25.2.0 includes optimizations for merged cell processing.
</Tip>

* Set `refreshOnSave` to `false` to avoid full page reloads
* Set `moduleOnlyPermissions` to `true` for faster loading on large sheets (v24.8.5+)

## Known Limitations

* **Text truncation** -- Cells for linked elements may truncate when content exceeds the calculated cell height. A fix is tracked.
* **Multi-page row repetition** -- When risk items span multiple pages, text from the previous page repeats at the top of the next page for context continuity (by design).
* **Baseline display** -- Baseline references may show incorrect or missing entries in variant projects. Use document ID/path-based identification.
* **Images not exported** -- Embedded images in work item fields do not appear in PDF exports.

## Verification

You should now see a downloaded PDF in your browser's download folder. Open it and confirm:

* The main risk analysis grid appears with correct column layout
* Cell colors and formatting match the Risksheet view (v24.2.2+)
* Rating tables display severity/occurrence/detection definitions
* Downstream traceability tables show the expected linked items

## See Also

* [Customize PDF Export Scripts](/risksheet/guides/export/pdf-custom-scripts) -- write Velocity templates for custom layouts
* [Add Multi-Page Images to PDF](/risksheet/guides/export/pdf-multi-page-images) -- configure repeating headers and logos
* [Control Column Visibility in Exports](/risksheet/guides/export/column-visibility-export) -- hide columns during export
* [Export to Excel](/risksheet/guides/export/excel-export) -- for data analysis and editable formats

<LastReviewed date="2026-06-24" />
