Importing Formatted Text Into Your PDF Document
This application note outlines an indirect method of importing formatted text into Ancestral Author. AA provides a capability to import plain text files, with only paragraph formatting; but if you want to import tables, lists, or text with different fonts, you have to resort to an indirect method, such as is documented here.
The basic idea behind this method is simple. There are several low cost PDF tools that allow you to insert, remove, or replace pages of text in a PDF file with pages from another PDF file. You can use these tools to import formatted text into a PDF file created by Ancestral Author. Here are the steps:
An Example of Adding Formatted Text
Let's apply this procedure to a specific example. We'll add a new chapter to the sample PDF file that comes with Ancestral Author. This PDF file has six chapters. A seventh chapter will be added before the 'Sources and Endnotes' chapter showing census records in a tabular form.
Inserting a Placeholder for the New Chapter
For purposes of discussion, we'll assume that Ancestral Author has been installed in C:\Program Files\Ancestral Author. If you have installed it elsewhere, substitute your own installation directory for the one used in the file names that follow.
To load the script file for the sample, invoke Ancestral Author and press the 'Load New' button to load the script file at C:\Program Files\Ancestral Author\Samples\Scripts\sample.txt. We'll insert a chapter before the 'Sources and Endnotes' chapter, entitled '1790 Census Records for the Prentice Family'. This chapter will consist of 2 pages of census tables.
To make room for this 2 page chapter, press the 'Next' button until you get
to the 'Sources (as endnotes)' selection on the document item selection screen (screenshot
below). The census records chapter will be inserted here.
Select the 'Chapter Heading' document item (screenshot below),
and press 'Next'.
Then enter the chapter title (screenshot below). This page is
going to be replaced later, but the chapter heading is included here so that it appears in
the AA table of contents. After entering the chapter title, press 'Next'.
Since this is a two page chapter, an extra blank page is
required. Select the 'Blank Page(s)' document item, and press 'Next' (screenshot below).
Since the '1790 Census Records for the Prentice Family' level 1
chapter heading already created a new page, we need only create 1 additional blank page
We are now done inserting the 2 page chapter place holder. Press 'Next' until you get to the 'Done' screen, and then press the 'Finish' button. Save the script file in it's original location. You can view the resulting PDF file here. Note the page number of the 2 placeholder pages: 9, 10.
Creating the Formatted Text in a Word Processor
The beauty of the PDF995 PDF printer driver is that you can create formatted text, diagrams, tables, etc. in any program. As long as that program is able to print, then you can print it in PDF format. This examle shows how to include formatted text in the PDF file, but you could just as easily import a family tree diagram, XL spreadsheet, or anything else that is printable.
There are a few things to remember when creating your formatted text pages:
Once you have created your formatted pages, use your word processors 'file -> print' menu item to print it in PDF format. Be sure to choose the PDF995 printer. Save the PDF to a file called 'Insert.pdf' (click the file name to see what the formatted text looks like for this example).
Merging the Formatted Text Into the AA PDF Document
This procedure consists of replacing the blank pages in the AA document with the formatted text in the 'Insert.pdf' file.
Invoke the PDF split merge program. For this example, we're using VeryPdf's PDF split merge tool which can be downloaded from http://www.verypdf.com/pdfpg. This tool allows 15 free uses before requiring registration. When you invoke it, click the 'Try' button to indicate that you want a free try. When the main dialog for the PDF Split-Merge Software comes up, click the 'Merge PDF Files' tab, and you'll see the screen shown below:
The idea is to merge three sets of pages:
Add these three items in order in the 'Source PDF Files' list, using the 'Add' button. Specify the page numbers for each file. No page numbers need be specified for 'insert.pdf' since we are mergint the entire file. Call the output file NewSample.pdf. At this point, the dialog will appear as shown below.
Finally, click the 'Run' button to create NewSample.pdf, which you can see by clicking here.
There are a couple drawbacks to this approach for inserting formatted text:
One workaround for the link problem is to add pages at the end or beginning rather than in the middle.