Data Structures

Cover Conversion Manifest

Description

A description of the cover that will be generated by calling this API.

Example

This is a sample JSON-formatted Cover object

{
"cover": {
  "templateId" : "6x9paperback",
  "spineWidth" : 72,
  "layoutBlocks" : {
    "frontCoverHeadline" : {
      "backgroundColor" : "#229999",
      "textColor" : "#000000",
      "text" : "A story of intrigue, mystery and misbehavior"
    },
    "title" : {
      "backgroundColor" : "#229999",
      "textColor" : "#000000",
      "text" : "Revenge of the Albatross and more stories"
    },
    "author" : {
      "backgroundColor" : "#229999",
      "textColor" : "#000000",
      "text" : "Carl Mabry"
    },
    "spineAuthor" : {
      "backgroundColor" : "#C0C0C0",
      "textColor" : "#000000",
      "text" : "Carl Mabry"
    },
    "spineLogo" : {
      "image" : "http://cfl.uploads.mrx.ca/ham/images/newser/2009/08/BobYoung5725.jpg"
    },
    "frontFlapText" : {
      "backgroundColor" : "#808080",
      "textColor" : "#000000",
      "text" : "Lulu (Lulu Enterprises, Inc. and Lulu Press, Inc. are collectively called \"Lulu\") is a company offering diverse publishing and printing services with headquarters at Raleigh, North Carolina, United States. The company is international with staff in 12 countries, and offices in Raleigh, London, Toronto and Bangalore.[1] In addition to printing and publishing services it also offers online order fulfillment. The brand name is derived from the concept of a lulu as an old-fashioned term for a remarkable person, object, or idea. [2] The company's CEO is Red Hat co-founder Bob Young. Authors who publish/print materials and similar works through Lulu retain the copyrights to such materials and similar works. Optional services offered by the company include ISBN assignment, and distribution of books to retailers requesting specific titles (returns are not accepted, which limits distribution to physical bookstores). Electronic distribution is also available. Lulu Enterprises was founded in early 2002. OpenMind Publishing, founded by Bradley Schultz and Paul Elliot, merged its publishing company and staff with Lulu in the latter part of 2002. OpenMind Publishing was a publisher of customized texts for college professors. "
    },
    "backFlapText" : {
      "backgroundColor" : "#C0C0C0",
      "textColor" : "#000000",
      "text" : "Lulu (Lulu Enterprises, Inc. and Lulu Press, Inc. are collectively called \"Lulu\") is a company offering diverse publishing and printing services with headquarters at Raleigh, North Carolina, United States. The company is international with staff in 12 countries, and offices in Raleigh, London, Toronto and Bangalore.[1] In addition to printing and publishing services it also offers online order fulfillment. The brand name is derived from the concept of a lulu as an old-fashioned term for a remarkable person, object, or idea. [2] The company's CEO is Red Hat co-founder Bob Young. Authors who publish/print materials and similar works through Lulu retain the copyrights to such materials and similar works. Optional services offered by the company include ISBN assignment, and distribution of books to retailers requesting specific titles (returns are not accepted, which limits distribution to physical bookstores). Electronic distribution is also available. Lulu Enterprises was founded in early 2002. OpenMind Publishing, founded by Bradley Schultz and Paul Elliot, merged its publishing company and staff with Lulu in the latter part of 2002. OpenMind Publishing was a publisher of customized texts for college professors. "
    },
    "authorBio" : {
      "backgroundColor" : "#808080",
      "textColor" : "#000000",
      "text" : "Jackson Rogers is is an internationally renowned author, reporter, and columnist - the recipient of two Pulitzer Prizes and the author of five bestselling books, among them Web Diagnostics and Social Media - From Applications to Zen Programming. He teaches at Harvard University."
    },
    "backCoverSynopsis" : {
      "backgroundColor" : "#C0C0C0",
      "textColor" : "#000000",
      "text" : "Making Money with iPad Applications belongs in the toolbox of every person interested in the design and development of  Web-based software, from the CEO to the programming team. Making Money with iPad Applications explores the building blocks of great Web applications and uses them as basic principles of design so that every project produces inspiring workflows with successful results.  Principles include creating  only whats necessary, getting users up to speed quickly, and preventing and handling errors. It offers practical advice about how to achieve the qualities of great Web-based applications and consistently and successfully reproduce them."
    },
    "reviewBlurbs" : {
      "backgroundColor" : "#808080",
      "textColor" : "#000000",
      "text" : "\"The perfect way to create extra income in these uncertain economic times\"
 - New York Times

 
\"Clear and concise, this guide is ideal for both beginners and those experts who know the code but need guidance with on and offline marketing .\"
 - Wired Magazine

 
\"There is a very obvious reason why Jackson Rogers is one of America's most celebrated Web authors: he is very good.\"
- CNET"
    },
    "publisherLogoFront" : {
      "image" : "http://cfl.uploads.mrx.ca/ham/images/newser/2009/08/BobYoung5725.jpg"
    },
    "publisherLogoBack" : {
      "image" : "http://cfl.uploads.mrx.ca/ham/images/newser/2009/08/BobYoung5725.jpg"
    },
    "backFlapImage" : {
      "image" : "http://cfl.uploads.mrx.ca/ham/images/newser/2009/08/BobYoung5725.jpg"
    },
    "authorPhoto" : {
      "image" : "http://cfl.uploads.mrx.ca/ham/images/newser/2009/08/BobYoung5725.jpg"
    },
    "spineTitle" : {
      "backgroundColor" : "#C0C0C0",
      "textColor" : "#000000",
      "text" : "Revenge of the Albatross\"quote\" and more stories"
    },
    "backCoverBarCode" : {
      "type" : "EAN",
      "code" : "9783468111242",
      "supplemental" : "54499"
    }
  },
  "backgrounds" : {
    "frontCover" : {
      "value" : "#996600",
      "type" : "ColorCode"
    },
    "backCover" : {
      "value" : "#996600",
      "type" : "ColorCode"
    },
    "spine" : null,
    "frontFlap" : {
      "value" : "#CCB399",
      "type" : "ColorCode"
    },
    "backFlap" : {
      "value" : "#CCB399",
      "type" : "ColorCode"
    }
  }
}
}

