Skip to content

PdfTrackingMetadata

PdfTrackingMetadata encodes and decodes the file-name prefix convention that carries application code, conversion type, and imaging intent alongside a tracked document's file id. Its Parse method contains a capture-group naming defect that means round-tripped conversion type and imaging intent are never correctly recovered. (BR-37)

Purpose

  • Composes a file-name prefix encoding application code, conversion type, imaging intent, and file id, via Create tracking metadata.
  • Decodes a file-name prefix back into structured metadata, via Parse tracking metadata — though this decoding is defective for conversion type and imaging intent. (BR-37)

Context

  • Namespace: PdfAPI.Core
  • Assembly/package: PdfAPI.Core

Public members

Member Signature Purpose
ApplicationCode string ApplicationCode { get; set; } The application code segment of the tracking prefix. (BR-31)
FileId Guid FileId { get; set; } The tracked file's identity, embedded in the prefix.
ShouldBeImaged bool ShouldBeImaged { get; set; } Whether the file should be imaged; encoded as I/E in the prefix. (BR-33)
ConversionType PdfConversionType ConversionType { get; set; } The conversion type; encoded as A/M in the prefix. (BR-32)
FilePrefix string FilePrefix { get; set; } The composed file-name prefix string. (BR-34)
Create(Guid, string, PdfConversionType, bool) static PdfTrackingMetadata Create(Guid fileId, string applicationCode = "AUTO", PdfConversionType conversionType = Convert, bool shouldBeImaged = false) Builds a new metadata instance and composes its FilePrefix. (BR-31, BR-32, BR-33, BR-34)
Parse(string) static PdfTrackingMetadata Parse(string prefix) Decodes a tracking prefix into a metadata instance, or returns null when the prefix does not match. (BR-35, BR-36, BR-37)

Behavioral notes

  • Parse always yields ShouldBeImaged = false and ConversionType = Convert regardless of the actual prefix content, because the regex capture groups it reads (importType, conversionType) do not match the groups the pattern defines (import, type). This is a defect in live code, not an inference. (BR-37)

Constraints and usage notes

  • Do not rely on Parse to recover ShouldBeImaged or ConversionType from a prefix produced by Create; only ApplicationCode and FileId round-trip correctly. (BR-37)

Sources

  • PdfAPI.Core\PdfTrackingMetadata.cs