12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import 'package:ConversionFlutterDemo/models/convert_bean.dart';
- /// convert_contain_options_bean.dart
- ///
- /// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
- ///
- /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
- /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
- /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
- /// This notice may not be removed from this file.
- class ConvertOptionsBean {
- //The 'containImage' parameter is used when converting to ppt, word, excel、rtf、html format
- bool containImages;
- //The 'containImage' parameter is used when converting to ppt、word、excel、image、rtf、html format
- bool containAnnotations;
- //Only used when converting to excel
- ExcelWorkSheetOptions workSheetOptions;
- //Only used when converting to excel
- ContentOptions contentOptions = ContentOptions.AllContent;
- //Only used when converting to image, the limited range is 1~1000
- int imageDpi = 300;
- //Only used when converting to image
- ImagePageOptions imagePageOptions;
- //Only used when converting to csv
- bool mergeCSV = false;
- //Only used when converting to html
- HtmlPageOptions htmlPageOptions;
- ConvertOptionsBean(
- {this.containImages = true,
- this.containAnnotations = true,
- this.workSheetOptions = ExcelWorkSheetOptions.ForEachPage,
- this.contentOptions = ContentOptions.AllContent,
- this.imageDpi = 300,
- this.imagePageOptions = ImagePageOptions.PNG,
- this.mergeCSV = false,
- this.htmlPageOptions = HtmlPageOptions.SinglePage});
- ///You do not need to pass all the parameters below. Please pass them according to the format of the conversion.
- ///convert to ppt,word,rtf : containImages,containAnnotations
- ///convert to excel : containImages, containAnnotations, workSheetOptions, contentOptions
- ///convert to image : containAnnotations, imageDpi, imagePageOptions
- ///convert to csv : mergeCSV
- ///convert to html : containImages, containAnnotations, htmlPageOptions
- ///
- Map<String, String> getOptions(ConvertBean bean) {
- return {
- 'dataTag' : bean.tag,
- 'convertType' : bean.convertType,
- 'filePath' : bean.filePath,
- 'fileName' : bean.fileName,
- 'containImages': containImages.toString(),
- 'containAnnotations': containAnnotations.toString(),
- 'workSheetOptions' : workSheetOptions.name,
- 'contentOptions' : contentOptions.name,
- 'imageDpi' : imageDpi.toString(),
- 'imagePageOptions' : imagePageOptions.name,
- 'mergeCSV' : mergeCSV.toString(),
- 'htmlPageOptions' : htmlPageOptions.name
- };
- }
- }
- enum ExcelWorkSheetOptions { ForEachTable, ForEachPage, ForTheDocument }
- enum ContentOptions { OnlyText, OnlyTable, AllContent }
- enum ImagePageOptions {
- JPEG,
- PNG,
- }
- enum HtmlPageOptions {
- SinglePage,
- SinglePageNavigationByBookmark,
- MultiplePages,
- MultiplePagesSplitByBookmarks
- }
|