Fields

Field Data Type Required? Description
templateId string yes specifies the template to use for cover generation
spineWidth float yes the spine width in postscript points
layoutBlocks data structure yes defines the content for each region of the cover template.  The list of available regions is defined per template.
backgrounds data structure no Defines a customizable background color or image for specific regions of the cover template.

Layout Blocks

Description

There are three kinds of layout blocks: text, image, and barcode.  The supported fields are dictated by the layout block you are defining.  Please refer to our list of available layout blocks, their type, and the templates that include each block.

Text Blocks

Features

Text for the text blocks can be marked up with supported html tags.  The tags must be passed as valid XHTML. 

The following tags are supported:

  • line break (<br>)
  • bold (<b>)
  • emphasis (<em>)
  • strong (<strong>)
  • italic (<i>)
  • ordered list (<ol> with <li>)
  • unordered list (<ul> with <li>)
  • underline (<u>)
  • paragraph (<p>)

Limitations

  • Fonts and font sizes are defined by the template, and cannot be changed through the API.
  • Text overflows are not validated. The character limitations vary by text block and POD package, so the API user is required to check the generated PDF and ensure that all text that was supplied was rendered as desired before uploading via the Publication API.

Fields

Field Data Type Required? Description
backgroundColor string No The color for the background of the current block represented as an HTML color string.  Defaults to white if not specified or if the specified color is invalid.
textColor string No The color for the text of the current block represented as an HTML color string.  Defaults to black if not specified or if the specified color is invalid.
text string No The text for the current block.

Image Blocks

Limitations

  • Image files should first by uploaded using our file management APIs. Alternatively, a file may be hosted on a publicly accessible web server and its location supplied as a valid HTTP URL. 
  • Image files have a maximum size limitation of 10 MB. 
  • Image files must be in JPEG, GIF or PNG format. The API will not render images of invalid type.
  • Image files must have a minimum DPI of 300 to ensure high quality print resolution. The API does not validate image resolution, but files with lower DPI will generate poor-quality results.

