#ifndef _FS_CONVERT_C_H_
#define _FS_CONVERT_C_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "fx_basic_c.h"


typedef enum _FSHTML2PDFPageMode {
e_FSPageModeSinglePage  = 0,
e_FSPageModeMultiplePage = 1,
}FSHTML2PDFPageMode;



typedef enum _FSHTML2PDFScalingMode {
e_FSScalingModeNone  = 0,
e_FSScalingModeScale = 1,
e_FSScalingModeEnlarge = 2,
}FSHTML2PDFScalingMode;



typedef enum _FSHTML2PDFEncodingFormat {
e_FSEncodingFormatDefault  = 0,
e_FSEncodingFormatASCII = 1,
e_FSEncodingFormatLatin2 = 2,
e_FSEncodingFormatLatin3  = 3,
e_FSEncodingFormatLatin4 = 4,
e_FSEncodingFormatLatin5  = 5,
e_FSEncodingFormatLatin6 = 6,
e_FSEncodingFormatISO_8859_5 = 7,
e_FSEncodingFormatArabic = 8,
e_FSEncodingFormatGreek = 9,
e_FSEncodingFormatHebrew = 10,
e_FSEncodingFormatEUC_JP = 11,
e_FSEncodingFormatSJS  = 12,
e_FSEncodingFormatJIS = 13,
e_FSEncodingFormatBIG5 = 14,
e_FSEncodingFormatGB  = 15,
e_FSEncodingFormatEUC_CN = 16,
e_FSEncodingFormatKSC = 17,
e_FSEncodingFormatUnicode  = 18,
e_FSEncodingFormatEUC = 19,
e_FSEncodingFormatCNS = 20,
e_FSEncodingFormatBIG5_CP950  = 21,
e_FSEncodingFormatASCII_7_bit = 22,
e_FSEncodingFormatKOI8R = 23,
e_FSEncodingFormatCP852 = 24,
e_FSEncodingFormatCP866 = 25,
e_FSEncodingFormatCP874 = 26,
e_FSEncodingFormatCP932 = 27,
e_FSEncodingFormatCP1250  = 28,
e_FSEncodingFormatCP1251  = 29,
e_FSEncodingFormatCP1252 = 30,
e_FSEncodingFormatCP1253  = 31,
e_FSEncodingFormatCP1254 = 32,
e_FSEncodingFormatCP1255 = 33,
e_FSEncodingFormatCP1256  = 34,
e_FSEncodingFormatCP1257  = 35,
e_FSEncodingFormatKOI8U = 36,
e_FSEncodingFormatISO_8859_15 = 37,
e_FSEncodingFormatISO_8859_11 = 38,
e_FSEncodingFormatISO_8859_8_I = 39,
e_FSEncodingFormatVISUAL  = 40,
e_FSEncodingFormatCSN_369103 = 41,
e_FSEncodingFormatISO_8859_13 = 42,
e_FSEncodingFormatISO_2022_KR  = 43,
e_FSEncodingFormatGBK = 44,
e_FSEncodingFormatGB18030 = 45,
e_FSEncodingFormatBIG5_HKSCS  = 46,
e_FSEncodingFormatISO_2022_CN = 47,
e_FSEncodingFormatTSCII = 48,
e_FSEncodingFormatTAM  = 49,
e_FSEncodingFormatTAB = 50,
e_FSEncodingFormatJAGRAN = 51,
e_FSEncodingFormatMACINTOSH  = 52,
e_FSEncodingFormatUTF7 = 53,
e_FSEncodingFormatBHASKAR = 54,
e_FSEncodingFormatHTCHANAKYA  = 55,
e_FSEncodingFormatUTF_16BE = 56,
e_FSEncodingFormatUTF_16LE = 57,
e_FSEncodingFormatUTF_32BE  = 58,
e_FSEncodingFormatUTF_32LE = 59,
e_FSEncodingFormatX_BINARYENC = 60,
e_FSEncodingFormatHZ_GB_2312  = 61,
e_FSEncodingFormatX_UTF8UTF8 = 62,
e_FSEncodingFormatX_TAM_ELANGO = 63,
e_FSEncodingFormatX_TAM_LTTMBARANI = 64,
e_FSEncodingFormatX_TAM_SHREE = 65,
e_FSEncodingFormatX_TAM_TBOOMIS = 66,
e_FSEncodingFormatX_TAM_TMNEWS = 67,
e_FSEncodingFormatX_TAM_WEBTAMIL  = 68,
e_FSEncodingFormatX_KDDI_Shift_JIS = 69,
e_FSEncodingFormatX_DoCoMo_Shift_JIS = 70,
e_FSEncodingFormatX_SoftBank_Shift_JIS  = 71,
e_FSEncodingFormatX_KDDI_ISO_2022_JP = 72,
e_FSEncodingFormatX_SoftBank_ISO_2022_JP = 73,
}FSHTML2PDFEncodingFormat;



