[SerializableAttribute ()]
[DataContractAttribute ()]
公共类RtfDocumentOptions:DocumentOptions
< DataContractAttribute () >
< SerializableAttribute () >
公共类RtfDocumentOptions
继承了DocumentOptions
@接口LTRtfDocumentOptions: LTDocumentOptions
公共类RtfDocumentOptions扩展DocumentOptions
[DataContractAttribute ()]
[SerializableAttribute ()]
公共ref类RtfDocumentOptions:公共DocumentOptions
中设置的选项RtfDocumentOptions类保存文档时,将使用DocumentFormat.Rtf格式。
要更改RTF格式使用的选项,请执行以下步骤:
的RtfDocumentOptions类包含以下属性:
财产 | 描述 |
---|---|
文本模式 | 控制如何以及何时为结果RTF文件中的文本块设置帧。 |
注意,这种格式不支持调用DocumentWriter。InsertPage.
本示例将使用各种受支持的选项创建一个新的超文本标记语言文档(RTF)文件。
使用Leadtools.Document.Writer;
使用Leadtools;
使用Leadtools.Codecs;
公共无效RtfDocumentOptionsExample ()
{
varinputFileName = Path.Combine(LEAD_VARS.ImagesDir,“Leadtools.pdf”);
varoutputFileName = Path.Combine(LEAD_VARS.ImagesDir,“Example.rtf”);
//设置一个新的RasterCodecs对象
var编解码器=新RasterCodecs ();
codecs.Options.RasterizeDocument.Load.Resolution = 300;
//获取输入文档的页数
varpageCount = codecs.GetTotalPages(inputFileName);
//创建一个新的LEADTOOLS Document Writer实例
vardocWriter =新DocumentWriter ();
//修改RTF选项
varrtfOptions = docWriter.GetOptions(DocumentFormat.Rtf)作为RtfDocumentOptions;
rtfOptions。文本模式=文档文本模式.汽车;
docWriter.SetOptions (DocumentFormat.Rtf rtfOptions);
//创建一个新的Rtf文档
控制台。WriteLine ("正在创建新的Rtf文档:{0}", outputFileName);
docWriter。BeginDocument (outputFileName DocumentFormat.Rtf);
//循环遍历所有页面
为(varpageNumber = 1;pageNumber <= pageCount;pageNumber + +)
{
//获取页面为SVG
控制台。WriteLine (“正在加载页面{0}”, pageNumber);
var页面=新DocumentWriterSvgPage ();
页面。SvgDocument = codecs。LoadSvg (inputFileName pageNumber,零);
//添加页面
控制台。WriteLine ("添加页面{0}", pageNumber);
docWriter.AddPage(页面);
page.SvgDocument.Dispose ();
}
//最终完成在磁盘上写入Rtf文件
docWriter.EndDocument ();
codecs.Dispose ();
}
静态类LEAD_VARS
{
公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;
}
进口Leadtools.Document.Writer
进口Leadtools
进口Leadtools。编解码器
公共子RtfDocumentOptionsExample ()
昏暗的inputFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Leadtools.pdf”)
昏暗的outputFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Example.rtf”)
’设置一个新的RasterCodecs对象
昏暗的编解码器作为新RasterCodecs ()
codecs.Options.RasterizeDocument.Load.Resolution = 300
'获取输入文档的页数
昏暗的pageCount作为整数= codecs.GetTotalPages (inputFileName)
创建一个新的LEADTOOLS Document Writer实例
昏暗的docWriter作为新DocumentWriter ()
更改RTF选项
昏暗的rtfOptions作为RtfDocumentOptions =DirectCast(docWriter.GetOptions (DocumentFormat.Rtf)、RtfDocumentOptions)
rtfOptions。文本模式=文档文本模式.汽车
docWriter.SetOptions (DocumentFormat.Rtf rtfOptions)
创建一个新的Rtf文档
控制台。WriteLine ("正在创建新的Rtf文档:{0}"outputFileName)
docWriter。BeginDocument (outputFileName DocumentFormat.Rtf)
循环浏览所有页面
为pageNumber作为整数= 1来pageCount
’获取SVG页面
控制台。WriteLine (“正在加载页面{0}”pageNumber)
昏暗的页面作为新DocumentWriterSvgPage ()
页面。SvgDocument = codecs。LoadSvg (inputFileName pageNumber,没有什么)
添加页面
控制台。WriteLine ("添加页面{0}"pageNumber)
docWriter.AddPage(页面)
page.SvgDocument.Dispose ()
下一个
'最后完成在磁盘上写入Rtf文件
docWriter.EndDocument ()
codecs.Dispose ()
结束子
公共NotInheritable类LEAD_VARS
公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”
结束类
帮助收藏
光栅net|C API|c++类库|HTML5 JavaScript
文档net|C API|c++类库|HTML5 JavaScript
医疗net|C API|c++类库|HTML5 JavaScript
医疗网页浏览器net
188宝金博怎么下载
支持的平台上
.NET、Java、Android和iOS/macOS程序集
C API/ c++类库
HTML5 JavaScript库
您的邮件已发送到支持!应该有人联系你!如果你的事情很紧急,请回来聊天。
聊天时间:
周一至周五,美国东部时间上午8:30至下午6:00
感谢您的反馈!
请再次填写表格开始新的聊天。
所有代理目前都离线。
聊天时间:
星期一至五
上午8:30 -下午6点
如需联系我们,请填写此表格,我们将通过电子邮件与您联系。