ReportLab Binder: Documentation

This page describes how to create URLs which either generate a specific document or link to a pre-expanded or pre-populated brochure creation page

I. Direct Document Generation API

URLs requesting any document can be systematically built up following a few quick steps:

    {%for s in sections%} {%endfor%}
    Name Slug Section ID Abstract Mandatory
    {{s.name}} {{s.slug}} {{s.id}} {%if s.abstract%}x{%endif%} {%if s.mandatory%}x{%endif%}
  1. Type the root - this will stay the same for any given document and is the URL of the public facing search page followed by /api/?. For this particular document, the root is:

    http://binder.ebrochures.org/brochure/doc-name/api/?

  2. Define the sections to be included as a comma separated list after the root; possible values are given in the table below. Sections marked "mandatory" will always be included and including a section marked "abstract" will include every section within it. An example of a document with just the short programmes and masters degrees sections would be:

    {%for s in sections%} {%if s.abstract%} http://bpp.ebrochures.org/brochure/law/api/?sections=short-programmes,masters-degrees {%endif%} {%endfor%}

  3. Define any extra text fields that are supported in the document template, including title, subtitle, blurb, header, footer, and reference. Separate each piece of the URL with the "&" symbol. For example, to add a custom title and subtitle to the above document:

    http://bpp.ebrochures.org/brochure/law/api/?sections=short-programmes,masters-degrees&title=BPP Law Brochure&subtitle=Customised for John Smith

  4. Define the "disposition" (the way in which the document is served). Possible values are:

    For example, to send the above document in an email with a custom subject:

    http://bpp.ebrochures.org/brochure/law/api/?sections=short-programmes,masters- degrees&title=BPP Law Brochure&subtitle=Customised for John Smith&disposition=email&email_to=john.smith@sampleemail.com&subject=John's BPP brochure

    Or to download it directly:

    http://bpp.ebrochures.org/brochure/law/api/?sections=short-programmes,masters- degrees&title=BPP Law Brochure&subtitle=Customised for John Smith&disposition=attachment

II. Selection Page

Similarly, URLs can be constructed which link to the brochure creation page and define its initial appearance:

  1. Start with root; this will be the URL of the brochure creation page followed by /?. For this document, it would be:

    http://bpp.ebrochures.org/brochure/law/?

  2. Define which headings are initially expanded in a comma separated list:

    http://bpp.ebrochures.org/brochure/law/?expanded=short-programes,masters-degrees

  3. Define which sections are pre-checked in a comma separated list:

    http://bpp.ebrochures.org/brochure/law/?expanded=short-programmes,masters-degrees&sections=summer-school,ma-law-with-business

  4. Control which download options are displayed and which is selected initially; possible values are


    So to serve the above document with only download of flip-book options and flip-book initially selected:

    http://bpp.ebrochures.org/brochure/law/?expanded=short-programmes,masters-degrees§ions=summer-school,ma-law-with-business&download_display=download,flip_book&download_option=flip_book

III. Other Useful URLS

http://<domain>/brochure/<documentName>/help/

This page. General documentation; also lists the available sections for <documentName>

http://<domain>/brochure/<documentName>/sections

Returns a plain text JSON listing of the available sections for <documentName>


Available sections for document '{{pdf.name}}

{%for s in sections%} {%endfor%}
Name Slug Section ID Abstract Mandatory
{{s.name}} {{s.slug}} {{s.id}} {%if s.abstract%}x{%endif%} {%if s.mandatory%}x{%endif%}

Key: Click here for a listing of sections in JSON format.