Creating PDF documents including hyperlinks bookmarks and a
Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS software. Lex Jansen NV Organon Oss, The Netherlands
Contents • Data flow • Why PDF ? • Types of appendices • From SAS to Postscript to PDF • SAS output conventions • Postscript • PDF mark operator • %_SAS 2 PS • Demo
The Data Flow Cli F CR n. T ria l Investigator Data Entry (Clin. Trial) Electronic Submission SAS Clinical Data Warehouse Document Management System (Documentum)
The Data Flow Cli SAS n. T CR F ria l SAS Clinical Data Warehouse PDF Electronic Submission Document Management System (Documentum)
Why the PDF Format ? • Independent of environment • Easy navigation (hyperlinks, bookmarks) • Easy distribution (free acrobat reader) • The FDA wants it
Why the PDF Format ? (FDA) “In general, for documents with a table of contents, provide bookmarks and hypertext links for each item listed in the table of contents including all tables, figures, publications, other references, and appendices. These bookmarks and hypertext links are essential for the efficient navigation through documents. In general, including a bookmark to the main table of contents for a submission or item is helpful. Make the bookmark hierarchy identical to the table of contents. Avoid using bookmark levels in addition to those present in the table of contents. ”
Types of Appendices • Statistical analyses (STAT) (different sections with: tables, analyses, graphics, listings) • Individual data listings (IDL) • Case report form tabulations (CRF)
Statistical Analysis
Individual Data Listing
Case Report Form Tabulation
Environment • Windows NT, SP 4 • Sas 6. 12, TS 070, only SAS/Base • Adobe Acrobat distiller 4. 05
How Do We Get From SAS to PDF? • Install complete Adobe Acrobat package and use the Acrobat PDFwriter printerdriver But, no bookmarks and hyperlinks • SAS version 8 can generate PDF output for graphics output • SAS V 8. 2 brings PDF output with the output delivery system (ODS) Bookmarks and hyperlinks ? ? ? Yes, but…. • Solution: create postscript with SAS and use Acrobat Distiller with the pdfmark operator!!
How to Get From SAS to PDF Tables Analyses %_sas 2 ps Postscript file Graphics Listings %_ps 2 pdf + Acrobat Distiller SAS output PDF file
From Postscript to PDF Convert!! IN x PS 2 PDF Acrobat Distiller watches OUT Acrobat Distiller converts
SAS Output Conventions • Portrait Landscape • Options NOCENTER NODATE NONUMBER • Conventions for TITLES and FOOTNOTES • Graphic output uses postscript DEVICE=PSL : : linesize=94 linesize=145 pagesize=87 pagesize=56
SAS Output Conventions - Titles Table 2. 8 -1. B Summary statistics of minimum cycle length. All-Subjects-Treated Group. Restricted to subjects with irregular cycle length < 41 days. _____________________________ |Minimum cycle length (days) | Puregon | Table, Analysis, Listing, Figure <section>-<number> or <number> #Table 2. 8 -1. B Summary statistics of minimum cycle length. All-Subjects-Treated Group. Restricted to subjects with irregular cycle length < 41 days. _____________________________ |Minimum cycle length (days) | Puregon |
Table of Contents
SAS Output Conventions - Footnotes | SD | | | 3. 54| | Minimum | 20| 25| 20| |______________|_________|_____| (CONTINUED) Compound: Puregon (E 1650), SAS program: tab_cycle /Date: 21 MAR 2000 16: 23
SAS Output Conventions - Graphics • Graphics are generated with a postscript device (PSL) • Every graphic has a corresponding text file with the title in it Postscript file Text file with title
SAS Output Conventions - Graphics • Graphics are generated with a postscript device (PSL) ANCOVA model check: normal Q-Q plot of studentizedtext residuals • Every graphic has a corresponding Outcome variable: (Prothrombin) Fragment 1+2 [nmol/L] excluded file. Outliers with the title in it Per Protocol group #Figure 6. 1. E Postscript file Text file with title
What Is Postscript? • Page description language • A page is a graphic that can contain: Lines, rectangles, curves Text in various typefaces of any size and orientation • Device independent • Closely related to PDF (both adobe)
Postscript - Coordinate System 1 inch (595, 842) = = 72 points A 4 (0, 0) 8, 3 inch x 11, 7 inch
Postscript - Coordinate System 1 inch (612, 792) = = 72 points Letter (0, 0) 8, 5 inch x 11 inch
Postscript - Adding Text Listing 4 Dosing Compliance. Descriptives per Subject and per Cycle. Intent-to-Treat Group. Choose font X-coordinate Y-coordinate moveto (text to show) show /Helvetica-Bold findfont 8 scalefont setfont 108 730 moveto (Listing 4) ushow 205 730 moveto (Dosing Compliance. ) show /Helvetica findfont 8 scalefont setfont 205 723 moveto (Descriptives per Subject and per Cycle. ) show 205 716 moveto (Intent-to-Treat Group. ) show
Postscript - Document Structuring Conventions %!PS-Adobe-3. 0 %%Title: Protocol 068004 Appendix F %%Creation. Date: 29 MAR 2000 18: 31 %%Generated by: _SAS 2 PS 1. 0 May 1999 ((c) NV Organon, SAS 6. 12, WIN_NT). . . %%End. Comments %%Begin. Prolog … Define procedures and fonts %%End. Prolog %%Begin. Setup. . . Define Hyperlinks and Bookmarks %%End. Setup %%Page: 1 Describe page 1 … %%Page: 2 … Describe page 2 %%Trailer %%Document. Fonts: Courier Helvetica-Bold Helvetica %%Pages: 474 %%EOF
How to Use the Pdfmark Operator ? • Used in postscript files to represent PDF features. • General syntax: [ …. Various key-value pairs… kind pdfmark
How to Define PDF Bookmarks? [ /Title string /Count int …action-specific key-value pairs /OUT pdfmark
How to Define PDF Bookmarks? [/Title (F. 3 Extent of Exposure) /Count 3 /Page 121 /View [/XYZ 103 775 null] /OUT pdfmark [/Title (TAB 3. A Summary statistics of extent of exposure*Per Protocol group) /Page 122 /View [/XYZ 144. 6 116. 68 null] /OUT pdfmark [/Title (TAB 3. B Summary statistics of extent of exposure*All-Subjects-Treated group) /Page 125 /View [/XYZ 144. 6 116. 68 null] /OUT pdfmark [/Title (LIS 3. A Extent of exposure (treatment duration in days)*All-Subjects-Treated group) /Page 128 /View [/XYZ 144. 6 116. 68 null] /OUT pdfmark
How to Define PDF Hyperlinks? [ /Rect [llx lly urx ury] /Border [bx by c [d]] /Src. Pg pagenum /Color array /Subtype /Link …action-specific key-value pairs /ANN pdfmark
How to Define PDF Hyperlinks? 108 291 moveto (Listing 1. 3 -A) ushow 205 291 moveto (Subjects for whom the blind was broken during the study) show 205 283 moveto (All-Subjects-Randomized group) show (F-26) Calc Dots [ /Rect [ 106 581 528 601 ] /Color [0 0 1] /Page 25 /View [/XYZ 144 117 null] /Subtype /Link /ANN pdfmark
From SAS to Postscript • SAS macro %_SAS 2 PS • Parameters: Author creator of the appendix Apptype of appendix (STAT, IDL or CRF) Apptype=stat, sections will be generated. Apptype=idl, no sections will be generated. Apptype=crf, no sections will be generated. No table of contents will be generated. Special formatting can be applied with tags: <1> and <2> for bookmarks, <u>=underline, <b>=bold, <h>=helvetica
From SAS to Postscript • SAS macro %_SAS 2 PS • Parameters: Pagetext in pagenumber Filemask selection of files to include Maketoc generate table of contents (Y/N) ? T 1, . . . , t 24 character strings with section titles. Watermrk generate watermark (Y/N) ? Wmtext watermark text in case watermrk=y Bookmark generate bookmarks (Y/N) ?
From SAS to Postscript • SAS macro %_SAS 2 PS • Parameters: Firstpag starting pagenumber in output file. Inlib libname of library with input SAS files Outlib libname of library where postscript file will be written. Outfile name of postscript file.
%_SAS 2 PS Macro • Read in all text files • Sort by section, type and number • Generate table of contents • Generate postscript, including: – Bookmark / hyperlink information – Graphics
Conclusion • With SAS/Base and Acrobat Distiller it is possible to create PDF documents from SAS output. • This process is completely automated
Where to Get the Info? • First guide to postscript: http: //www. Cs. Indiana. Edu/docproject/ programming/postscript. Html • Pdfmark reference manual: http: //partners. Adobe. Com/asn/developer/ technotes. Html • Pdfmark primer by thomas merz: http: //www. Pdflib. Com/pdfmark/index. Html • Get ghostscript/ghostview: http: //www. Cs. Wisc. Edu/~ghost/index. Html
Questions ? PDF ? ? Postscript ? ? PDFMark ? ? SAS ? ?
Thank You !! Contact: lex. jansen@organon. com
- Slides: 40