RichEditDocumentXpfPrinter.CreateFixedDocument(IRichEditDocumentServer) Method
Creates a fixed document from the given control’s document.
Namespace: DevExpress.Xpf.RichEdit
Assembly: DevExpress.Xpf.RichEdit.v24.1.dll
NuGet Package: DevExpress.Wpf.RichEdit
Declaration
Parameters
Name | Type | Description |
---|---|---|
server | IRichEditDocumentServer | An object exposing the IRichEditDocumentServer interface that is the target document. |
Returns
Type | Description |
---|---|
FixedDocument | A FixedDocument instance that is the fixed document. |
Example
RichEditDocumentServer srv = new RichEditDocumentServer();
srv.LoadDocument("test.docx");
FixedDocument document = RichEditDocumentXpfPrinter.CreateFixedDocument(srv);
PrintDialog pDialog = new PrintDialog();
PrintQueueCollection queues = new PrintServer().GetPrintQueues(new[] { EnumeratedPrintQueueTypes.Local,
EnumeratedPrintQueueTypes.Connections});
System.Collections.IEnumerator localPrinterEnumerator = queues.GetEnumerator();
PrintQueue printQueue = null;
do
{
if (!localPrinterEnumerator.MoveNext())
break;
printQueue = (PrintQueue)localPrinterEnumerator.Current;
}
while (!printQueue.FullName.Contains("Canon"));
if (printQueue != null)
{
pDialog.PrintQueue = printQueue;
pDialog.PrintDocument(document.DocumentPaginator, string.Empty);
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateFixedDocument(IRichEditDocumentServer) method.
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.