Creating PDF documents including hyper-links, bookmarks · PDF file ·...
Transcript of Creating PDF documents including hyper-links, bookmarks · PDF file ·...
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Creating PDF documents includinghyper-links, bookmarks and a table of
contents with the SAS software.
Lex Lex JansenJansenNVNV OrganonOrganon
Oss, The NetherlandsOss, The Netherlands
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
ContentsContents•• Data flowData flow•• Why PDF ?Why PDF ?•• Types of appendicesTypes of appendices•• From SAS to Postscript to PDFFrom SAS to Postscript to PDF•• SAS output conventionsSAS output conventions•• PostscriptPostscript•• PDF mark operatorPDF mark operator•• %_SAS2PS%_SAS2PS•• DemoDemo
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
The Data FlowThe Data FlowCRF
Investigator
ElectronicSubmission
Document ManagementSystem (Documentum)
SAS ClinicalData Warehouse
ClinTrial
Data Entry(ClinTrial)
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
The Data FlowThe Data FlowCRF
Document ManagementSystem (Documentum)
SAS ClinicalData Warehouse
ClinTrial
ElectronicSubmission
SAS
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Why the PDF Format ?Why the PDF Format ?
•• Independent of environmentIndependent of environment•• Easy navigation (hyperlinks, bookmarks)Easy navigation (hyperlinks, bookmarks)•• Easy distribution (free acrobat reader)Easy distribution (free acrobat reader)•• The FDA wants itThe FDA wants it
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Types of AppendicesTypes of Appendices
•• Statistical analyses (Statistical analyses (STATSTAT))(different sections with:(different sections with:tables, analyses, graphics, listings)tables, analyses, graphics, listings)
•• Individual data listings (Individual data listings (IDLIDL))•• Case report form tabulations (Case report form tabulations (CRFCRF))
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Statistical AnalysisStatistical Analysis
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Individual Data ListingIndividual Data Listing
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Case Report Form TabulationCase Report Form Tabulation
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
EnvironmentEnvironment
•• Windows NT, SP 4Windows NT, SP 4•• SasSas 6.12, TS045, only 6.12, TS045, only SAS/SAS/basebase•• Acrobat distiller 3.Acrobat distiller 3.02 / 4.0502 / 4.05
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
How Do We Get From SAS to PDF?How Do We Get From SAS to PDF?•• Install complete acrobat package and use theInstall complete acrobat package and use the
acrobatacrobat pdfwriter pdfwriter printerdriver printerdriverBut, no bookmarks and hyperlinksBut, no bookmarks and hyperlinks
•• SAS version 8 can generate PDF output for graphicsSAS version 8 can generate PDF output for graphicsoutputoutput
•• The future might bring PDF output with the outputThe future might bring PDF output with the outputdelivery system (ODS)delivery system (ODS)Bookmarks and hyperlinks ???Bookmarks and hyperlinks ???
•• Solution: create postscript with SAS and useSolution: create postscript with SAS and useacrobat distiller and the acrobat distiller and the pdfmark pdfmark operator!!operator!!
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
How to Get From SAS to PDFHow to Get From SAS to PDF
TablesAnalyses
Graphics
SAS output
%_sas2ps
%_ps2pdf +Acrobat Distiller
Postscript file
Listings
PDF file
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
From Postscript to PDFFrom Postscript to PDF
PS2PDF
OUT
IN
AcrobatDistillerwatches
AcrobatDistillerconverts
XConvert!!
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
SAS Output ConventionsSAS Output Conventions
•• PortraitPortrait linesize=94linesize=94 pagesize=87pagesize=87landscapelandscape linesize=145linesize=145 pagesize=56pagesize=56
•• Options NOCENTER NODATE NONUMBEROptions NOCENTER NODATE NONUMBER•• Conventions for TITLES and FOOTNOTESConventions for TITLES and FOOTNOTES•• Graphic output uses postscript DEVICE=PSLGraphic output uses postscript DEVICE=PSL
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
SAS Output ConventionsSAS Output Conventions- Titles- 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#Table 2.8-1.B#Table 2.8-1.B#Table 2.8-1.B
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Table ofTable ofContentsContents
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
SAS Output ConventionsSAS Output Conventions- Footnotes- Footnotes
| SD | | | 3.54|| Minimum | 20| 25| 20||____________________________|_________|_________|_________|
(CONTINUED)
Compound: Puregon (E1650), SAS program: tab_cycle /Date:21MAR2000 16:23
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
SAS Output ConventionsSAS Output Conventions- Graphics- Graphics
•• Graphics are generated with a postscriptGraphics are generated with a postscriptdevice (PSL)device (PSL)
•• Every graphic has a corresponding textEvery graphic has a corresponding textfile with the title in itfile with the title in it
Postscript file Text file with title
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
SAS Output ConventionsSAS Output Conventions- Graphics- Graphics
•• Graphics are generated with a postscriptGraphics are generated with a postscriptdevice (PSL)device (PSL)
•• Every graphic has a corresponding textEvery graphic has a corresponding textfile with the title in itfile with the title in it
Postscript file
#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 title
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
What Is Postscript?What Is Postscript?•• Page description languagePage description language•• A page is a graphic that can contain:A page is a graphic that can contain:
Lines, rectangles, curvesLines, rectangles, curvesText in various typefaces of any Text in various typefaces of any size and orientationsize and orientation
•• Device independentDevice independent•• Closely related to PDF (both adobe)Closely related to PDF (both adobe)
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Postscript - Coordinate SystemPostscript - Coordinate System
A4
(0,0)
(595,842)
=
8,3 inch x11,7 inch
1 inch=
72 points
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Postscript - Coordinate SystemPostscript - Coordinate System
Letter
(0,0)
(612,792)
=
8,5 inch x11 inch
1 inch=
72 points
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Postscript - Adding TextPostscript - 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
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Postscript - Document StructuringPostscript - Document StructuringConventionsConventions
%!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
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
•• Used in postscript files to represent PDFUsed in postscript files to represent PDFfeatures.features.
•• General syntax:General syntax:[[
…. Various key-value pairs……. Various key-value pairs…kind pdfmarkkind pdfmark
How to Use the Pdfmark Operator ?How to Use the Pdfmark Operator ?
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
How to Define PDF Bookmarks?How to Define PDF Bookmarks?
[[ /Title /Title stringstring/Count /Count intint…action-specific key-value pairs…action-specific key-value pairs
/OUT pdfmark/OUT pdfmark
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
How to Define PDF Bookmarks?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?How to Define PDF Hyperlinks?
[[ /Rect [/Rect [llx lly urx uryllx lly urx ury]]/Border [/Border [bx by cbx by c [ [dd]]]]/SrcPg /SrcPg pagenumpagenum/Color /Color arrayarray/Subtype /Link/Subtype /Link…action-specific key-value pairs…action-specific key-value pairs
/ANN pdfmark/ANN pdfmark
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
How to Define PDF Hyperlinks?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
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
From SAS to PostscriptFrom SAS to Postscript•• SAS macro %_SAS2PSSAS macro %_SAS2PS•• Parameters:Parameters:
AuthorAuthor creator of the appendixcreator of the appendixApptypeApptype type of appendix (STAT, IDL or CRF)type of appendix (STAT, IDL or CRF)
Apptype=Apptype=statstat, sections will be generated., sections will be generated.Apptype=Apptype=idlidl, no sections will be generated., no sections will be generated.Apptype=Apptype=crfcrf, no sections will be generated., no sections will be generated.
No table of contents will be generated.No table of contents will be generated.Special formatting can be applied with tags:Special formatting can be applied with tags:<1> and <2> for bookmarks,<1> and <2> for bookmarks,<u>=underline, <b>=bold, <h>=<u>=underline, <b>=bold, <h>=helveticahelvetica
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
From SAS to PostscriptFrom SAS to Postscript
PagetextPagetext text in pagenumbertext in pagenumberFilemaskFilemask selection of files to includeselection of files to includeMaketocMaketoc generate table of contents (Y/N) ?generate table of contents (Y/N) ?T1, ..., t24 T1, ..., t24 character strings with section titles.character strings with section titles.WatermrkWatermrk generate watermark (Y/N) ?generate watermark (Y/N) ?WmtextWmtext watermark text in casewatermark text in case watermrk watermrk=y=yBookmark Bookmark generate bookmarks (Y/N) ?generate bookmarks (Y/N) ?
•• SAS macro %_SAS2PSSAS macro %_SAS2PS•• Parameters:Parameters:
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
From SAS to PostscriptFrom SAS to Postscript
FirstpagFirstpag starting pagenumber in output file.starting pagenumber in output file.InlibInlib libnamelibname of library with input SAS files of library with input SAS filesOutlibOutlib libnamelibname of library where postscript file will be of library where postscript file will be
written.written.OutfileOutfile name of postscript file.name of postscript file.
•• SAS macro %_SAS2PSSAS macro %_SAS2PS•• Parameters:Parameters:
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
%_SAS2PS Macro%_SAS2PS Macro•• Read in all text filesRead in all text files•• Sort by section, type and numberSort by section, type and number•• Generate table of contentsGenerate table of contents•• Generate postscript, including:Generate postscript, including:
– Bookmark / hyperlink information– Graphics
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
ConclusionConclusion
•• With SAS/Base and Acrobat Distiller it isWith SAS/Base and Acrobat Distiller it ispossible to create PDF documents frompossible to create PDF documents fromSAS output.SAS output.
•• This process is completely automatedThis process is completely automated
!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$!"#$
Where to Get the Info?Where to Get the Info?•• First guide to postscript:First guide to postscript:
http://www.Cs.Indiana.http://www.Cs.Indiana.EduEdu//docprojectdocproject//programming/postscript/postscript.Htmlprogramming/postscript/postscript.Html
•• Pdfmark reference manual:Pdfmark reference manual:http://partners.Adobe.Com/http://partners.Adobe.Com/asnasn/developer//developer/technotestechnotes.Html.Html
•• Pdfmark primer byPdfmark primer by thomas merz thomas merz::http://www.http://www.PdflibPdflib.Com/pdfmark/index.Html.Com/pdfmark/index.Html
•• GetGet ghostscript ghostscript//ghostviewghostview::http://www.Cs.http://www.Cs.WiscWisc..EduEdu/~ghost/index.Html/~ghost/index.Html
!"#$!"#$!"#$
!"#$!"#$!"#$
Questions ?Questions ?
Postscript ??PDF ??
SAS ??PDFMark ??