1
PharmaSUG 2023 - Paper AP-259
No More Manual PDF Bookmarks! An Automated Approach to Converting
RTF files to a Consolidated PDF with Bookmarks
Tyler Plevney, Emanate Biostats, Inc.
ABSTRACT
Preparing output documents for data review meetings and presentations can be a tedious process. What
if I told you, it does not have to be? Instead of opening and closing multiple rich text format (RTF) file or
Excel files with various sorts and filters to review, sometimes hundreds of outputs, why not consolidate
them in an easy-to-review PDF document with all outputs easily separated with linked bookmarks? Doing
this manually by converting RTF output files to PDF can take a long time. Add on the time to type out the
bookmarks for each individual output and it does not seem worth it. In this paper I will present an
automated way to convert an entire folder of RTF outputs to PDF while simultaneously changing the
filenames to the bookmark text once consolidated into a combined PDF file. This is all done via a SAS
®
program containing some VBScript code for file moving and converting in conjunction with an Excel
spreadsheet containing the RTF output filenames and the title of the outputs.
INTRODUCTION
If you have attended a data monitoring committee (DMC) presentation or similar data review meeting, you
probably notice a lot of wasted time swapping between different RTF files of table, figure, and listing
outputs trying to make sense of the data. As the number of open Word documents increases, so can the
level of confusion and disorganization; especially if those RTF files are not named with reviewer-friendly
file names. If separate RTF files are being used for the review process and the files have not been named
in a convention that allows the reviewer to understand the content of the output (many times these are
just labelled as the output number, and not a meaningful title), reviewers will be spending minutes, if not
hours, clicking open each RTF file trying to search for the output they want to review. Excel versions of
the data output files are a good alternative to review the data due to their ability to sort and filter, but even
that option has its limits in the reviewing process. Viewing figures, for example, is a much better
experience through other means, and summary table reviews in Excel can become problematic due to
the difficulties in perceiving subsections of summaries in a grided, cellular format. Arguably the best way
to view the entirety of a study’s outputs is through a single PDF document. This allows the ability to
navigate through the bookmarks from output to output. It makes the viewing of specific data outputs much
more elegant in a formal meeting than pulling up several individual Word or Excel documents with various
sorts and filters. In this paper, you will learn the process of converting an entire folder of RTF outputs into
a single PDF file with each output having its own linked bookmark.
There are a few requirements for this process. The first requirement includes an Excel spreadsheet
containing the following information in separate columns: the numbering of the output (often controlled by
clinical study report (CSR) standards, but not limited in any way), the titles of the outputs (often available
via a table of contents for outputs produced alongside the statistical analysis plan [SAP]), and the
filenames of the RTF output files. The second requirement is a VBScript program developed and
executed within the final SAS
®
program and is only viable on Windows. The third requirement is a PDF
editing software which allows for consolidation of multiple PDF files while retaining file names as
bookmarks. Adobe Acrobat Pro is used for the purposes of this paper.
PREPARING THE PREREQUISITES
The first step is preparing the file structure which will include a parent folder with two child folders.
• For this paper, the parent folder will be named ConvertRTFtoPDF and will be represented
by the macro variable xPath in subsequent SAS
®
code.
• A child folder for your RTF files (referred to as “RTF” for the purposes of this paper).
Place the RTF files you wish to convert to PDF inside this folder.