Skip to content

Create tracking metadata

This operation composes the file-name prefix convention that carries tracking metadata (application code, conversion type, imaging intent, and file id) across the PDF platform.

Field Value
Operation ID OP-12
Trigger Caller invokes PdfTrackingMetadata.Create(Guid fileId, string applicationCode = "AUTO", PdfConversionType conversionType = Convert, bool shouldBeImaged = false)
Inputs File id, application code, conversion type, imaging flag
Outputs Populated PdfTrackingMetadata with a composed FilePrefix
Primary components PdfAPI.Core.PdfTrackingMetadata.Create
Entry point PdfAPI.Core\PdfTrackingMetadata.cs

Steps

  1. Populate ApplicationCode (default "AUTO"), ConversionType, FileId, and ShouldBeImaged. (BR-31)
  2. Compose the file prefix: "A" when the conversion type is Convert, otherwise "M". (BR-32)
  3. Append "I" when the file should be imaged, otherwise "E". (BR-33)
  4. Append {applicationCode}_ and then the file id, and assign the result to FilePrefix. (BR-34)

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start(["Create(fileId, appCode,<br>conversionType, shouldBeImaged)"]) --> Populate["Populate fields<br>with defaults"]
    Populate --> Type{conversionType<br>== Convert?}
    Type -->|Yes| A["'A'"]
    Type -->|No| M["'M'"]
    A --> Imaged{shouldBeImaged?}
    M --> Imaged
    Imaged -->|Yes| I["append 'I'"]
    Imaged -->|No| E["append 'E'"]
    I --> Append["append appCode_fileId"]
    E --> Append
    Append --> Return([FilePrefix assigned])

Failure and edge-case behavior

  • No validation of fileId, applicationCode, or numeric overflow is performed during composition.

Sources

  • PdfAPI.Core\PdfTrackingMetadata.cs