Skip to content

Book.json Baker extension parameters

Alessandro Morandi edited this page · 24 revisions

In addition to the standard parameters defined in the HPub specification, Baker defines some proprietary parameters.

Visualization properties:

  • -baker-background ( string, default: "#000000" ): Background color to be shown before pages are loaded. Not visible when -baker-background-image-portrait or -baker-background-image-landscape are specified.
  • -baker-background-image-portrait ( string ): Path to an image file to be shown as a background before pages are loaded in portrait mode, e.g. "book/background-portrait.png". Please notice the image size should be exactly 768x1024 pixels.
  • -baker-background-image-landscape ( string ): Path to an image file to be shown as a background before pages are loaded in landscape mode, e.g. "book/background-landscape.png". Please notice the image size should be exactly 1024x768 pixels.
  • -baker-page-numbers-color ( string, default: "#FFFFFF" ): Color for page numbers (and page titles) to be shown before pages are loaded.
  • -baker-page-numbers-alpha ( number, default: 0.3 ): Alpha (opacity) for page numbers (and page titles) to be shown before pages are loaded.
  • -baker-page-screenshots ( string ) - since 3.1: Path to a folder containing the pre-rendered pages screenshots. The files must be named screenshot-portrait-1.jpg for portrait and screenshot-landscape-1.jpg for landscape, where '1' is the page number, incremental (1, 2, 3, ...). Be sure to provide ALL the screenshots for your book since, if this property is specified and some screenshots are missing, Baker won't generate them. See the tutorial page to find out how to use the iOS Simulator to generate the screenshots.

Behaviour properties:

  • -baker-rendering ( string, default: "screenshots" ): Possible options are "screenshots" and "three-cards", all lowercase. See the page on Baker rendering modes.
  • -baker-vertical-bounce ( boolean, default: true ): Whether a bounce animation should be shown when a vertical scrolling interaction reaches the end of a page.
  • -baker-media-autoplay ( boolean, default: true ): Whether media included in the book pages should be played automatically when the page is loaded (opposite of the mediaPlaybackRequiresUserAction property in the UIWebView class).
  • -baker-vertical-pagination ( boolean, default: false ): Whether vertical page scrolling should be paginated in the whole publication. Since 4.1 this setting can be overridden on a per-page basis by adding the tag <meta name="paged" content="YES"> inside the <head> tag of the HTML file.
  • -baker-page-turn-tap ( boolean, default: true ) - since 3.2: Defines if you can tap on the right (or left) side to go forward (or back) by one page.
  • -baker-page-turn-swipe ( boolean, default: true ) - since 3.2: Defines if you can swipe on the page to go forward (or back) by one page.

Book extended properties:

  • -baker-index-height ( number, default: null ): Height (in pixels) for the index bar. When null, the height is automatically set to the height of the index.html page. Note that the index bar will always snap to the bottom side of the viewport.
  • -baker-index-width ( number, default: null ) - since 3.2: Width (in pixels) for the index bar. When null, the width is automatically set to the width of the index.html page. Note that the index bar will always snap to the left side of the viewport.
  • -baker-index-bounce ( boolean, default: false ): Whether a bounce animation should be shown when a scrolling interaction reaches the end of the page in the index bar.
  • -baker-start-at-page ( number, default: 1 ) - since 3.1: Defines the starting page of the publication. If the number given to the parameter is negative (i.e. -baker-start-at-page: -1 or -baker-start-at-page: -2), the publication will be used in "manga mode", i.e. starting at the end and with numbering reversed. Please note that to obtain manga mode you also have to reverse the order of the pages in the content block.
Something went wrong with that request. Please try again.