Skip to content

PDF pass-through or PDF/A upgrade

Handles a source that is already a PDF: either it is copied through unchanged, or it is reloaded and re-saved to apply PDF/A-1b conformance. This operation is also the destination of the txt → pdf resubmission in Convert a source document to PDF.

Field Value
Operation ID OP-SFC-009
Trigger Called by Execute a single conversion (converter template) via PdfConverter.ConvertItem, dispatched from Convert a source document to PDF for pdf (including the recursive txt→pdf resubmission)
Inputs Source Stream, ConvertRequest
Outputs PDF byte[], or null
Primary components PdfConverter.ConvertItem
Entry point PdfApi.SyncFusionCore\Convert\PdfConverter.cs

Steps

  1. When request.Options.IsPdfa: load the stream as a PdfLoadedDocument, set Conformance = Pdf_A1B, save to a MemoryStream, and return the bytes (BR-SFC-020).
  2. The loaded document is not disposed on this path.*
  3. Otherwise, when request.FileExtension == "pdf": copy the stream verbatim into a MemoryStream and return the bytes unchanged (BR-SFC-021).
  4. If neither branch applies, return null.
  5. This makes Execute a single conversion (converter template) step 6 mark the result Failed (BR-SFC-007).

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start(["ConvertItem called<br>with stream, request"]) --> PdfaCheck{"Options.IsPdfa?"}
    PdfaCheck -->|Yes| LoadDoc["Load as PdfLoadedDocument,<br>set Conformance = Pdf_A1B"]
    LoadDoc --> SaveA[Save to MemoryStream]
    SaveA --> ReturnA([Return upgraded bytes])
    PdfaCheck -->|No| ExtCheck{"FileExtension<br>== pdf?"}
    ExtCheck -->|Yes| CopyThrough["Copy stream verbatim<br>to MemoryStream"]
    CopyThrough --> ReturnB([Return unchanged bytes])
    ExtCheck -->|No| ReturnNull([Return null])

Failure and edge-case behavior

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

Sources

  • PdfApi.SyncFusionCore\Convert\PdfConverter.cs