Contents | Start | End | Previous: Chapter 6: Using Custom Checking | Next: Appendix A: A sample script
This chapter describes how to use Jutoh Plus to create customised books in bulk, with just a text file containing customisation data, and a project file containing variables. No scripting is needed!
Suppose you want to send out 100 advance copies of your book to garner some reviews. But you don’t want these people to redistribute your book. It would deter redistribution if each book contained the reader’s name – “For Sally Smith” – perhaps in the title page, or even before each chapter heading in small capitals.
Or perhaps you want to create books for children that use the child’s name at various points in the book.
Or, you might want to create enhanced versions of your book for subscribers, with extra material and each subscriber’s name in the book.
To achieve this, you could type the custom information into each copy of the book, compile the book, and rename it. But this is a very time-consuming and error-prone process. What if you could simply type the list of names into a text file, and then get Jutoh to create all these books automatically? This ‘mail merge’ type of operation would be a pretty big time saving, and maybe even make a task practical that would be completely impractical otherwise.
In the next two sections, we describe string tables – an important part of the personalisation process – and the steps needed to create your personalised books.
A string table is simply a general-purpose repository of variable/value pairs, such as CUSTOMER=Billy or ADDRESS=1, Canary Wharf. There are global string tables that are not project-specific – these can be edited via the Preferences dialog in the Strings page. Also, each project can have string tables, and these can be edited via the Project Properties dialog in the Strings page.
Jutoh lets you use variables in your project, so for example if you wanted to use a different ISBN number per configuration, you could have a different string table per configuration, and set the ISBN variable to a different value in each string table.
We use string tables for personalisation: the fields (variables) in the first line of our data text file are loaded into a string table, and Jutoh creates a book using these values. Jutoh reads another line, loads that into the string table, and creates a book using these values, and so on until it reaches the end of the file.
How does Jutoh know which variables names to use for the fields in the file? You tell it – by specifying something like this in the Batch Compile dialog:
CUSTOMER,ADDRESS
This tells Jutoh to put the first field of each line into the variable CUSTOMER, and the second field into the variable ADDRESS.
Here are the steps to take for creating personalised books.
Step 1. Decide what variables you are going to allow in your books, such as %CUSTOMER% and %ADDRESS%. Insert these into your book, for example in the title page.
Step 2. Decide whether you are going to use a global or project string table to receive the variable values, and what its name will be. It’s not really important which you use, but if in doubt, use a global string table. Edit the configuration option Project string table or Global string table to specify the name of your string table. Also enable Replace strings in content. If you are going to use multiple configurations, make sure you edit these in all relevant configurations. You can omit this step and the Batch Compile dialog will do it for you.
Step 3. Also in your configuration, edit the Book file name option and insert a keyword to make the file unique to your customer. For example: %FILENAME%_%CUSTOMER%. You can omit this step and enter it in the Batch Compile dialog instead. You will be prompted if the Book file name configuration option does not contain variables from the Variables field to make the file name unique.
Step 4. Prepare a text file with one line per record, separated by a character that you choose, typically a semicolon. A typical line might be: Joe Bloggs;1 High Street, Wilton.
Step 5. Invoke the Book | Batch Compile command, and check Create personalised books. Specify the data file name, the comma-separated variable names, for example CUSTOMER,ADDRESS, an output ebook format such as %FILENAME%_%CUSTOMER%, and the string table to use (i.e. the one used in your configuration).
The Batch Compile dialog
Step 6. Enable the configurations you want to use by checking them in the Batch Compile dialog.
Step 7. Click Compile in the Batch Compile dialog. Jutoh will read each record (line) of the file, fill the string table with the fields in the record, and use these strings when compiling the book. The number of books created should be the number of records in your data file multiplied by the number of configurations you specified.
If you have a variable called CONFIG, this will be used to select a single configuration that will be used instead of the selected configurations.
After you close the Batch Compile dialog, you can undo any changes that Jutoh has made to configurations by using the command File | Undo Edit Configuration (for each changed configuration).
It’s possible that you don’t always want to create personalised books; so you can create a new configuration, say “Personalised Epub” that you will select for personalised books. In addition, create conditional formatting around the personalised text, so that it will be omitted in all configurations except “Personalised Epub”. Here are the necessary steps.
Go to Project Properties/Configurations, click “+”, type the new configuration name, and choose Base on existing configuration. Choose an existing configuration, and click OK.
In your new configuration, find the option Include content matching tags, and type the tag name “personalisation” (it’s an arbitrary name that you will use later).
In your other configurations, find the option Exclude content matching tags, and type the tag name “personalisation”. Click OK.
Select the personalised content in your book, e.g. “For %CUSTOMER%”, and in the Objects tab of the Formatting Palette, double-click condition. Type “personalisation” into the tag field and click OK. You will see a pair of objects bracketing the text.
Now, when you batch-compile with the “Personalised Epub” configuration, the personalised text will be visible. Other configurations will omit the text. If you have already batch-compiled with other configurations, you may need to reset the Book file name option back to %FILENAME% if it still contains keywords.
If you are personalising a children’s book, you could have a different string table that you use for non-personalised versions, with default names. So for all of the configurations except “Personalised Epub”, you can set Project string table to the name of default string table that you created in your project, for example “Default String Table”. This will set sensible values for variables that would otherwise be read from your data file.
For more on conditional formatting, please type “conditional content” into the Jutoh toolbar or refer to Creating Great Ebooks Using Jutoh.
In this final chapter we learned how to perform bulk creation of personalised books, useful for creating advance copies or other purposes.
We hope you enjoy a big productivity increase from using Jutoh Plus! Let us know what you think via the Jutoh support page, and feel free to suggest new features.
Contents | Start | End | Previous: Chapter 6: Using Custom Checking | Next: Appendix A: A sample script