- File Converter
- PDF to Markdown
Function Description
image/pdf to markdown
Upload images or pdfs for layout detection, text recognition, form recognition, seal detection, layout analysis and other operations, and generate markdown documents
Request URL
https://api.textin.ai/ai/service/v1/pdf_to_markdown
HTTP Request Method(Method)
HTTP POST
Request Header Description(Request Headers)
Please add the following custom headers (Header) in the HTTP request.
Header Name | Header Value |
---|---|
x-ti-app-id | Please log in and go to "Console - Account Settings - Developer Information" to view x-ti-app-id |
x-ti-secret-code | Please log in and go to "Console - Account Settings - Developer Information" to view x-ti-secret-code |
URL Parameters(Parameters)
URL Parameters refer to key-value pairs that are concatenated to the URL in the form of{parameter name}={parameter value}. It starts with
?
, and different parameters are connected using&
. For example,?p1=v1&p2=v2
parameter name | Data Type | Is Required | Allowed Values | Description |
---|---|---|---|---|
pdf_pwd | string | No | 见Description |
When the pdf is an encrypted document, you need to provide a password. Note: The front-end package of the interface, you need to secure the password yourself. |
page_start | integer | No | 见Description |
When the upload is a pdf, page_start indicates that the conversion starts from which page. |
page_count | integer | No | 见Description |
When the uploaded file is a pdf, page_count indicates the number of pdf pages to be converted. When not specified, the maximum conversion of the first 24 pages |
apply_document_tree | integer | No | 见Description |
Whether to generate a title
|
markdown_details | integer | No | 见Description |
Whether to generate markdown detials
|
Request Body Description(Request Body)
Content-Type: multipart/form-data
Binary byte stream of images/pdfs or support for Multi-Part format.
Response Body Description(Response)
Content-Type: application/json
Description of JSON structure as follows:
Field Name | Type | Description |
---|---|---|
code | integer | Error code, see "Error Code Description" for details. |
message | string |
error information |
result | object | |
+ detail | array |
markdown details |
++ page_id | integer |
Page number of current paragraph |
++ paragraph_id | integer |
current paragraph id |
++ outline_level | integer |
Heading level: (supports up to 5 levels of headings) -1.body 0.first level heading 1.second level heading |
++ text | string |
text |
++ type | string |
Types, including paragraph, image, table, 3 types; |
++ content | integer |
Type of content |
++ position | array | |
+ markdown | string |
markdown body string |
version | string |
doc_restore Engine Version |
duration | integer |
Engine elapsed time (ms) |