当前位置: 首页>>代码示例>>C#>>正文


C# IEngine.CreateFileExportParams方法代码示例

本文整理汇总了C#中IEngine.CreateFileExportParams方法的典型用法代码示例。如果您正苦于以下问题:C# IEngine.CreateFileExportParams方法的具体用法?C# IEngine.CreateFileExportParams怎么用?C# IEngine.CreateFileExportParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEngine的用法示例。


在下文中一共展示了IEngine.CreateFileExportParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Exporting_results_using_FlexiCapture_processor

        // USE CASE: Using built-in export tools
        public static void Exporting_results_using_FlexiCapture_processor( IEngine engine )
        {
            trace( "Prepare a sample document..." );
            IFlexiCaptureProcessor processor;
            IDocument document = PrepareNewRecognizedDocument( engine, out processor );
            IFileExportParams exportParams = engine.CreateFileExportParams();

            if( document.DocumentDefinition != null ) {
                // You can export data only in documents of known types
                trace( "Export the document using the settings from the Document Definition" );
                processor.ExportDocument( document, SamplesFolder + "\\FCEExport" );
                traceBegin( "Export the data to all supported file formats..." );

                    trace( "XML" );
                    exportParams.FileFormat = FileExportFormatEnum.FEF_XML;
                    processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToXML", exportParams );
                    trace( "XLS" );
                    exportParams.FileFormat = FileExportFormatEnum.FEF_XLS;
                    processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToXLS", exportParams );
                    trace( "CSV" );
                    exportParams.FileFormat = FileExportFormatEnum.FEF_CSV;
                    processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToCSV", exportParams );
                    trace( "DBF" );
                    exportParams.FileFormat = FileExportFormatEnum.FEF_DBF;
                    processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToDBF", exportParams );
                    trace( "TXT" );
                    exportParams.FileFormat = FileExportFormatEnum.FEF_Text;
                    processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToText", exportParams );
                traceEnd( "OK" );
            } else {
                // You can export unrecognized documents to all image formats or PDF (including searchable PDF)
                trace( "Unknown document type: Export as searchable PDF" );
                IFileExportParams pdfExportParams = engine.CreateFileExportParams();
                pdfExportParams.ImageExportParams.Format = ImageFileFormatEnum.IFF_Pdf;
                pdfExportParams.ImageExportParams.CreateSearchablePDF = true;
                pdfExportParams.ImageExportParams.PDFRecognitionLanguage = "English";
                processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToSearchablePDF", pdfExportParams );
            }

            traceBegin( "Export the page images to all supported image file formats..." );
                exportParams.FileFormat = FileExportFormatEnum.FEF_XML;
                exportParams.ExportOriginalImages = true;
                exportParams.ImageExportParams.OverwriteFiles = true;
                trace( "TIF" );
                exportParams.ImageExportParams.Format = FCEngine.ImageFileFormatEnum.IFF_Tif;
                processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToTIF", exportParams );
                trace( "JPG" );
                exportParams.ImageExportParams.Format = FCEngine.ImageFileFormatEnum.IFF_Jpg;
                exportParams.ImageExportParams.CompressionType = ImageCompressionTypeEnum.ICT_Jpeg;
                exportParams.ImageExportParams.ColorType = ImageColorTypeEnum.ICT_Color; // or ICT_Gray
                exportParams.ImageExportParams.FileAssemblingRule = ImageFileAssemblingRuleEnum.IFAR_FilePerImage;
                processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToJPG", exportParams );
                trace( "PNG" );
                exportParams.ImageExportParams.Format = FCEngine.ImageFileFormatEnum.IFF_Png;
                exportParams.ImageExportParams.CompressionType = ImageCompressionTypeEnum.ICT_Png;
                exportParams.ImageExportParams.FileAssemblingRule = ImageFileAssemblingRuleEnum.IFAR_FilePerImage;
                processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToPNG", exportParams );
                trace( "BMP" );
                exportParams.ImageExportParams.Format = FCEngine.ImageFileFormatEnum.IFF_Bmp;
                exportParams.ImageExportParams.CompressionType = ImageCompressionTypeEnum.ICT_Uncompressed;
                exportParams.ImageExportParams.FileAssemblingRule = ImageFileAssemblingRuleEnum.IFAR_FilePerImage;
                processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToBMP", exportParams );
                trace( "PDF" );
                exportParams.ImageExportParams.Format = FCEngine.ImageFileFormatEnum.IFF_Pdf;
                processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToPDF", exportParams );
                trace( "DCX" );
                exportParams.ImageExportParams.Format = FCEngine.ImageFileFormatEnum.IFF_Dcx;
                exportParams.ImageExportParams.CompressionType = ImageCompressionTypeEnum.ICT_PackBits;
                processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToDCX", exportParams );
                trace( "J2K" );
                exportParams.ImageExportParams.Format = FCEngine.ImageFileFormatEnum.IFF_J2k;
                exportParams.ImageExportParams.CompressionType = ImageCompressionTypeEnum.ICT_Jpeg;
                exportParams.ImageExportParams.ColorType = ImageColorTypeEnum.ICT_Color; // или ICT_Gray
                exportParams.ImageExportParams.FileAssemblingRule = ImageFileAssemblingRuleEnum.IFAR_FilePerImage;
                processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToJ2K", exportParams );
                trace( "PCX" );
                exportParams.ImageExportParams.Format = FCEngine.ImageFileFormatEnum.IFF_Pcx;
                exportParams.ImageExportParams.CompressionType = ImageCompressionTypeEnum.ICT_PackBits;
                exportParams.ImageExportParams.FileAssemblingRule = ImageFileAssemblingRuleEnum.IFAR_FilePerImage;
                processor.ExportDocumentEx( document, SamplesFolder + "\\FCEExport", "ExportToPCX", exportParams );
            traceEnd( "OK" );

            // NB: By default if the file exists the new data is appended to this file. It works fine in simple
            // scenarios but should be avoided if a lot of data is exported or in parallel processing scenarios.
            // A better solution to avoid bottlenecks would be to either use custom export or export every
            // document to a separate file with a unique name and consolidate data later elsewhere
        }
开发者ID:DominatorCode,项目名称:FlexiCapture-Code-Snippets--C--,代码行数:88,代码来源:Using+FlexiCapture+technology+API.cs


注:本文中的IEngine.CreateFileExportParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。