Obtaining PDF Final or Preview

This requires two calls - the first to build the PDF and the second to obtain the PDF data from the server for storage client-side.

1. Building the PDF

URL: /segments/remote_translate_pdf
Post Data: session_id, target_id, final

session_id

The unique key returned in the initial login call.

target_id

The value of target_lang_id obtained when the PDF was uploaded.

final

If False (the default, if not supplied) a PDF preview is generated. This will be uneditable and watermarked but is suitable for sending to clients as a proof-of-concept.

If True, the final version of the translated PDF is produced. This has no watermark or encryption and is suitable for editing in a PDF editor if needed to remedy any formatting issues. The user's credit balance will be adjusted to reflect the purchase. You can determine the cost in advance by calling remote_get_final_fee - see below.

Returns

On success, a JSON structure containing progress information.
On failure the HTTP status code will be set to something other than 200.

The JSON structure will contain amongst other things, the following fields:

task_id

The unique id of the task which corresponds to a separate thread on the server. Use this id to obtain status information about the task via the remote_task_status call.

2. Getting the PDF Data

URL: /segments/remote_download_pdf2
Post Data: session_id, target_id, final

session_id

The unique key returned in the initial login call.

target_id

The value of target_lang_id obtained when the PDF was uploaded.

final

If False (the default, if not supplied) a PDF preview is generated. This will be uneditable and watermarked but is suitable for sending to clients as a proof-of-concept.

If True, the final version of the translated PDF is produced. This has no watermark or encryption and is suitable for editing in a PDF editor if needed to remedy any formatting issues. The user's credit balance will be adjusted to reflect the purchase. You can determine the cost in advance by calling remote_get_final_fee - see below.

Returns

The name of the PDF file just downloaded is encoded into the HTTP header. The rest of the content is the file data itself.

An error is returned with an explanation if the user requests a 'final' version but does not have enough page credits for the purchase.