typedef enum _FSHTML2PDFMediaStyle {
e_FSMediaStyleScreen  = 0,
e_FSMediaStylePrint  = 1,
}FSHTML2PDFMediaStyle;


typedef struct _FSHTML2PDFSettingData {
  float page_width;
  float page_height;
  FS_BOOL is_to_page_scale;
  FSRectF page_margin;
  FSRotation rotate_degrees;
  FS_BOOL is_convert_link;
  FS_BOOL is_generate_tag;
  FSHTML2PDFPageMode page_mode;
  FS_BOOL to_generate_bookmarks;
  FSHTML2PDFScalingMode scaling_mode;
  FSHTML2PDFEncodingFormat encoding_format;
  FS_BOOL to_render_images;
  FS_BOOL to_remove_underline_for_link;
  FS_BOOL to_set_headerfooter;
  FS_WSTR headerfooter_title;
  FS_WSTR headerfooter_url;
  FS_WSTR bookmark_root_name;
  FS_BOOL to_resize_objects;
  FS_BOOL to_print_background;
  FS_BOOL to_optimize_tag_tree;
  FSHTML2PDFMediaStyle media_style;
  FS_BOOL to_load_active_content;
  FS_BOOL to_disable_sandbox;
  FS_BOOL to_use_blacklist;
  FS_BOOL to_hide_header;
  FS_BOOL to_hide_footer;
  FS_BOOL to_deny_local_file_access;
}FSHTML2PDFSettingData;

typedef struct _FSTXT2PDFSettingData {
  float page_width;
  float page_height;
  FSRectF page_margin;
  FS_FONT_HANDLE font;
  float text_size;
  FSDK_ARGB text_color;
  float linespace;
  FS_BOOL is_break_page;
}FSTXT2PDFSettingData;


typedef enum _FSDWG2PDFExportFlags {
e_FSFlagEmbededTTF = 0x0001,
e_FSFlagTTFTextAsGeometry = 0x0002,
e_FSFlagSHXTextAsGeometry = 0x0004,
e_FSFlagSimpleGeomOptimization = 0x0008,
e_FSFlagEnableLayers = 0x0010,
e_FSFlagIncludeOffLayers = 0x0020,
e_FSFlagEmbededOptimizedTTF = 0x0040,
e_FSFlagUseHLR = 0x0080,
e_FSFlagFlateCompression = 0x0100,
e_FSFlagASCIIHexEncoding = 0x0200,
e_FSFlagExportHyperlinks = 0x0400,
e_FSFlagZoomToExtentsMode = 0x0800,
e_FSFlagLinearized = 0x1000,
e_FSFlagMeasuring = 0x4000,
}FSDWG2PDFExportFlags;



typedef enum _FSDWG2PDFExportHatchesType {
e_FSDWG2PDFExportHatchesTypeBitmap  = 0,
e_FSDWG2PDFExportHatchesTypeDrawing  = 1,
e_FSDWG2PDFExportHatchesTypePdfPaths  = 2,
e_FSDWG2PDFExportHatchesTypePolygons  = 3,
}FSDWG2PDFExportHatchesType;



typedef enum _FSDWG2PDFSearchableTextType {
e_FSDWG2PDFSearchableTextTypeNoSearch  = 0,
e_FSDWG2PDFSearchableTextTypeSHX  = 1,
e_FSDWG2PDFSearchableTextTypeTTF  = 2,
}FSDWG2PDFSearchableTextType;



