公共无效其(字符串文件名)
公共过载子其(_按值传递文件名作为字符串_)
macOS只有:- (BOOL)saveOptionsToFile:(NSString *)文件名错误:错误(NSError * *)
公共无效其(字符串文件名)
公共:无效其(字符串^文件名)
文件名
要保存选项的XML文件的名称。
方法保存到磁盘文件中的选项其(字符串)方法,使用LoadOptions(字符串).
若要将选项加载并保存到XML流而不是文件中,请使用LoadOptions(流)而且其(流).
将选项保存到XML文件中允许以所需的方式设置一次选项,然后在多个会话(或多个会话)中重用这些选项DocumentWriter实例)。工具所支持的每种文档格式都包含额外的功能和选项GetOptions而且setoption方法。有关更多信息,请参阅DocumentOptions.
将以下选项保存到XML文件中:
将以下选项保存到XML文件中:
属性中的一些选项DocumentWriter对象,将它们保存到磁盘,然后在新实例中重新加载它们。
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.Document.Writer;使用Leadtools.Ocr;公共无效DocumentOptionsDiskExample (){varxmlFileName = Path.Combine(LEAD_VARS.ImagesDir,“DocumentWriterOptions.xml”);//创建一个新的LEADTOOLS Document Writer实例vardocWriter1 =新DocumentWriter ();//显示之前默认的PDF和HTML选项ShowOptions (docWriter1的默认选项, docWriter1);//更改PDF选项和HTML选项varpdfOptions = docWriter1.GetOptions(DocumentFormat.Pdf)作为PdfDocumentOptions;pdfOptions。文档Type = PdfDocumentType.PdfA;pdfOptions。ImageOverText =真正的;docWriter1.SetOptions (DocumentFormat.Pdf pdfOptions);varhtmlloptions = docWriter1.GetOptions(DocumentFormat.Html)作为HtmlDocumentOptions;htmlOptions。UseBackgroundColor =真正的;htmlOptions。BackgroundColor = RasterColor.FromKnownColor(RasterKnownColor.LightBlue);docWriter1.SetOptions (DocumentFormat.Html htmlOptions);//再次显示选项ShowOptions (" docWriter1的新选项", docWriter1);//保存这些选项到磁盘docWriter1.SaveOptions (xmlFileName);//创建一个新的DocumentWriter对象vardocWriter2 =新DocumentWriter ();//显示它的选项,应该是默认值ShowOptions (docWriter2的默认选项, docWriter2);//将选项从磁盘加载到该对象docWriter2.LoadOptions (xmlFileName);//现在显示选项,应该是保存的选项ShowOptions (从XML文件加载后的docWriter2选项, docWriter2);}私人无效ShowOptions (字符串docWriter (docWriter){Console.WriteLine(消息);varpdfOptions = docWriter.GetOptions(DocumentFormat.Pdf)作为PdfDocumentOptions;控制台。WriteLine (" PDF选项");控制台。WriteLine (" DocumentType: "+ pdfOptions.DocumentType);控制台。WriteLine (" FontEmbedMode: "+ pdfOptions.FontEmbedMode);控制台。WriteLine (ImageOverText: "+ pdfOptions.ImageOverText);varhtmlloptions = docWriter.GetOptions(DocumentFormat.Html)作为HtmlDocumentOptions;控制台。WriteLine (" HTML选项:");控制台。WriteLine (" DocumentType: "+ htmlOptions.DocumentType);控制台。WriteLine (" FontEmbedMode: "+ htmlOptions.FontEmbedMode);控制台。WriteLine (" UseBackgroundColor: "+ htmlOptions.UseBackgroundColor);控制台。WriteLine (" BackgroundColor: "+ htmlOptions.BackgroundColor);控制台。WriteLine ("-------------------------");}静态类LEAD_VARS{公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;}
进口Leadtools进口Leadtools。编解码器进口Leadtools.Document.Writer进口Leadtools。光学字符识别公共子DocumentOptionsDiskExample ()昏暗的xmlFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“DocumentWriterOptions.xml”)创建一个新的LEADTOOLS Document Writer实例昏暗的docWriter1作为新DocumentWriter ()之前显示默认的PDF和HTML选项ShowOptions (docWriter1的默认选项docWriter1)更改PDF选项和HTML选项昏暗的pdfOptions作为PdfDocumentOptions =DirectCast(docWriter1.GetOptions (DocumentFormat.Pdf)、PdfDocumentOptions)pdfOptions。文档Type = PdfDocumentType.PdfApdfOptions。ImageOverText =真正的docWriter1.SetOptions (DocumentFormat.Pdf pdfOptions)昏暗的htmlOptions作为HtmlDocumentOptions =DirectCast(docWriter1.GetOptions (DocumentFormat.Html)、HtmlDocumentOptions)htmlOptions。UseBackgroundColor =真正的htmlOptions。BackgroundColor = RasterColor.FromKnownColor(RasterKnownColor.LightBlue)docWriter1.SetOptions (DocumentFormat.Html htmlOptions)“再显示一遍选项ShowOptions (" docWriter1的新选项"docWriter1)将这些选项保存到磁盘docWriter1.SaveOptions (xmlFileName)创建一个新的DocumentWriter对象昏暗的docWriter2作为新DocumentWriter ()'显示它的选项,应该是默认值ShowOptions (docWriter2的默认选项docWriter2)'将选项从磁盘加载到此对象docWriter2.LoadOptions (xmlFileName)“现在显示选项,应该是保存的选项ShowOptions (从XML文件加载后的docWriter2选项docWriter2)结束子私人子ShowOptions(消息作为字符串, docWriter作为DocumentWriter)Console.WriteLine(消息)昏暗的pdfOptions作为PdfDocumentOptions =DirectCast(docWriter.GetOptions (DocumentFormat.Pdf)、PdfDocumentOptions)控制台。WriteLine (" PDF选项")控制台。WriteLine (" DocumentType: "+ pdfOptions.DocumentType.ToString ())控制台。WriteLine (" FontEmbedMode: "+ pdfOptions.FontEmbedMode.ToString ())控制台。WriteLine (ImageOverText: "+ pdfOptions.ImageOverText.ToString ())昏暗的htmlOptions作为HtmlDocumentOptions =DirectCast(docWriter.GetOptions (DocumentFormat.Html)、HtmlDocumentOptions)控制台。WriteLine (" HTML选项:")控制台。WriteLine (" DocumentType: "+ htmlOptions.DocumentType.ToString ())控制台。WriteLine (" FontEmbedMode: "+ htmlOptions.FontEmbedMode.ToString ())控制台。WriteLine (" UseBackgroundColor: "+ htmlOptions.UseBackgroundColor.ToString ())控制台。WriteLine (" BackgroundColor: "+ htmlOptions.BackgroundColor.ToString ())控制台。WriteLine ("-------------------------")结束子公共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点
如需与我们联系,请填写此表格,我们将通过电子邮件与您联系。
