Top Banner
Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS software. Lex Jansen NV Organon Oss, The Netherlands
40

Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS software. Lex Jansen NV Organon Oss, The Netherlands.

Dec 23, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Creating PDF documents including

hyper-links, bookmarks and a table of contents with the SAS software.

Lex JansenNV Organon

Oss, The Netherlands

Page 2: 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

• %_SAS2PS

• Demo

Page 3: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

The Data Flow

CRF

Investigator

Electronic Submission

Document Management System (Documentum)

SAS Clinical Data Warehouse

ClinTrial

Data Entry(ClinTrial)

Page 4: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

The Data Flow

CRF

Document Management System (Documentum)

SAS Clinical Data Warehouse

ClinTrial

Electronic Submission

SAS

PDF

Page 5: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Why the PDF Format ?

• Independent of environment

• Easy navigation (hyperlinks, bookmarks)

• Easy distribution (free acrobat reader)

• The FDA wants it

Page 6: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

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.”

Page 7: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Types of Appendices

• Statistical analyses (STAT)(different sections with:tables, analyses, graphics, listings)

• Individual data listings (IDL)

• Case report form tabulations (CRF)

Page 8: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Statistical Analysis

Page 9: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Individual Data Listing

Page 10: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Case Report Form Tabulation

Page 11: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Environment

• Windows NT, SP 4

• Sas 6.12, TS070, only SAS/Base

• Adobe Acrobat distiller 4.05

Page 12: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

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 V8.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!!

Page 13: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

How to Get From SAS to PDF

Tables

Analyses

Graphics

SAS output

%_sas2ps

%_ps2pdf + Acrobat Distiller

Listings

PDF file

Postscript file

Page 14: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

From Postscript to PDF

PS2PDF

OUT

IN

AcrobatDistillerwatches

AcrobatDistillerconverts

Convert!! x

Page 15: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

SAS Output Conventions

• Portrait : linesize=94 pagesize=87Landscape : linesize=145 pagesize=56

• Options NOCENTER NODATE NONUMBER

• Conventions for TITLES and FOOTNOTES

• Graphic output uses postscript DEVICE=PSL

Page 16: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

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 2.8-1.B

Page 17: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Table ofContents

Page 18: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

SAS Output Conventions - Footnotes

| SD | | | 3.54|| Minimum | 20| 25| 20||____________________________|_________|_________|_________|

(CONTINUED) Compound: Puregon (E1650), SAS program: tab_cycle /Date:21MAR2000 16:23

Page 19: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

SAS Output Conventions - Graphics

• Graphics are generated with a postscript device (PSL)

• Every graphic has a corresponding text file with the title in it

Text file with titlePostscript file

Page 20: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

SAS 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 1+2 [nmol/L] Outliers excluded Per Protocol group

Text file with titlePostscript file

Page 21: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.
Page 22: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

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)

Page 23: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Postscript - Coordinate System

A4

(0,0)

(595,842)

=

8,3 inch x11,7 inch

1 inch

=

72 points

Page 24: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Postscript - Coordinate System

Letter

(0,0)

(612,792)

=

8,5 inch x11 inch

1 inch

=

72 points

Page 25: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Postscript - Adding Text

/Helvetica-Bold findfont 8 scalefont setfont

108 730 moveto (Listing 4) ushow205 730 moveto (Dosing Compliance.) show

/Helvetica findfont 8 scalefont setfont

205 723 moveto (Descriptives per Subject and per Cycle.) show205 716 moveto (Intent-to-Treat Group.) show

Listing 4 Dosing Compliance.Descriptives per Subject and per Cycle.Intent-to-Treat Group.

Choose fontX-coordinate Y-coordinate moveto (text to show) show

Page 26: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Postscript - Document Structuring Conventions

%!PS-Adobe-3.0%%Title: Protocol 068004 Appendix F%%CreationDate: 29MAR2000 18:31%%Generated by: _SAS2PS 1.0 May 1999 ((c) NV Organon, SAS 6.12, WIN_NT)...%%EndComments%%BeginProlog…%%EndProlog%%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

Page 27: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

• Used in postscript files to represent PDF features.

• General syntax:

[…. Various key-value pairs…

kind pdfmark

How to Use the Pdfmark Operator ?

Page 28: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

How to Define PDF Bookmarks?

[ /Title string/Count int…action-specific key-value pairs

/OUT pdfmark

Page 29: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

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

Page 30: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

How 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

Page 31: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

How to Define PDF Hyperlinks?

[ /Rect [ 106 581 528 601 ] /Color [0 0 1] /Page 25 /View [/XYZ 144 117 null] /Subtype /Link/ANN pdfmark

108 291 moveto (Listing 1.3-A) ushow205 291 moveto (Subjects for whom the blind was broken during the study) show205 283 moveto (All-Subjects-Randomized group) show(F-26) Calc Dots

Page 32: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

From SAS to Postscript

• SAS macro %_SAS2PS

• Parameters:

Author creator of the appendix

Apptype type 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

Page 33: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

From SAS to Postscript

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 watermrk=y

Bookmark generate bookmarks (Y/N) ?

• SAS macro %_SAS2PS

• Parameters:

Page 34: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

From SAS to Postscript

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 macro %_SAS2PS

• Parameters:

Page 35: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

%_SAS2PS Macro

• Read in all text files

• Sort by section, type and number

• Generate table of contents

• Generate postscript, including:

– Bookmark / hyperlink information– Graphics

Page 36: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.
Page 37: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Conclusion

• With SAS/Base and Acrobat Distiller it is possible to create PDF documents from SAS output.

• This process is completely automated

Page 38: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Where to Get the Info?• First guide to postscript:

http://www.Cs.Indiana.Edu/docproject/programming/postscript/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

Page 39: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Questions ?

Postscript ??PDF ??

SAS ??

PDFMark ??

Page 40: Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS  software. Lex Jansen NV Organon Oss, The Netherlands.

Thank You !!

Contact:

[email protected]