Skip to content

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

  1. Choose conformance (Pdf_A1B / None) and create the PdfDocument (BR-SFC-011).
  2. Set doc.PageSettings.Margins.All = 0 (BR-SFC-018).
  3. Load the stream as a PdfBitmap and read FrameCount.
  4. For each frame index 0..FrameCount-1: add a page, select the frame via ActiveFrame, and draw it to the full page client size (BR-SFC-019, BR-SFC-017).
  5. Write a percentage-complete line to System.Diagnostics.Debug for each frame — a debug-only progress trace, not application logging.
  6. 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 PdfResult rather than propagated here.
  • A large or many-frame TIFF is processed to completion with no page-count ceiling or timeout in this library.*

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