PPTLOOK online document conversion API helps to convert your documents to html format so as to be embedded in website, thirt-party app, blogger and conversation, which makes your article and presentation (animation enabled) much easier to be read and understood.
The conversion result can be kept on our website for easy sharing and also can be downloaded to your website for further develop. More details about powerpoint slides are clarified for operation. By invoking our js API, you can wrap the result html to be a well-formed online courseware.
The price for API conversation is $0.01/perslide. You will get $10 for first apply.
Upload local file
Upload file from local system to convert
https://www.pptlook.com/api/uploadfile.php?token={token}¶meters
curl -F doc=@"fox.pptx" "http://www.pptlook.com/api/uploadfile.php?token=123456&mode=-8&fn=filename.pptx"
token | Unique user identification. Got from account page | |
doc | Local file address | |
mode | Conversion mode. Reserved. | |
fn | Optional | Used in html title, as converted file name. If this parameter is used, please add the same file extension as the orignal file. |
Success | ok:{uuid}, Example: "ok:de0ec0eeb2dd0f4412a57411edaafb9a" | |
Fail | Err:{error reason} |
Upload Web File
For file which is able to be accessed from web, delivery the url to convert
POST https://www.pptlook.com/api/uploadurl.php?token={token}&Parameters
curl -d "url=http://www.test.com/2014/2014.pptx" "https://www.pptlook.com/api/uploadurl.php?token=123456&mode=-8&fn=filename.pptx"
token | Unique user identification. Got from account page | |
url | Web address | |
mode | Conversion mode. Reserved. | |
fn | Optional | Used in html title, as converted file name. If this parameter is used, please add the same file extension as the orignal file. |
Success | ok:{uuid}, Example: "ok:de0ec0eeb2dd0f4412a57411edaafb9a" | |
Fail | Err:{error reason} |
Download Result
Download result zip file to local system or user's web server. Unzip and run index html to play.
https://www.pptlook.com/api/export.php?token={token}&id={uuid}
curl "https://www.pptlook.com/api/export.php?token=123456&id=de0ec0eeb2dd0f4412a57411edaafb9a"
token | Unique user identification. Got from account page | |
id | UUID of target file |
Success | File zip package downloaded. | |
Fail | Error reason which is shorter than 64 bytes will be given. |
Conversion result callback
Because the conversion takes a certain amount of time, which is difficult to estimate. We need a callback interface. When the conversion is complete, our software will send the corresponding information to this interface. You can then call download API to get result zip based on the success or failure of the conversion.
This callback address can be filled in account page.
Your callback Address[?|&]uuid={uuid}&suc={0|1}&tick={conversion}&page={pagenum}
uuid | UUID of target file | |
suc | 0 represents success,non-zero represents failure |
Conversion status
Normally it takss 1~3 minutes to convert a file. If there is no callback for a long time, call this interface to get conversion status.
https://www.pptlook.com/api/querytask.php?token={token}&id={uuid}
curl "https://www.pptlook.com/api/querytask.php?token=123456&id=de0ec0eeb2dd0f4412a57411edaafb9a"
token | Unique user identification. Got from account page | |
id | UUID of target file |
Status | Return value is a number. Its meaning as follows: 0, Waiting for process 10, In conversion 20, Conversion finished. 21, Conversion failed. 30, Conversion fininshed, and callback url has been pinged 31, Conversion fininshed, and callback url has been pinged 40 or above, conversion failed or task deleted. |
Delete task
In default, task files will be deleted between 24~48 hours. If you want to delete task files immediately, call this api.
https://www.pptlook.com/api/deletetask.php?token={token}&id={uuid}
curl "https://www.pptlook.com/api/deletetask.php?token=123456&id=de0ec0eeb2dd0f4412a57411edaafb9a"
token | Unique user identification. Got from account page | |
id | UUID of target file |
Return operation message | Message of the operation result. |
Although we support both Powerpoint file and PDF/DOC file formats, the latter will be displayed as normal article and need not many operations. This part is only relative to powerpoint slides. It describes our data structure of information collected from slide, and javascript functions that we provide to manipulate the data.
Global Variables
_note | Array. Each unit is a string for a note slide. | |
_control | Array. Each unit is an object that contains animation data for one slide. | |
slidetext | Array. Each unit is an array of strings, which records shape ids and shape texts for easy searching. | |
cs | Currently active slide id | |
_playmode | Playmode. By setting it, you can control how it plays:
0x0: As normal 0x01: Reserved. 0x02: Reserved. 0x10: Reserved. 0x20: Reserved. 0x40: Auto-play |
|
_replayFromEnd | If it is set, slides will be playback from beginning after it reaches the end. | |
wtnoeff | If it is set, animations will be finished immediately. This variable is used when you need to go fast forward to certain position. | |
wtSkipMouse | If it is set, mouse events are temporarily neglected so that user dialog interaction will not affect the player. | |
enable_link | If it is set, users can visit other weblink by hyperlink inside the slides. In default, it is set to 0 for safe. | |
user_control | If it is set to 1, the slides will not interact with user operation. Developers will handle slides show by call relative functions. If it is set to 0, player will go to next animation by clicking. If it is set to -1, the player will divide the screen to 4 regions, clicking in different regions will result in different actions, going to next animation, going to next slide, going back to previous animation and going back to previous slide. |
Effect Object
An unit in _control array records all animation effects' parameters and slide transition parameters described as the following
advt | Advancing time. It indicates how long player will go to next slide after effects in current slide finishes. | |
advc | Advanced by click. If it is set to 0, user can not advance to next slide by clicking, | |
trans | Other parameters used in slide transition including duration, transition effect number etc. | |
animations | Effect arry in one slide. Each effect contains many attribute such as effect index, animation shape id, duration, trigger type, and many other parameters for different effects. |
Events
Player will discard events for special timing.
Event Name | Timing | |
domReadyEvent | Page dom has been loaded, but slide player doesn't start. At this timing, you can modify original data and do your own initiate work. | |
beginshowEvent | This event is dispatched when player initialization is finished. However, it shall be noted that not all the resource contents are ready, such as images and fonts. It is more safe to start operation after receiving onloadEvent. However, if the network is slow, this event indicates a basic point in time to start safely. | |
onloadEvent | This event is dispatched when all resources are loaded for perfect playing. | |
setzoomEvent | This event is dispatched when player scale is changed, | |
resetPageEvent | This event is dispatched after a certain page is reset. | |
replayEvent | This event is dispatched after player is reset. | |
playOverEvent | This event is dispatched when player completed all the slides and effects. | |
gopageEvent | This event is dispatched when player enters a new slide |
Funtions
Function name | Description | |
syncPageAnim | syncPageAnim(slide, anim, trigger, isBack, tm) Slides and animation action recorder. When player changes its state, going ahead or back to a new slide, doing or undoing an effect, this function will be called in order to log the action. It is useful in peer to peer playing or recording a courseware. Playing the logged actions by order will reproduce the same scene. Param: slide: slide index anim: effect index in slide animation array trigger: If this effect is trigger by clicking specific shape, this variable is the shape id, or it is -1 isBack: true means this action is an undo action. tm: time click when this happen (microsecond from beginning of playing) |
|
syncExec | syncExec (slide, anim, trigger, isBack) Execute specific action. Param: slide: Slide Index. anim: effect index in slide animation array trigger: Current effect is a trigger effect or main sequence effect. isBack: an undo opertion |
|
ExecNext | ExecNext () Execute next effect based on current state. No param. |
|
ExecGoBack | ExecGoBack () Execute undo action based on current state. No param. |
|
resetPlayer | resetPlayer() Reset player. Play slides from the beginning. No param. |
|
resetPage | resetPage(page) Reset page to its original state. Param: page: page to reset. |
|
StopAllAnimation | StopAllAnimation() Stop all currently running animations and go to next state. No param. |
|
setAutoPlay | setAutoPlay() Changing _playmode to 0x0040. Player will go forward automatically. No param. |
|
GetCurPg | GetCurPg() Return current slide page |
|
GetTimeLineInfo | GetTimeLineInfo(trigger) return animation position of certain animation sequence in current slide. Param: trigger: trigger id Return: An object. Example: {len:length of animation sequence, pos: current animation position} |