Page tree
Skip to end of metadata
Go to start of metadata

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.
For a Word or Slide type document, 'page-page number' is returned.

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:

Request 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.

  • 0 : HTML
  • 1 : IMAGE

If not specified, the default value set to the server will be returned

formatString

A string that shows the file format is specified.

  • DOC / DOCX / PPT / PPTX / XLS / XLSX / HWP / PDF

  • TIF / JPEG / PNG / GIF


filenameString

When requested, a specified file name is designate.


refererUrlURL Text

When requested, a specified source URL value is designated.


downloadUrlURL Text

When requested, the download URL value of a specified document is designated.


pageNum0 .. Number

The total number of pages in a document is specified.


imgDonetrue / false

Image conversion completion status is specified.


imgErrCode0~255

An error code confirmed at the time of image conversion error is specified.
0 : Normal

Valid if the imgDone value is true.

htmlDonetrue / false

HTML conversion completion status is specified.


htmlErrCode0~255

An error code confirmed at the time of HTML conversion error is specified.
0 : Normal

Valid if the htmlDone value is true.

pdfDonetrue / false

PDF conversion completion status is specified.


pdfErrCode0~255

An error code confirmed at the time of PDF conversion error is specified.
0 : Normal

Valid if the pdfDone value is true.

skipErrortrue / 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.

htmlConvertingtrue / false

Returns HTML conversion progress state.


Example:

Response 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:

Request Example
GET {Server Address}/SynapDocViewServer/view/{key}

Response

The viewer is automatically run through the 302 response.

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:

Request Example
GET {Server Address}/SynapDocViewServer/title/{key}/{sheet_number} 

Response

title 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.
You can specify a range using the '-' character. 

  • Specify page: 0 to number

  • Specify range: 1-10, 10-30

Starts from 0.

dpi

Specifies the reference dpi for converting a page size. Default value: M

  • L: 18 dpi

  • M: Value specified in the server settings

  • H: Double the value specified in the server settings

  • 1 ~ number: User defined value 

You can specify a value based on the number of server settings.

Example:

Request 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

pInteger

Page number/ Sheet number


wInteger

Word type and PowerPoint type: page width
Excel type: sheet width

Unit : px

hInteger

Word type and PowerPoint type: page height
Excel type: sheet height

Unit : px


dimension Response
[
	{"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

  • L: 18 dpi

  • M: Value specified in the server settings

  • H: Double the value specified in the server settings

  • 1 ~ number: User defined value

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:

Request 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

  • L: 18 dpi

  • M: Value specified in the server settings

  • H: Double the value specified in the server settings

  • 1 ~ number: User defined value 

You can specify a value based on the number of server settings.

Example:

Request 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.

thumbnailxml Response
<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

wInteger

Word type and PowerPoint type: page width
Excel type: sheet width

Unit : px

hInteger

Word type and PowerPoint type: page height
Excel type: sheet height

Unit : px

<text> element

Item

Value

Descriptions

Remarks

lNumber

x coordinate at the top left of the text area, unit: px


tNumber

y coordinate at the top left of the text area, unit: px


wNumber

Width of the text area, unit: px


hNumber

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:

Request 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.

Response Example
<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_typeString

A string that shows the file format is specified.

  • doc / docx / ppt / pptx / xls / xlsx
  • hwp2k / hwp97 / pdf / txt
  • tiff / jpeg / png / gif / wmf / emf

Required

Not case sensitive

doc_titleString

If extractable from the document, document title property is specified.


downUrlURL Text

Original copy download URL configured is specified at the time of HTML conversion.


Word type

widthNumber

Specifies the width of paper configured in the document. unit: pt

Applicable model

  • doc / docx / hwp2k / hwp97 / txt 
  • Not expressed if the use_single_page value is false.

     
heightNumber

Specifies the height of paper configured in the document. unit: pt

margin_topNumber

Specifies the top margin value of paper configured in the document. unit: pt

margin_bottomNumber

Specifies the bottom margin value of paper configured in the document. unit: pt

margin_leftNumber

Specifies the left margin value of paper configured in the document. unit: pt

margin_rightNumber

Specifies the right margin value of paper configured in the document. unit: pt

filespage_cntNumber

Number of HTML files classified per area or page is specified.

word_cnt--

Not used

word_list--

Not used

PowerPoint type

widthNumber

Specifies the width of paper configured in the document. unit: pt

Applicable model

  • ppt / pptx
heightNumber

Specifies the height of paper configured in the document. unit: pt

startPageInteger

Configured value at the time of partial conversion is specified. This value may not be shown depending on the situation.

endPageInteger

Configured value at the time of partial conversion is specified. This value may not be shown depending on the situation.

slide_cntInteger

The total number of slides contained in a document is specified.

slide_listslide 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_cntInteger

The total number of sheets contained in a document is specified.

Target of application

  • xls / xlsx
sheet_listsheet element

Information of each sheet, whose number is equal to the number of <sheet_cnt>, is included as a sub <sheet> element.

PDF


startPageInteger

Configured value at the time of partial conversion is specified. This value may not be shown depending on the situation.

Applicable model

  • pdf
endPageInteger

Configured value at the time of partial conversion is specified. This value may not be shown depending on the situation.

pdf_cntInteger

The total number of pages contained in a document is specified.

pdf_listpdf element

Information of each page, whose number is equal to the number of <pdf_cnt>, is included as a sub <pdf> element.

이미지widthInteger

The width value of image is specified. unit:px

tiff / jpeg / png / gif / wmf / emf

heightInteger

The height value of image is specified. unit:px


image_cntInteger

The total number of images is specified.


image_listimage 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_htmlString

HTML file path of the applicable slide is specified.

Used in the IE9 or below browser.

path_xhtmlString

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_htmlString

HTML file path of the applicable sheet is specified.

Used in the IE9 or below browser.

path_xhtmlString

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_htmlString

HTML file path of the applicable page is specified.

Used in the IE9 or below browser.

wNumber

The width value of page is specified. unit:pt


hNumber

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_imageString

Image file path is specified.



Example:

Response 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>
  • No labels