- Previous: Deprecated Publishing APIs
- Up: Deprecated Publishing APIs
- Next: Cover Generation Data Structures
Generating Cover PDFs
Deprecation Notice
This API is deprecated as of July 19, 2011. Users are strongly encouraged to upgrade to the cover conversion API.
The new cover conversion API offers several advantages:
- Asynchronous operation, allowing an application to either poll for completion or await a callback to a specified URL.
- A simplified data model that eliminates redundancy in the cover metadata.
- Adherence to the standard API conventions, including support for both XML and JSON.
- Integration with the file management APIs, which:
- eliminates the need to host images and other assets yourself, and
- allows you to download your cover file or immediately use it in a project.
Cover Generation
API Key Type Required: Publication API
This API does not adhere to our standard API conventions.
Purpose
This API will allow you to create a cover PDF for your book based on an existing template. See the list of available templates.
GET Arguments
- api_key -- Your api key for the Publication API.
POST Arguments
- data -- A JSON representation of the cover metadata.
Endpoint
https://apps.lulu.com/api/pdfgen/covers/v1/generate/templateCreatorId/${creatorId}/templateId/$[templateId}?api_key=XXX
JSON Response
A simple JSON data structure representing the result of the call. The status will be 200 if the call is successful, and the generatedPdfURI will be a location that can be used to access the new PDF. This file will remain on the server for 24 hours. You must retrieve the file before it is deleted.
The messages field will return a series of strings to indicate any warnings that were encountered during the cover generation. The following string will always be included:
"[error] Failed to read image file: \n [error] java.io.FileNotFoundException: /usr/share/Tools/logo-renderx.svg"
This is a non fatal error and does not mean that there was an error in generating cover PDF. Please ignore this error, it will be removed in a future release.
{"generatedPdfURI" : "http://pubapp.lulu.com/api/file/v1/download/lulu/cover/6x9dustjacket/315f/2db8/0002/3fd7/f262/03aa/c037/aaaa/315f2db800023fd7f26203aac037aaaa.pdf","taskStatus" : "COMPLETED","messages" : [ "INFO: (document\n (validate [validation OK])\n (compile \n (masters \n (sequence-master [master-name cover-back-spine-front]))\n (sequence [master-reference cover-back-spine-front]\n (flow [flow-name xsl-region-body])))\n (format \n (sequence [master-reference cover-back-spine-front]\n (flow [1])\n (static-content [1])))\n (generate [output-format pdf][1]\n [error] Failed to read image file: \n [error] java.io.FileNotFoundException: /usr/share/Tools/logo-renderx.svg (No such file or directory)\n ))\n" ],"details" : null,"status" : 200}
Errors
{
"generatedPdfURI" : null,
"taskStatus" : "ERROR",
"messages" : null,
"details" : "no data was posted",
"status" : 500
}
If templateCreatorId and templateId do not map to a valid template then an error is returned:
{
"generatedPdfURI" : null,
"taskStatus" : "ERROR",
"messages" : null,
"details" : "template for templateCreatorId [aaa] and templateId [dust-jacket] does not exist. please check documententation and provide valid values and try again!",
"status" : 500
}


0 Comments
Please sign in to post a comment.