API List
Classification | API Name | Descriptions |
---|---|---|
Common | status | Inquires the status of conversion request using job, jobJson, jobFile, jobFileJson API. |
view | You can view the results of conversion completed in the viewer. | |
Image Conversion | title | Returns the sheet name of an Excel type document. |
dimension | Returns the size of image converted on the specified page. Unit: px | |
thumbnail | Returns the converted image on the specified page. You can inquire a specific area within the page. | |
thumbnailxml | Returns text area information contained in the page | |
HTML Conversion | xml | You can inquire the basic information of conversion results |
status
Only the GET type request is supported and the request is in the following URL pattern.
Request
Parameter | Descriptions | Remarks |
---|---|---|
key | Specifies the conversion request identifier in the response JSON at the time of response. |
Example:
GET {Server Address}/SynapDocViewServer/status/{key}
Response
Item | Value | Descriptions | Remarks |
---|---|---|---|
id | key | The request key value contained in the response to the job, jobJson, jobFile, jobFileJson request. | |
convertType | 0 / 1 | When requested, a value of a specified convertType is specified.
| If not specified, the default value set to the server will be returned |
format | String | A string that shows the file format is specified.
| |
filename | String | When requested, a specified file name is designate. | |
refererUrl | URL Text | When requested, a specified source URL value is designated. | |
downloadUrl | URL Text | When requested, the download URL value of a specified document is designated. | |
pageNum | 0 .. Number | The total number of pages in a document is specified. | |
imgDone | true / false | Image conversion completion status is specified. | |
imgErrCode | 0~255 | An error code confirmed at the time of image conversion error is specified. | Valid if the imgDone value is true. |
htmlDone | true / false | HTML conversion completion status is specified. | |
htmlErrCode | 0~255 | An error code confirmed at the time of HTML conversion error is specified. | Valid if the htmlDone value is true. |
pdfDone | true / false | ||
pdfErrCode | 0~255 | An error code confirmed at the time of PDF conversion error is specified. | Valid if the pdfDone value is true. |
skipError | true / false | You can set to ignore a conversion error generated from a specific page at the time of image conversion. | Valid if convType is set to IMAGE. |
htmlConverting | true / false | Returns HTML conversion progress state. |
Example:
{ "id":"2c9f8bcd58288e590158428252b30079", "convertType":1, "format":"PPTX", "fileName":"meetings.pptx", "refererUrl":"http://meeting.company.net", "downloadUrl":"http://meeting.company.net/download", "pageNum":4, "imgErrCode":0, "htmlErrCode":0, "pdfErrCode":0, "skipError":true, "htmlConverting":false, "outDirPath":"/data/SynapDocViewServer/out/66ae82d728ec629ea4b5d4b5e216854e", "resultFileName":"66ae82d728ec629ea4b5d4b5e216854e", "imgDone":true, "htmlDone":false, "pdfDone":false }
view
You can run the viewer using the view API after the conversion is completed. Only GET type request is supported, and the request is in the following URL pattern.
Request
Parameter | Descriptions | Remarks |
---|---|---|
key | Specifies the conversion request identifier in the response JSON at the time of response. |
Example:
GET {Server Address}/SynapDocViewServer/view/{key}
Response
The viewer is automatically run through the 302 response.
HTTP/1.1 302 Location: http://{Server Address}/SynapDocViewServer/viewer/doc.html?key={key}&contextPath=/SynapDocViewServer
title
After the conversion is completed, you can inquire the page name using the title API. Only GET type request is supported and the request is in the following URL pattern.
Returns a UTF-8 encoded page name and operates only at the time of converting IMAGE. Excel type document returns a sheet name and in case of a different file format,'page-page number' pattern is returned.
Request
Parameter | Descriptions | Remarks |
---|---|---|
key | Specifies the conversion request identifier in the response JSON at the time of response. | |
sheet_number | Specifies a sheet number. | Sheet number starts from 0. |
Example:
GET {Server Address}/SynapDocViewServer/title/{key}/{sheet_number}
Response
HTTP/1.1 200 Sheet1
dimension
You can inquire a page-specific size of a converted document. Depending on the document type, page or sheet size information is returned.
API only supports the GET type and requests in the following URL pattern. JSON type response is returned.
Request
Parameter | Descriptions | Remarks |
---|---|---|
key | Specifies the conversion request identifier in the response JSON at the time of response. | |
page_range | You can specify a page or range you want to inquire.
| Starts from 0. |
dpi | Specifies the reference dpi for converting a page size. Default value: M
| You can specify a value based on the number of server settings. |
Example:
GET {Server Address}/SynapDocViewServer/dimesion/{key}/{page_range}?dpi={dpi}
Response
The value expressed by the response is as follows. If specified in a range, it is converted into an array type.
Item | Value | Descriptions | Remarks |
---|---|---|---|
p | Integer | Page number/ Sheet number | |
w | Integer | Word type and PowerPoint type: page width | Unit : px |
h | Integer | Word type and PowerPoint type: page height | Unit : px |
[ {"p":0,"w":793,"h":1122}, {"p":1,"w":793,"h":1122}, {"p":2,"w":793,"h":1122}, {"p":3,"w":793,"h":1122} ]
thumbnail
Inquires a page-specific image in the converted document. You can inquire only a certain area in the page or sheet using API.
API only supports the GET type and requests in the following URL pattern.
For an Excel document containing a large sheet, as a case in which an image can't be loaded occurs, it is recommended to partially inquire by separating the sheet area.
Request
Parameter | Descriptions | Remarks |
---|---|---|
key | Specifies the conversion request identifier in the response JSON at the time of response. | |
page_number | Specifies a page number to inquire. | Starts from 0. |
dpi | Specifies the reference dpi for converting a page size. Default value: M
| You can specify a value based on the number of server settings. |
withXml | Determines whether to create text information in the page when creating a page image. Default value: true | |
x | Specifies the x coordinate at the top left of the image returned. Unit: px | For a Word or PowerPoint type document, the value is always fixed to 0. |
y | Specifies the y coordinate at the top left of the image returned. Unit: px | For a Word or PowerPoint type document, the value is always fixed to 0. |
w | Specifies the width of an image area returned. Unit: px | |
h | Specifies the height of an image area returned. Unit: px |
Example:
GET {Server Address}/SynapDocViewServer/thumbnail/{key}/{page_number}?dpi={dpi}&x={x}&y={y}&w={w}&h={h}
Response
Image data specified as HTTP response is returned.
thumbnailxml
Returns the text in the page of a converted document in an XML format. XML contains the position of text in the image.
API only supports the GET type and requests in the following URL pattern. JSON type response is returned.
Text information XML works property only when it is called after executing the thumbnail API with the withXml option set to true.
Request
Parameter | Descriptions | Remarks |
---|---|---|
key | Specifies the conversion request identifier in the response JSON at the time of response. | |
page_number | Specifies a page number to inquire. | Starts from 0. |
dpi | Specifies the reference dpi for converting a page size. Default value: M
| You can specify a value based on the number of server settings. |
Example:
GET {Server Address}/SynapDocViewServer/thumbnailxml/{key}/{page_number}?dpi={dpi}
Response
XML data specified as HTTP response is returned. XML that has the <document> element as a root is returned.
<document> <page w="793" h="1122"> <text l="274.559998" t="56.744122" w="35.093273" h="37.333332">입</text> <text l="312.000000" t="56.744122" w="10.453314" h="37.333332"></text> ...... </page> </document>
<page> element
Item | Value | Descriptions | Remarks |
---|---|---|---|
w | Integer | Word type and PowerPoint type: page width | Unit : px |
h | Integer | Word type and PowerPoint type: page height | Unit : px |
<text> element
Item | Value | Descriptions | Remarks |
---|---|---|---|
l | Number | x coordinate at the top left of the text area, unit: px | |
t | Number | y coordinate at the top left of the text area, unit: px | |
w | Number | Width of the text area, unit: px | |
h | Number | Width of the text area, unit: px |
xml
When converting into an HTML, you can inquire the basic information of the converted results in an XML format using the xml API after the conversion is completed. Only GET type is supported and the request is in the following URL pattern.
The response results are provided in a different pattern for each document format. For more information, you can check in the response item below.
Request
Parameter | Descriptions | Remarks |
---|---|---|
key | Specifies the conversion request identifier in the response JSON at the time of response. |
Example:
GET {Server Address}/SynapDocViewServer/xml/{key}
Response
Basic structure
XML is classified into common properties and type-specific elements. <index> element indicates the Root Element.
<index> <!-- common Property --> <!-- Type-specific Property --> </index>
Element information
Classification | Element name | Value | Descriptions | Remarks |
---|---|---|---|---|
Common | use_single_page | true / false | use_single_page option configured is specified at the time of HTML conversion. | Required |
file_name | String | File name is specified at the time of HTML conversion. | Required | |
file_type | String | A string that shows the file format is specified.
| Required Not case sensitive | |
doc_title | String | If extractable from the document, document title property is specified. | ||
downUrl | URL Text | Original copy download URL configured is specified at the time of HTML conversion. | ||
Word type | width | Number | Specifies the width of paper configured in the document. unit: pt | Applicable model
|
height | Number | Specifies the height of paper configured in the document. unit: pt | ||
margin_top | Number | Specifies the top margin value of paper configured in the document. unit: pt | ||
margin_bottom | Number | Specifies the bottom margin value of paper configured in the document. unit: pt | ||
margin_left | Number | Specifies the left margin value of paper configured in the document. unit: pt | ||
margin_right | Number | Specifies the right margin value of paper configured in the document. unit: pt | ||
filespage_cnt | Number | Number of HTML files classified per area or page is specified. | ||
word_cnt | - | - | Not used | |
word_list | - | - | Not used | |
PowerPoint type | width | Number | Specifies the width of paper configured in the document. unit: pt | Applicable model
|
height | Number | Specifies the height of paper configured in the document. unit: pt | ||
startPage | Integer | Configured value at the time of partial conversion is specified. This value may not be shown depending on the situation. | ||
endPage | Integer | Configured value at the time of partial conversion is specified. This value may not be shown depending on the situation. | ||
slide_cnt | Integer | The total number of slides contained in a document is specified. | ||
slide_list | slide element | Information of each slide, whose number is equal to the number of <slide_cnt>, is included as a sub <slide> element. | Please refer to the slide element properties section. | |
Excel type | sheet_cnt | Integer | The total number of sheets contained in a document is specified. | Target of application
|
sheet_list | sheet element | Information of each sheet, whose number is equal to the number of <sheet_cnt>, is included as a sub <sheet> element. | ||
startPage | Integer | Configured value at the time of partial conversion is specified. This value may not be shown depending on the situation. | Applicable model | |
endPage | Integer | Configured value at the time of partial conversion is specified. This value may not be shown depending on the situation. | ||
pdf_cnt | Integer | The total number of pages contained in a document is specified. | ||
pdf_list | pdf element | Information of each page, whose number is equal to the number of <pdf_cnt>, is included as a sub <pdf> element. | ||
이미지 | width | Integer | The width value of image is specified. unit:px | tiff / jpeg / png / gif / wmf / emf |
height | Integer | The height value of image is specified. unit:px | ||
image_cnt | Integer | The total number of images is specified. | ||
image_list | image element | Information of each image, whose number is equal to the number of <image_cnt>, is included as a sub <image> element. |
<slide> element property
Comprised of the following elements under the <slide_list> element.
Element name | Value | Descriptions | Remarks |
---|---|---|---|
id | Integer | Slide ID is specified. | Starts from 1. |
title | String | Slide title is specified. | |
path_html | String | HTML file path of the applicable slide is specified. | Used in the IE9 or below browser. |
path_xhtml | String | XHTML file path of the applicable slide is specified. | Used in the IE9 or higher browser, or a browser other than IE. |
<sheet> element property
Comprised of the following elements under the <sheet_list> element.
Element name | Value | Descriptions | Remarks |
---|---|---|---|
id | Integer | Sheet ID is specified. | Starts from 1. |
title | String | Sheet title is specified. | |
path_html | String | HTML file path of the applicable sheet is specified. | Used in the IE9 or below browser. |
path_xhtml | String | XHTML file path of the applicable sheet is specified. | Used in the IE9 or higher browser, or a browser other than IE. |
<pdf> element property
Comprised of the following elements under the <pdf_list> element.
Element name | Value | Descriptions | Remarks |
---|---|---|---|
id | Integer | Page number is specified. | Starts from 1. |
title | String | Page tile is specified. The format is expressed in Page + Page number. | |
path_html | String | HTML file path of the applicable page is specified. | Used in the IE9 or below browser. |
w | Number | The width value of page is specified. unit:pt | |
h | Number | The height value of page is specified. unit:pt |
<image> element property
Comprised of the following elements under the <image_list> element.
Element name | Value | Descriptions | Remarks |
---|---|---|---|
id | Integer | Image ID is specified. | Starts from 1. |
path_image | String | Image file path is specified. |
Example:
<index> <use_single_page>false</use_single_page> <file_name> <![CDATA[ d8db224556c5f651a8b0a945e310c86b ]]> </file_name> <file_type>jpeg</file_type> <width>810</width> <height>1440</height> <image_cnt>1</image_cnt> <image_list> <image> <id>1</id> <path_image> <![CDATA[ d8db224556c5f651a8b0a945e310c86b.files/d8db224556c5f651a8b0a945e310c86b.jpg ]]> </path_image> </image> </image_list> </index>