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¶
- When
request.Options.IsPdfa: load the stream as aPdfLoadedDocument, setConformance = Pdf_A1B, save to aMemoryStream, and return the bytes (BR-SFC-020). - The loaded document is not disposed on this path.*
- Otherwise, when
request.FileExtension == "pdf": copy the stream verbatim into aMemoryStreamand return the bytes unchanged (BR-SFC-021). - If neither branch applies, return
null. - 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¶
- Returning
nullwhen neither branch applies is treated identically to any other conversion failure by Execute a single conversion (converter template). - Any Syncfusion conversion failure surfaces as an exception, which is caught by
Execute a single conversion (converter template) and turned into a failed
PdfResultrather than propagated here.
Related documentation¶
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