TIFF to multi-page PDF¶
Converts a TIFF image stream — potentially containing multiple frames — into a multi-page PDF, emitting one page per frame in frame order.
| Field | Value |
|---|---|
| Operation ID | OP-SFC-008 |
| Trigger | Called by Execute a single conversion (converter template) via TiffConverter.ConvertItem, dispatched from Convert a source document to PDF for tif/tiff |
| Inputs | Source Stream, ConvertRequest |
| Outputs | PDF byte[] |
| Primary components | TiffConverter.ConvertItem |
| Entry point | PdfApi.SyncFusionCore\Convert\TiffConverter.cs |
Steps¶
- Choose conformance (
Pdf_A1B/None) and create thePdfDocument(BR-SFC-011). - Set
doc.PageSettings.Margins.All = 0(BR-SFC-018). - Load the stream as a
PdfBitmapand readFrameCount. - For each frame index
0..FrameCount-1: add a page, select the frame viaActiveFrame, and draw it to the full page client size (BR-SFC-019, BR-SFC-017). - Write a percentage-complete line to
System.Diagnostics.Debugfor each frame — a debug-only progress trace, not application logging. - Save to a
MemoryStream, close the document, and return the bytes.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["ConvertItem called<br>with stream, request"]) --> Conf["Choose conformance,<br>create PdfDocument"]
Conf --> Margins[Set page margins to 0]
Margins --> LoadBmp["Load stream as PdfBitmap,<br>read FrameCount"]
LoadBmp --> Loop{"More frames<br>remaining?"}
Loop -->|Yes| AddPage["Add page, select<br>ActiveFrame, draw to<br>full page size"]
AddPage --> Debug[Write debug progress trace]
Debug --> Loop
Loop -->|No| Save["Save to MemoryStream,<br>close document"]
Save --> Return([Return PDF bytes])
Failure and edge-case behavior¶
- 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. - A large or many-frame TIFF is processed to completion with no page-count ceiling or timeout in this library.*
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\TiffConverter.cs