typedef enum _FSDWG2PDFColorPolicy {
e_FSDWG2PDFColorPolicyNoPolicy = 0,
e_FSDWG2PDFColorPolicyMono = 1,
e_FSDWG2PDFColorPolicyGrayscale = 2,
}FSDWG2PDFColorPolicy;


typedef struct _FSDWG2PDFProgressCallback {
  void* user_data;
  void (*Release)(void* user_data);
  void (*OnProgress)(void* user_data, const wchar_t* message, float progress);
}FSDWG2PDFProgressCallback;

typedef struct _FSDWG2PDFSettingData {
  FS_UINT32 export_flags;
  FSDWG2PDFExportHatchesType export_hatches_type;
  FSDWG2PDFExportHatchesType other_export_hatches_type;
  FSDWG2PDFExportHatchesType gradient_export_hatches_type;
  FSDWG2PDFSearchableTextType searchable_text_type;
  FS_BOOL is_active_layout;
  FS_WSTR output_title;
  FS_WSTR output_author;
  FS_WSTR output_subject;
  FS_WSTR output_keywords;
  FS_WSTR output_creator;
  FS_WSTR output_producer;
  float paper_width;
  float paper_height;
  FSDWG2PDFColorPolicy color_policy;
  FS_BOOL is_output_progress;
  void* progress_callback;
}FSDWG2PDFSettingData;


typedef enum _FSConvertOptimizeOption {
e_FSConvertOptimizeOptionForPrint  = 0,
e_FSConvertOptimizeOptionForOnScreen = 1,
}FSConvertOptimizeOption;



typedef enum _FSConvertContentOption {
e_FSConvertContentOptionOnlyContent  = 0,
e_FSConvertContentOptionWithMarkup = 1,
}FSConvertContentOption;



typedef enum _FSConvertBookmarkOption {
e_FSConvertBookmarkOptionNone  = 0,
e_FSConvertBookmarkOptionUseHeadings = 1,
e_FSConvertBookmarkOptionUseWordBookmark = 2,
}FSConvertBookmarkOption;


typedef struct _FSWord2PDFSettingData {
  FS_BOOL include_doc_props;
  FSConvertOptimizeOption optimize_option;
  FSConvertContentOption content_option;
  FSConvertBookmarkOption bookmark_option;
  FS_BOOL convert_to_pdfa;
  FS_BOOL disable_vba_code;
}FSWord2PDFSettingData;


typedef enum _FSConvertQuality {
e_FSConvertQualityStandard  = 0,
e_FSConvertQualityMinimum = 1,
}FSConvertQuality;



typedef enum _FSScaleType {
e_FSScaleTypeNone  = 0,
e_FSScaleTypeFitAllColumns = 1,
e_FSScaleTypeFitAllRows = 2,
e_FSScaleTypeFitSheet = 3,
}FSScaleType;


typedef struct _FSExcel2PDFSettingData {
  FS_BOOL include_doc_props;
  FSConvertQuality quality;
  FS_BOOL ignore_print_area;
  FSScaleType scale_type;
  FS_BOOL convert_to_pdfa;
  FS_BOOL disable_vba_code;
}FSExcel2PDFSettingData;


typedef enum _FSConvertIntent {
e_FSConvertIntentPrint  = 0,
e_FSConvertIntentScreen = 1,
}FSConvertIntent;



typedef enum _FSHandoutOrder {
e_FSHandoutOrderHorizontalFirst  = 0,
e_FSHandoutOrderVerticalFirst = 1,
}FSHandoutOrder;



typedef enum _FSOutputType {
e_FSOutputSlides = 1,
e_FSOutputNotesPages = 2,
e_FSOutputOutline = 3,
e_FSOutputOneSlideHandouts = 4,
e_FSOutputTwoSlideHandouts = 5,
e_FSOutputThreeSlideHandouts = 6,
e_FSOutputFourSlideHandouts = 7,
e_FSOutputSixSlideHandouts = 8,
e_FSOutputNineSlideHandouts = 9,
}FSOutputType;


typedef struct _FSPowerPoint2PDFSettingData {
  FSConvertIntent intent;
  FS_BOOL frame_output_slides;
  FSOutputType output_type;
  FSHandoutOrder handout_order;
  FS_BOOL output_hidden_slides;
  FS_BOOL include_doc_props;
  FS_BOOL disable_vba_code;
}FSPowerPoint2PDFSettingData;

