TX Text Control .NET Server

Relationship Property

Property|Introduced in 29.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

PDF/A only. Gets or sets an optional string describing the relationship of the embedded file and the containing document. This string can be a predefined value or should follow the rules for second-class names (ISO 32000-1, Annex E). Predefined values are "Source", "Data", "Alternative", "Supplement" or "Unspecified". It is null, if a relationship string is not available.

Syntax

public string Relationship { get; set; }

Examples

The following example configures a PDF attachment before embedding it in a WordprocessingML document by using EmbeddedFile.Relationship.

EmbeddedFile embeddedFile = new("terms.pdf", @"Attachments\terms.pdf", "application/pdf");

embeddedFile.Relationship = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
if (!string.IsNullOrWhiteSpace(embeddedFile.Relationship))
{
    Console.WriteLine($"Relationship: {embeddedFile.Relationship}");
}

SaveSettings saveSettings = new() { EmbeddedFiles = new[] { embeddedFile } };
textControl.Save("contract-with-attachment.docx", StreamType.WordprocessingML, saveSettings);

Further Reading