# Task: Make a printer-friendly version

I want my application to do what Lacuna's "Make a printer-friendly version" demo does: Make a signed PDF's printer-friendly version, with a verification code that leads back to it, with PKI SDK on the server.

- Docs: https://docs.lacunasoftware.com/en-us/articles/pki-sdk
- Live demo: https://try.lacunasoftware.com/en/pki-suite/printer-friendly-version
- This demo for AI agents: https://try.lacunasoftware.com/en/pki-suite/printer-friendly-version.md

## Samples

- .NET (aspnet-mvc): [Make a printer-friendly version of a signed PDF using PKI SDK](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/mvc/PkiSuiteAspNetMvcSample/Controllers/PrinterFriendlyPadesSdkController.cs)

## Call sequence

Recorded on 2026-10-12 against the real products with Lacuna's public test certificates and data. Keys, tokens, sessions, ids, file contents and personal data are masked.

### 1. PKI SDK validates the file on the validation Demo's own path first, so that only a readable PDF with a PAdES signature goes on and is kept.

On the server, in process: `PadesSignature.Open(pdf), then PadesSignature.ValidateSignature(signer, policy)`

### 2. PKI SDK validates the signatures again, marks every page with the signers and the code, and appends the manifest with a QR code to the check page; the printout holds no signature.

On the server, in process: `PdfMarker.WriteMarks(signedPdf)`

## Patterns to copy

- This Demo calls no API: PKI SDK validates and marks the PDF inside the server's process.
- Validate first, with the same path as your validation screen, and make a printout only for a PDF with a PAdES signature.
- `PdfMarker` with `ThrowIfSignedPdf = false` rewrites a signed PDF and flattens its signatures, so the printout holds none: keep the original as the signed document. `PreserveSignaturesVisualRepresentation = true` keeps the stamps.
- Point the printout at a page where the kept original is validated again on each visit, by a QR code and URL that never change once printed.

## What to do

Implement this in my project with its existing stack, language, framework and conventions, following the call sequence and the patterns above, and adapting the samples rather than copying them whole. Ask me before adding any dependency or package. Keep API keys and private keys out of the browser and out of the repository.
