Relationship Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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; }Public Property Relationship As StringExamples
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);Dim embeddedFile As New EmbeddedFile("terms.pdf", "Attachments\terms.pdf", "application/pdf")
embeddedFile.Relationship = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
If Not String.IsNullOrWhiteSpace(embeddedFile.Relationship) Then
Console.WriteLine($"Relationship: {embeddedFile.Relationship}")
End If
Dim saveSettings As New SaveSettings() With { .EmbeddedFiles = New EmbeddedFile() { embeddedFile } }
textControl.Save("contract-with-attachment.docx", StreamType.WordprocessingML, saveSettings)