可用于:用户界面的ASP。NET MVC | 用户界面的ASP。净AJAX | Blazor用户界面 | WPF的用户界面 | WinForms的UI | Xamarin的UI | WinUI的用户界面 | 用户界面的ASP。网络核心 | .NET MAUI的用户界面

Telerik文档处理?下载30天免费试用

使用PdfFormatProvider

RadWordsProcessing提供了一个PdfFormatProvider类,该类允许您导出RadFlowDocumentPDF。

你所要做的就是使用PdfFormatProvider是向下面列出的程序集添加引用:

  • Telerik.Windows.Documents.Core.dll
  • Telerik.Windows.Documents.Flow.dll
  • Telerik.Windows.Zip.dll
  • Telerik.Windows.Documents.Flow.FormatProviders.Pdf.dll
  • Telerik.Windows.Documents.Fixed.dll

出口

为了将文档导出为PDF格式,您需要使用Export ()的方法PdfFormatProvider

net标准规范没有定义获取特定字体的api。PdfFormatProvider需要访问字体数据,以便读取它并将其添加到PDF文件中。的实现,以允许库创建和使用字体FontsProviderBase类,并将此实现设置为FontsProvider的属性FixedExtensibilityManager.有关详细信息,请查看跨平台的支持篇文章。

net标准:为了导出不同的图像Jpeg而且如Jpeg2000不同于High, theJpegImageConverter属性。FixedExtensibilityManager必须设置。的FixedExtensibilityManager中查看更多信息PdfProcessing的跨平台支持

中的代码片段示例1控件创建PdfFormatProvider实例并使用它导出RadFlowDocument到一个文件。

RadWordsProcessing的PdfFormatProvider类位于Telerik.Windows.Documents.Flow.FormatProviders.Pdf名称空间

例1:导出为PDF文件

Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider提供商= new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();使用(流输出= File.OpenWrite("sample.pdf")) {RadFlowDocument文档= CreateRadFlowDocument();提供者。出口(document, output); }

该方法的结果是一个可以在任何支持PDF文档的应用程序中打开的文档。

示例2控件的内容RadFlowDocument到一个RadFIxedDocument

例2:导出到RadFixedDocument

RadFlowDocument文档= CreateRadFlowDocument();Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider提供商= new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();RadFixedDocument fixedDocument = provider.ExportToFixedDocument(document);

RadFixedDocument类的基类RadPdfProcessing图书馆。关于这个库及其功能的更多信息可以在这里找到在这里

在本文中
Baidu
map