Title: Creating PDF documents including
1- Creating PDF documents including
- hyper-links, bookmarks and a table of contents
with the SAS? software. - Lex JansenNV Organon
- Oss, The Netherlands
2Contents
- Data flow
- Why PDF ?
- Types of appendices
- From SAS to Postscript to PDF
- SAS output conventions
- Postscript
- PDF mark operator
- _SAS2PS
- Demo
3The Data Flow
4The Data Flow
Electronic Submission
5Why the PDF Format ?
- Independent of environment
- Easy navigation (hyperlinks, bookmarks)
- Easy distribution (free acrobat reader)
- The FDA wants it
6Types of Appendices
- Statistical analyses (STAT)(different sections
withtables, analyses, graphics, listings) - Individual data listings (IDL)
- Case report form tabulations (CRF)
7Statistical Analysis
8Individual Data Listing
9Case Report Form Tabulation
10Environment
- Windows NT, SP 4
- Sas 6.12, TS045, only SAS/base
- Acrobat distiller 3.02 / 4.05
11How Do We Get From SAS to PDF?
- Install complete acrobat package and use the
acrobat pdfwriter printerdriver - But, no bookmarks and hyperlinks
- SAS version 8 can generate PDF output for
graphics output - The future might bring PDF output with the output
delivery system (ODS) - Bookmarks and hyperlinks ???
- Solution create postscript with SAS and use
acrobat distiller and the pdfmark operator!!
12How to Get From SAS to PDF
Tables
Analyses
_sas2ps
Graphics
_ps2pdf Acrobat Distiller
SAS output
13From Postscript to PDF
Convert!!
X
14SAS Output Conventions
- Portrait linesize94 pagesize87landscape linesi
ze145 pagesize56 - Options NOCENTER NODATE NONUMBER
- Conventions for TITLES and FOOTNOTES
- Graphic output uses postscript DEVICEPSL
15SAS 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 lt 41 days. _____________________________
_____________________________ Minimum cycle
length (days) Puregon
Table 2.8-1.B
Table 2.8-1.B Summary statistics of
minimum cycle length.
All-Subjects-Treated Group.
Restricted to subjects with irregular cycle
length lt 41 days. _____________________________
_____________________________ Minimum cycle
length (days) Puregon
16Table of Contents
17SAS Output Conventions- Footnotes
SD
3.54 Minimum
20 25 20 _________________________
______________________________ (CONTINUED)
Compound Puregon (E1650), SAS program
tab_cycle /Date21MAR2000 1623
18SAS Output Conventions- Graphics
- Graphics are generated with a postscript device
(PSL) - Every graphic has a corresponding text file with
the title in it
19SAS Output Conventions- Graphics
- Graphics are generated with a postscript device
(PSL) - Every graphic has a corresponding text file with
the title in it
Figure 6.1.E ANCOVA model check normal Q-Q
plot of studentized residuals
Outcome variable (Prothrombin) Fragment 12
nmol/L Outliers excluded
Per Protocol group
20(No Transcript)
21What 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)
22Postscript - Coordinate System
A4
1 inch 72 points
23Postscript - Coordinate System
Letter
1 inch 72 points
24Postscript - Adding Text
Listing 4 Dosing Compliance. Descriptives per
Subject and per Cycle. Intent-to-Treat Group.
Choose fontX-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
25Postscript - Document Structuring Conventions
!PS-Adobe-3.0 Title Protocol 068004 Appendix
F CreationDate 29MAR2000 1831 Generated by
_SAS2PS 1.0 May 1999 ((c) NV Organon, SAS 6.12,
WIN_NT) ... EndComments BeginProlog EndPro
log BeginSetup ... EndSetup Page
1 Page 2 Trailer DocumentFonts
Courier Helvetica-Bold Helvetica Pages
474 EOF
Define procedures and fonts
Define Hyperlinks and Bookmarks
Describe page 1
Describe page 2
26How to Use the Pdfmark Operator ?
- Used in postscript files to represent PDF
features. - General syntax
- . Various key-value pairskind pdfmark
27How to Define PDF Bookmarks?
/Title string /Count int action-specific
key-value pairs /OUT pdfmark
28How 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 exposurePer Protocol
group) /Page 122 /View /XYZ 144.6 116.68
null /OUT pdfmark /Title (TAB 3.B Summary
statistics of extent of exposureAll-Subjects-Trea
ted 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
29How to Define PDF Hyperlinks?
/Rect llx lly urx ury /Border bx by c
d /SrcPg pagenum /Color array /Subtype
/Link action-specific key-value pairs /ANN
pdfmark
30How 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
31From SAS to Postscript
- SAS macro _SAS2PS
- Parameters
- Author creator of the appendix
- Apptype type of appendix (STAT, IDL or CRF)
- Apptypestat, sections will be generated.
- Apptypeidl, no sections will be generated.
- Apptypecrf, no sections will be
generated. No table of contents will be
generated. Special formatting can be applied
with tags lt1gt and lt2gt for bookmarks, ltugt
underline, ltbgtbold, lthgthelvetica
32From SAS to Postscript
- SAS macro _SAS2PS
- Parameters
- Pagetext text in pagenumber
- Filemask selection of files to include
- Maketoc generate table of contents (Y/N) ?
- T1, ..., t24 character strings with section
titles. - Watermrk generate watermark (Y/N) ?
- Wmtext watermark text in case watermrky
- Bookmark generate bookmarks (Y/N) ?
33From SAS to Postscript
- SAS macro _SAS2PS
- 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.
34_SAS2PS Macro
- Read in all text files
- Sort by section, type and number
- Generate table of contents
- Generate postscript, including
- Bookmark / hyperlink information
- Graphics
35Conclusion
- With SAS/Base and Acrobat Distiller it is
possible to create PDF documents from SAS output. - This process is completely automated
36Where to Get the Info?
- First guide to postscripthttp//www.Cs.Indiana.E
du/docproject/programming/postscript/postscript.H
tml - Pdfmark reference manual http//partners.Adobe.Co
m/asn/developer/technotes.Html - Pdfmark primer by thomas merzhttp//www.Pdflib.C
om/pdfmark/index.Html - Get ghostscript/ghostviewhttp//www.Cs.Wisc.Edu/
ghost/index.Html
37Demo
38Questions ?
PDF ??
Postscript ??
PDFMark ??
SAS ??
39Thank You !!
Contact lex.jansen_at_organon.com