Fields

Field Data Type Required? Description
imageFile string Yes The URL for the image to use as the background of the current block. For files uploaded via the file APIs (recommended), reference them using the "fileId" schema, as in "fileId:5432".

Barcode Blocks

Fields

Field
Data Type
Required?
Description
type
string
Yes
The type of barcode to render, either "EAN" or "QR_CODE".
code string Yes If the type is "EAN", this must be a valid EAN or ISBN value.  If the type is "QR_CODE", any value is supported, though usually a web page for the author or publisher is included.
supplemental string No The extended value for an "EAN" barcode.  This is usually the price of the book.  This value is ignored for "QR_CODE" barcodes.

Backgrounds

Description

Define a customizable background color or  background image for defined regions of the cover template. A background can be a valid HTML color code or an uploaded image file.

The various customizable backgrounds are: frontCover, backCover, frontFlap, backFlap, spine. If a background is not supplied, it will be assigned the default value.

Fields

Field Data Type Required? Description
type string Yes How the background is specified, either "ColorCode" or "Image"
value string No If the type is "ColorCode", this must be a valid HTML color code.  If the type is "Image", this must be a valid image URL as described under Image Blocks above.  If the value is unspecified or is invalid and the type is "ColorCode", the background will default to white.  If the value is unspecified or invalid for images, then an error icon will appear in the resulting PDF.

Cover Conversion Status

Description

Describes the status of a cover conversion

Example

This is an example of a cover conversion status response.

{
    "conversionId": 12345,
    "status": "COMPLETED",
    "conversionStartDate": "2011-05-01T14:16:37.782-05:00",
    "conversionEndDate": "2011-05-01T14:17:10.124-05:00",
    "outputFileId": 51126
}
    

Fields

Field Data Type Description
conversionId integer The identifier used to track a cover conversion.
status string The status code which describes the current state of the cover conversion.
conversionStartDate string The timestamp of the start of the cover conversion.
conversionEndDate string The timestamp of the completion of the cover conversion (if conversion has completed).
outputFileId integer The file id which corresponds to the output PDF (if conversion was successful).

Cover Size Data

Description

The results of the cover size calculation for a given set of physical book properties.

Example

This is an JSON example of a response from the cover size calculation API call.

{
   "coverSizeData":    {
      "fullCoverDimension":       {
         "width":          {
            "valueInPoints": 646.22,
            "valueInInches": 8.98
         },
         "height":          {
            "valueInPoints": 513,
            "valueInInches": 7.12
         }
      },
      "spineWidth":       {
         "valueInPoints": 16.22,
         "valueInInches": 0.23
      },
      "spineIndentation":       {
         "length":          {
            "valueInPoints": 315,
            "valueInInches": 4.38
         },
         "orientation": "FROM_LEFT"
      }
   },
   "details": "",
   "status": 200
}

Book Physical Properties

Description

A description of the physical book.

Example

This is the minimal data required to determine what the physical book dimensions will be.

{
  "numberOfPages" : 100,
  "color" : false,
  "trimSize" : "POCKET",
  "bindingType" : "perfect",
  "paperType" : "regular"
}
    

Fields

Field Data Type Required? Description
numberOfPages integer yes The number of pages in the PDF that will be supplied to the publication API.
binding_type string yes The requested book binding type. The available options depend on the project type. Softcover books support: "perfect", "saddle-stitch", and "coil". Hardcover books support: "jacket-hardcover" and "casewrap-hardcover".
trim_size string yes The size of the book. See the list of available trim sizes.
paper_type string yes The quality of paper to use. The valid paper types are: "premium", "regular", and "publisher-grade".
color boolean yes Does the project contain full color pages in the interior of the book. If any page in the book includes color, this must be True.

2 Comments

  1. Spiro2 years ago

    Can you please post an example of a conversion manifest for an ebook?

  2. Josiah Gore2 years ago

    Unfortunately, the cover generation API only supports the creation of book covers at this time.

Please sign in to post a comment.