Skip to content
Guides

File Conversion and Document AI API

Upload the source file and process it. The executeType field is used to specify the file processing method, and the parameter field is used to pass a JSON string to set the processing parameters for the file.

Request Method

  • Request Method:POST
  • Parameter Passing Method:Body (form-data)

Request Address

sh
http://localhost:7000/file/handle

Request Parameters

Parameter NameData TypeDescriptionRequired
fileFileThe uploaded file.Yes
executeTypeStringType of file execution, e.g., docx/pdf.Yes
passwordStringPassword to open the file.No
languageIntegerInterface error prompt language (1 = English, 2 = Chinese).No
parameterStringFile processing parameters.No
resultFileNameStringName for the returned downloadable file.No
filesArrayUploaded files for merging PDFs.No
parametersArrayParameters for PDF processing (for merging PDFs).No
imageFileImage files for adding watermarks.No

The Parameter field is only applicable to functionalities that currently support setting processing parameters. If no parameters are set, default values will be used. For the specific JSON format content and parameter field explanations corresponding to different functionality types, please refer to the Conversion Tool Guide.

Currently supported types for executeType include:

TypeDescription
pdf/docxConvert PDF file to Word (.docx) document.
pdf/xlsxConvert PDF file to Excel (.xlsx) document.
pdf/pptxConvert PDF file to PowerPoint (.pptx) document.
pdf/txtConvert PDF file to TXT (.txt) document.
pdf/pngConvert PDF file to PNG (.zip) document.
pdf/jpgConvert PDF file to JPG (.zip) document.
pdf/csvConvert PDF file to CSV (.zip || .csv) document.
pdf/htmlConvert PDF file to HTML (.zip) document.
pdf/rtfConvert PDF file to RTF (.RTF) document.
doc/pdfConvert Word (.doc) file to PDF document.
docx/pdfConvert Word (.docx) file to PDF document.
xls/pdfConvert Excel (.xls) file to PDF document.
xlsx/pdfConvert Excel (.xlsx) file to PDF document.
ppt/pdfConvert PowerPoint (.ppt) file to PDF document.
pptx/pdfConvert PowerPoint (.pptx) file to PDF document.
txt/pdfConvert TXT (.txt) file to PDF document.
png/pdfConvert Image (.png) file to PDF document.
JPG/pdfConvert Image (.png) file to PDF document.
html/pdfConvert HTML (.html) file to PDF document.
rtf/pdfConvert RTF (.rtf) file to PDF document.
csv/pdfConvert CSV (.csv) file to PDF document.
tiff/pdfConvert TIFF (.tif) file to PDF document.
pdf/splitSplit PDF documents.
pdf/mergeMerge multiple PDF documents into one PDF.
pdf/deleteDelete specific PDF pages.
pdf/extractExtract specific PDF pages.
pdf/rotationRotate specific PDF pages.
pdf/insertInsert blank pages in front of or behind a specified PDF page.
pdf/addWatermarkAdd watermarks.
pdf/delWatermarkRemove watermarks.
documentAI/ocrOCR.
documentAI/magicColorImage Sharpening Enhancement.
documentAI/tableRecForm Recognizer.
documentAI/layoutAnalysisLayout Analysis.
documentAI/dewarpTrim Correction.
documentAI/detectionStampStamp Inspection.