Back to Devexpress

DocumentExporterOptions.TargetUri Property

officefileapi-devexpress-dot-xtrarichedit-dot-export-dot-documentexporteroptions.md

latest5.2 KB
Original Source

DocumentExporterOptions.TargetUri Property

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Gets or sets the URI of the document being exported.

Namespace : DevExpress.XtraRichEdit.Export

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
[Browsable(false)]
public string TargetUri { get; set; }
vb
<Browsable(False)>
Public Property TargetUri As String

Property Value

TypeDescription
String

A string representing the document URI.

|

Remarks

You may wish to specify the TargetUri value when exporting the document to formats that require saving certain content as separate objects, such as the HTML format with images and css files. Handle the RichEditControl.BeforeExport or RichEditDocumentServer.BeforeExport event to get access to exporter options and specify the TargetUri as the location for external files.

View Example

The following code snippets (auto-collected from DevExpress Examples) contain references to the TargetUri property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-save-text-from-a-range-in-different-formats/CS/GetTextMethodsExample/Form1.cs#L252

csharp
options.HtmlNumberingListExportFormat = DevExpress.XtraRichEdit.Export.Html.HtmlNumberingListExportFormat.HtmlFormat;
    options.TargetUri = Path.GetFileNameWithoutExtension(this.fileName);
}

word-document-api-examples/CS/CodeExamples/ExportActions.cs#L150

csharp
options.HtmlNumberingListExportFormat = HtmlNumberingListExportFormat.HtmlFormat;
    options.TargetUri = "Document_HTML.html";
}

word-processing-customize-html-export/CS/Program.cs#L68

csharp
options.CssPropertiesExportType = cssExportType;
options.TargetUri = Path.GetFileNameWithoutExtension(fileName);
Document document = wordProcessor.Document;

winforms-richedit-save-text-from-a-range-in-different-formats/VB/GetTextMethodsExample/Form1.vb#L192

vb
options.HtmlNumberingListExportFormat = DevExpress.XtraRichEdit.Export.Html.HtmlNumberingListExportFormat.HtmlFormat
    options.TargetUri = Path.GetFileNameWithoutExtension(Me.fileName)
End If

word-document-api-examples/VB/CodeExamples/ExportActions.vb#L134

vb
options.HtmlNumberingListExportFormat = Html.HtmlNumberingListExportFormat.HtmlFormat
    options.TargetUri = "Document_HTML.html"
End If

word-processing-customize-html-export/VB/Program.vb#L66

vb
options.CssPropertiesExportType = cssExportType
options.TargetUri = Path.GetFileNameWithoutExtension(fileName)
Dim document As Document = wordProcessor.Document

Implements

TargetUri

See Also

BeforeExport

DocumentExporterOptions Class

DocumentExporterOptions Members

DevExpress.XtraRichEdit.Export Namespace