typedef struct _FSHTML2PDFRelatedResource {
  FSReaderCallback* related_resource_file;
  FS_WSTR resource_file_relative_path;
}FSHTML2PDFRelatedResource;

typedef struct _FSOFDConvertParam {
  FS_BOOL is_embed_font;
}FSOFDConvertParam;


typedef enum _FSOffice2PdfEngine {
e_FSOffice2PdfEngineMicrosoft = 0,
e_FSOffice2PdfEngineWps = 1,
}FSOffice2PdfEngine;


FSErrorCode FSDK_Convert_FromHTML(const wchar_t* src_html, const wchar_t* engine_path, const wchar_t* cookies_path, const FSHTML2PDFSettingData setting_data, const wchar_t* saved_pdf_path, FS_INT32 timeout);
FSErrorCode FSDK_Convert_FromHTML0(const wchar_t* src_html, const wchar_t* engine_path, FSReaderCallback* cookies_reader, const FSHTML2PDFSettingData setting_data, const wchar_t* saved_pdf_path, FS_INT32 timeout);
FSErrorCode FSDK_Convert_FromHTML1(const wchar_t* src_html, const wchar_t* engine_path, FSReaderCallback* cookies_reader, const FSHTML2PDFSettingData setting_data, FSWriterCallback* saved_pdf_filestream, FS_INT32 timeout);
FSErrorCode FSDK_Convert_FromHTML2( FSReaderCallback* src_html, const FSHTML2PDFRelatedResource* related_resource_array, FS_UINT32 array_length_html2pdf_related_resource_array, const wchar_t* engine_path, FSReaderCallback* cookies_reader, const FSHTML2PDFSettingData setting_data, FSWriterCallback* saved_pdf_filestream, FS_INT32 timeout);
FSErrorCode FSDK_Convert_FromTXT(const wchar_t* src_txt, const wchar_t* saved_pdf_path, const FSTXT2PDFSettingData setting_data);
FSErrorCode FSDK_Convert_FromImage(const wchar_t* src_img, const wchar_t* saved_pdf_path);
FSErrorCode FSDK_Convert_FromImage0( FSReaderCallback* file_reader, FSWriterCallback* saved_pdf_filestream);
FSErrorCode FSDK_Convert_FromDWG(const wchar_t* engine_path, const wchar_t* src_dwg_path, const wchar_t* saved_pdf_path,
                       const FSDWG2PDFSettingData settings, FS_BOOL* return_value);
FSErrorCode FSDK_Convert_FromWord(const wchar_t* src_word_file_path, const wchar_t* src_file_password, const wchar_t* saved_pdf_path, const FSWord2PDFSettingData setting_data, FSOffice2PdfEngine engine);
FSErrorCode FSDK_Convert_FromExcel(const wchar_t* src_excel_file_path, const wchar_t* src_file_password, const wchar_t* saved_pdf_path, const FSExcel2PDFSettingData setting_data, FSOffice2PdfEngine engine);
FSErrorCode FSDK_Convert_FromPowerPoint(const wchar_t* src_ppt_file_path, const wchar_t* src_file_password, const wchar_t* saved_pdf_path, const FSPowerPoint2PDFSettingData setting_data, FSOffice2PdfEngine engine);
FSErrorCode FSDK_Convert_ToXML(const wchar_t* src_pdf_path, const wchar_t* src_file_password, const wchar_t* saved_xml_path, const wchar_t* saved_image_folder_path, FS_BOOL is_force_to_tagged_pdf, FS_BOOL* return_value);
FSErrorCode FSDK_Convert_FromOFD(const wchar_t* src_ofd_path, const wchar_t* password, const wchar_t* saved_pdf_file_path, FSOFDConvertParam convert_param, FS_BOOL* return_value);
FSErrorCode FSDK_Convert_ToOFD(const wchar_t* src_pdf_path, const wchar_t* password, const wchar_t* saved_ofd_file_path, FSOFDConvertParam convert_param, FS_BOOL* return_value);
#ifdef __cplusplus
}
#endif
#endif
