Parse tracking metadata¶
This operation reverses Create tracking metadata by decoding a file-name prefix back into a structured PdfTrackingMetadata instance. A known regex-capture-group defect means imaging intent and conversion type are never correctly recovered.
| Field | Value |
|---|---|
| Operation ID | OP-13 |
| Trigger | Caller invokes PdfTrackingMetadata.Parse(string prefix) |
| Inputs | Tracking prefix string |
| Outputs | Populated PdfTrackingMetadata, or null |
| Primary components | PdfAPI.Core.PdfTrackingMetadata.Parse |
| Entry point | PdfAPI.Core\PdfTrackingMetadata.cs |
Steps¶
- Match the prefix against
(?<filePrefix>(?<type>.{1})(?<import>.{1})(?<appCode>[^_]+)_(?<fileId>[^\.+_]+))(_(?<fileIndex>\d+))?. (BR-35) - Return
nullwhen the pattern does not match. (BR-36) - On a match, populate
FilePrefix,ApplicationCode, andFileId(parsed as aGuid). (BR-35) - Set
ShouldBeImagedfrom groupimportTypeandConversionTypefrom groupconversionType. (BR-37) - This step reads capture groups named
importTypeandconversionType, but the pattern in step 1 names themimportandtype. Both lookups therefore always return an empty string, soParsealways yieldsShouldBeImaged = falseandConversionType = Convertregardless of the prefix — a defect in live (non-commented) code, not an inference: the group names do not match. (BR-37)
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["Parse(prefix)"]) --> Match{Matches tracking<br>prefix pattern?}
Match -->|No| Null([Return null])
Match -->|Yes| Populate["Populate FilePrefix,<br>ApplicationCode, FileId"]
Populate --> Groups["Read importType/conversionType<br>groups (mismatched names)"]
Groups --> Defect["ShouldBeImaged = false,<br>ConversionType = Convert (always)"]
Defect --> Return([Return PdfTrackingMetadata])
Failure and edge-case behavior¶
- The capture-group mismatch in step 4 means any workflow relying on round-tripping imaging intent or conversion type through the file-name prefix silently loses that data (BR-37).
- A prefix that does not match the pattern returns
nullrather than throwing (BR-36).
Related documentation¶
Sources¶
PdfAPI.Core\PdfTrackingMetadata.cs