c# open pdf file in browser : Delete page on pdf reader application Library tool html .net asp.net online ts6590-part1789

18MAR04
TS-659ExportingSAS/GRAPHOutputtoPDFFiles
fromRelease8.2andhigher
ThePortableDocumentFormatisacommonformatforstoringtextandgraphicsinasingledocument.Thisformat
supportshigh-resolutionsandmaintainsthepagelayoutwhentransmitted,viewed,andprinted.Theformatwas
developedbyAdobeSystemsIncorporatedandisbaseduponthePostScriptprinterlanguage.
TheprogrammostoftenusedtoviewPDFfilesisAdobe'sAcrobatReader.AcrobatReadercanbedownloadedforfree
fromAcrobatReaderDownloadSite.
FromSAS/GRAPHtherearetwobasicmethodsforexportinggraphstoPDFfiles:
!
Thenativedevicedrivers:PDFandPDFC
!
TheUniversalPrinter:PDF
ThenativedevicedrivermethodisusefulforexportingoutputfromasingleproceduretoaPDFdocument.Tocombine
outputfrommultipleproceduresinthesamedocument,thePDFUniversalprinterisrecommended.Withthismethod,itis
alsoeasiertocombineoutputfrombothtextandgraphicproceduresinthesamedocument.
ThePDFUniversalprinteralsosupportssomenewfeaturesinSAS9.0.Inthisrelease,thePDFUniversal
printersupportscompressiontoreducetheoverallfilesize.Alsoincludedisanewmethodfordefiningthepage
layoutusingtheODSLAYOUTfeatureoftheOutputDeliverySystem.Sectionsdiscussingthesenewfeatures
arehighlightedwiththe"9.0"logoshownontheleft.ThePDFandPDFCdevicedriversdonotsupporteither
compressionorODSLAYOUT.
SupportforfontembeddingwasaddedtothePDFUniversalprinterinSAS9.1.AdobeAcrobatinstalls
fourteenfontsthatitusestodisplayPDFdocuments.Textcreatedinthesefontswillalwaysdisplaycorrectly.If
textinthePDFfileusesafontthatisnotavailabletoAcrobatontherecipient'ssystem,afontsubstitutioncan
occurwhenthedocumentisdisplayed.Thismayaffectthelookofthedocument.Topreventfontsubstitutions,
fontsmusteitherbeinstalledontherecipient'ssystem,orembeddedwithinthedocument.Informationabout
thefontembeddingfeatureishighlightedwiththe"9.1"iconshownontheleft.
ItisalsopossibletocreatePDFfilesindirectlybyfirstgeneratingpostscriptfilesfromSASandthenconvertingthemto
thePDFformat.ThisdocumentonlydiscussesmethodsforcreatingPDFfilesdirectlyfromSAS.
Contents
A. The Native Device Drivers: PDF and PDFC 
1. Fonts  
2. Examples 
Sample Data 
a. Producing one graph from one procedure  
b. Producing multiple graphs from one procedure using a BY statement  
c. Producing multiple graphs from one procedure using RUN-group processing  
d. Producing multiple graphs from GREPLAY  
B. The Universal Printer: PDF 
1. Fonts 
a. Standard Fonts  
b. Embeddable Fonts  
2. ODS PDF Parameters and Options 
a. Parameters that write document information
Delete page on pdf reader - remove PDF pages in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Provides Users with Mature Document Manipulating Function for Deleting PDF Pages
cut pages from pdf preview; delete blank pages from pdf file
Delete page on pdf reader - VB.NET PDF Page Delete Library: remove PDF pages in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Visual Basic Sample Codes to Delete PDF Document Page in .NET
delete a page from a pdf without acrobat; delete a page from a pdf file
b. Parameters that control the bookmarks  
c. Parameters and options that affect page layout  
d. Compression  
3. Examples 
a. Producing a multi-page PDF file using multiple procedures  
b. Producing a one-page PDF file containing multiple graphs from multiple procedures using 
STARTPAGE  
c. Producing a one-page PDF file containing multiple graphs from multiple procedures using ODS 
LAYOUT and ODS REGION  
d. Producing a one-page PDF file containing multiple graphs and tables using ODS LAYOUT and 
ODS REGION  
e. Changing the Font Embedding Level  
C. Resources  
A.TheNativeDeviceDrivers:PDFandPDFC
TwoSAS/GRAPHdevicedrivers,PDFandPDFC,canbeusedtocreatePDFdocumentsfromasinglegraphics
procedure.ThePDFdevicedriverproducesmonochromeoutputwhilethePDFCdevicedrivergeneratescoloroutput.To
exportgraphicsusingagraphicsdevicedriver,bothaFILENAMEstatementandaGOPTIONSstatementshouldbe
defined.Thesestatementsspecifytheexportformat,thestoragelocation,andthenameofthefile.Forexample:
FILENAME 
output
"
myfile.pdf
"; 
GOPTIONS RESET=ALL DEVICE=
PDFC
GSFNAME=
output
GSFMODE=REPLACE; 
/* Graphics procedure goes here */
RUN;QUIT; 
Parametersinitalicscanbemodified.Inthiscode,theFILENAMEstatementassignsthefilerefOUTPUTtothelocation
MYFILE.PDF.ThesyntaxnecessaryfortheFILENAMEmayvarybyoperatingsystem.TheGOPTIONSstatementsets
theoutputformattocolorPDFusingDEVICE=PDFC.TheGOPTIONSstatementalsodirectstheoutputtothedefinedfile
locationusingtheGSFNAME=parameter.ItisalwaysagoodpracticetoincludetheQUIT;statementafterthelastRUN;
statementwhenexportingSAS/GRAPHoutputtographicsfiles.
WiththePDFandPDFCdevicedrivers,youcannotusetheGSFMODE=APPENDoptiontowritemultiplegraphstothe
samefile.Inorderforthesefilestocontainmultiplegraphs,allthegraphsmustbewrittenbyasingleprocedure.Thiscan
beaccomplishedusingBY-groupprocessing,RUN-groupprocessing,ortheGREPLAYprocedure.Examplesaregiven
below.
1.Fonts
Itisrecommendthatahardwarefont,onenativetothePDFformat,beusedtogeneratetheoutput.Textcreatedinafont
thatisalsoavailabletotheprogramviewingthefilewillberenderedinthecorrectfont.Fontsubstitutionscanoccurfor
anyfonttheviewingsoftwaredoesnothaveavailable.AcrobatReader,forinstance,onlyincludestheBase14postscript
fontswithitsdefaultinstallation.ThePDFandPDFCdevicedriversincludethesesame14Postscriptfonts.Thenamesof
thesefontsastheyareusedwiththesedevicedriversarelistedinthetablebelow.
Fontnamesarenotcase-sensitivebuttheymustbereferencedinquotes.
.
NamesfortheBase14Fonts
withthePDF/PDFCDeviceDrivers
Courier
Helvetica
Times-Roman
Symbol
Courier-Oblique
Helvetica-Oblique
Times-Italic
ZapfDingbats
Courier-Bold
Helvetica-Bold
Times-Bold
Courier-BoldOblique
Helvetica-BoldOblique
Times-BoldItalic
C# PDF File & Page Process Library SDK for C#.net, ASP.NET, MVC
VB.NET Page: Insert PDF pages; VB.NET Page: Delete PDF pages; VB.NET Annotate: PDF Markup & Drawing. XDoc.Word for XImage.OCR for C#; XImage.Barcode Reader for C#
delete page pdf acrobat reader; delete page in pdf online
C# PDF Page Insert Library: insert pages into PDF file in C#.net
page processing functions, such as how to merge PDF document files by C# code, how to rotate PDF document page, how to delete PDF page using C# .NET, how to
delete pages from pdf; delete pages pdf preview
Note:Ifyouhaveanexistingprogramthatreferencesthesefontsusingtheirhardwarenames,suchasHWPDF001for
theCourierfont,thesenamesarestillhonoredinSAS8.2andbeyondwhenusingthePDFandPDFCdevicedrivers.
2.Examples
ListedherearefourcommonmethodsforproducingoutputusingthenativePDFandPDFCdevicedrivers.These
include:
a. One g
r
aph f
r
om one p
r
ocedu
r
e  
b. Multiple g
r
aphs f
r
om one p
r
ocedu
r
e using a BY statement  
c. Multiple g
r
aphs f
r
om one p
r
ocedu
r
e using RUN-g
r
oup p
r
ocessing  
d. Multiple g
r
aphs f
r
om GREPLAY 
Eachmethodisdemonstratedinanexamplebelow.Thefollowingdataisusedinallexamplesinthisdocument.The
outputfromthisdatamayvaryinappearancebecausethesummaryvaluesarecalculatedrandomly.
data sample; 
length Season Region $12.; 
do Season='Spring','Summer','Fall','Winter'; 
do Region='North','East','South','Central','West'; 
Sales=ceil(ranuni(0)*10); 
output; 
end; 
end; 
run; 
VB.NET PDF Page Insert Library: insert pages into PDF file in vb.
PDF: Insert PDF Page. VB.NET PDF - How to Insert a New Page to PDF in VB.NET. Easy to Use VB.NET APIs to Add a New Blank Page to PDF Document in VB.NET Program.
delete pages on pdf file; reader extract pages from pdf
C# PDF remove image library: remove, delete images from PDF in C#.
Delete and remove all image objects contained in a to remove a specific image from PDF document page. PDF image in preview without adobe PDF reader component.
delete page numbers in pdf; delete pages on pdf online
a.Producingonegraphfromoneprocedure
ThisprogramgeneratesaPDFfilenamedPIE.PDFthathasonepageandonegraphinit,apiechart.TheHelvetica-Bold
fontisusedforallthetext.
goptions reset=all ftext="Helvetica-Bold" dev=pdfc gsfname=output gsfmode=replace; 
filename output 'pie.pdf'; 
pattern1 value=solid color=cx994477; 
pattern2 value=solid color=cx997744; 
pattern3 value=solid color=cx449977; 
pattern4 value=solid color=cx447799; 
pattern5 value=solid color=cx774499; 
proc gchart data=sample; 
pie region /sumvar=sales coutline=black  
percent=inside value=none slice=outside 
midpoints="North" "East" "Central" "West" "South"; 
run;quit; 
Note:thedifferentpagesinthePDFfilesgeneratedbythecodearerepresentedinthisdocumentasseparateJPEGscreenshots,nottheactualpages
inthePDFfiles.Imagesarenottoscale.
SnapshotofthePIE.PDFfile
VB.NET PDF delete text library: delete, remove text from PDF file
adobe PDF reader component installed. Able to pull text out of selected PDF page or all PDF document in .NET WinForms application. Able to delete text characters
delete pages from a pdf reader; add and delete pages in pdf
VB.NET PDF remove image library: remove, delete images from PDF in
Delete image objects in selected PDF page in ASPX a specific image from PDF document page in VB.NET PDF image in preview without adobe PDF reader component in
delete page pdf online; delete pages on pdf
b.ProducingmultiplegraphsfromoneprocedureusingaBYstatement
ThisprogramgeneratesaPDFfilenamedBYPIE.PDFthathasfourpageswithonepiechartoneachpage.The
Helvetica-Boldfontisusedforalltextinthedocument.
goptions reset=all ftext="Helvetica-Bold"  
hby=0 dev=pdfc gsfname=output gsfmode=replace; 
filename output 'bypie.pdf'; 
pattern1 value=solid color=cx994477; 
pattern2 value=solid color=cx997744; 
pattern3 value=solid color=cx449977; 
pattern4 value=solid color=cx447799; 
pattern5 value=solid color=cx774499; 
proc sort data=sample; 
by season; 
run; 
title1 height=22pt "#byval1 Sales by Region"; 
proc gchart data=sample; 
by season; 
pie region /sumvar=sales coutline=black noheading  
percent=inside value=none slice=outside 
midpoints="North" "East" "Central" "West" "South"; 
run;quit; 
SnapshotsofPages1-2oftheBYPIE.PDFfile
C# PDF: PDF Document Viewer & Reader SDK for Windows Forms
BurnAnnotation: Burn all annotations to PDF page. DeleteAnnotation: Delete all selected annotations. guidance for you to create and add a PDF document viewer &
delete page from pdf; delete a page from a pdf acrobat
C# PDF delete text Library: delete, remove text from PDF file in
PDF file in preview without adobe PDF reader component installed in code able to help users delete text characters to pull text out of selected PDF page or all
delete pages in pdf online; delete pages from a pdf document
c.ProducingmultiplegraphsfromoneprocedureusingRUN-groupprocessing
ThisprogramgeneratesaPDFfilenamedMULTIRUN.PDFthathastwopageswithonebarchartoneachpage.The
Helvetica-Boldfontisusedforallthetextinthedocument.
goptions reset=all ftext="Helvetica-Bold"  
dev=pdfc gsfname=output gsfmode=replace; 
filename output 'multirun.pdf'; 
pattern1 value=solid color=cx99ff99; 
pattern2 value=solid color=cxffcc33; 
pattern3 value=solid color=cxaa3311; 
pattern4 value=solid color=cx99ccff; 
proc gchart data=sample; 
where Region in("North" "East"); 
title1 'North and East Regions'; 
axis1 order=("North" "East"); 
hbar season /sumvar=sales patternid=midpoint width=5 
group=region nostats gaxis=axis1 
midpoints="Spring" "Summer" "Fall" "Winter"; 
run; 
where Region in("Central" "West" "South"); 
title1 'Central, South, and West Regions'; 
axis1 order=("Central" "South" "West"); 
hbar season /sumvar=sales patternid=midpoint width=5 
group=region nostats gaxis=axis1 
midpoints="Spring" "Summer" "Fall" "Winter"; 
run;quit; 
SnapshotsofPages1-2oftheMULTIRUN.PDFfile
d.ProducingmultiplegraphsfromGREPLAY
Thiscodestoresthegraphsfromeachprocedureinagraphicscatalog,thenreplaystheminonesteptotheoutputfile.
FirstthecatalogisdefinedandclearedusingthefirstGREPLAYstep.TheexportformatisdefinedontheGOPTIONS
statement,andtheNODISPLAYoptionisspecifiedsothegraphsarewrittenonlytothecatalog,nottheoutputfile.On
eachgraphicsprocedure,theGOUTparameterisusedtodirecttheoutputtotheMYCATcatalog.Whenallthegraphs
arecreated,theDISPLAYoptionissetsothegraphsarewrittentotheoutputfilebytheGREPLAYprocedure.
proc greplay igout=mycat nofs; 
delete _all_; 
run;quit; 
goptions reset=all ftext="Helvetica-Bold"  
dev=pdfc gsfname=output gsfmode=replace nodisplay; 
filename output 'greplay.pdf'; 
pattern1 value=solid color=cx994477; 
pattern2 value=solid color=cx997744; 
pattern3 value=solid color=cx449977; 
pattern4 value=solid color=cx447799; 
pattern5 value=solid color=cx774499; 
proc gchart data=sample gout=mycat; 
pie region /sumvar=sales coutline=black  
percent=inside value=none slice=outside 
midpoints="North" "East" "Central" "West" "South"; 
run;quit; 
proc sort data=sample; 
by region season; 
run; 
symbol1 interpol=hilotf width=10 color=cx994477; 
symbol2 interpol=hilotf width=10 color=cx997744; 
symbol3 interpol=hilotf width=10 color=cx449977; 
symbol4 interpol=hilotf width=10 color=cx447799; 
symbol5 interpol=hilotf width=10 color=cx774499; 
axis1 offset=(5pct) order=("North" "East" "Central" "West" "South"); 
proc gplot data=sample gout=mycat; 
plot sales*region=region / haxis=axis1 nolegend; 
run;quit; 
goptions display; 
proc greplay igout=mycat nofs; 
replay _all_; 
run;quit; 
Inthisexample,eachgraphiswrittentoaseparatepageoftheoutput.YoucanalsospecifyatemplateintheGREPLAY
proceduretocombinemultiplegraphsonthesamepage.Todothis,eachgraphmustbeproperlysizedtofitinthe
template.Forexample:
proc greplay igout=mycat nofs; 
delete _all_; 
run;quit; 
goptions reset=all ftext="Helvetica-Bold" hby=0  
dev=pdfc gsfname=output gsfmode=replace nodisplay VSIZE=5; 
filename output 'greplay.pdf'; 
pattern1 value=solid color=cx994477; 
pattern2 value=solid color=cx997744; 
pattern3 value=solid color=cx449977; 
pattern4 value=solid color=cx447799; 
pattern5 value=solid color=cx774499; 
proc gchart data=sample gout=mycat; 
pie region /sumvar=sales coutline=black  
percent=inside value=none slice=outside 
midpoints="North" "East" "Central" "West" "South"; 
run;quit; 
proc sort data=sample; 
by region season; 
run; 
symbol1 interpol=hilotf width=10 color=cx994477; 
symbol2 interpol=hilotf width=10 color=cx997744; 
symbol3 interpol=hilotf width=10 color=cx449977;
;
SnapshotsofPages1-2oftheGREPLAY.PDFfile
symbol4 interpol=hilotf width=10 color=cx447799; 
symbol5 interpol=hilotf width=10 color=cx774499; 
axis1 offset=(5pct) order=("North" "East" "Central" "West" "South"); 
proc gplot data=sample gout=mycat; 
plot sales*region=region / haxis=axis1 nolegend; 
run;quit; 
goptions display VSIZE=10; 
proc greplay igout=mycat nofs TC=SASHELP.TEMPLT; 
template v2; 
treplay 1:gchart 2:gplot; 
run;quit; 
Withthesemodifications,bothgraphsarewrittentothesamepage,withthepiechartabovetheplot.ForSAS8.2and
beyond,theODSPDFmethodisrecommendedtocreatethiskindofoutput.
B.TheUniversalPrinter:PDF
ThePDFUniversalprintercanbeusefulforstoringtheoutputfrommultipleproceduresinthesamePDFfile.Oncethe
destinationisopen,allprocedureoutput,includingoutputfromtextprocedures,isdirectedtothedocument.Bydefault
eachtableorgraphiswrittentoaseparatepage.
YoucanproduceoutputwiththeUniversalPDFprinterbyspecifyingtheprinterforthePRINTERPATHoptiononthe
OPTIONSstatement,orastheprinterontheODSPRINTERstatement.
SpecifyingtheprinterontheOPTIONSstatementsetstheprinterasthedefaultprinter.YoucancreatePDFfileswiththe
printerbyusingsyntaxlikethefollowing:
OPTIONS PRINTERPATH=(PDF 
FILEREF
); 
FILENAME 
FILEREF
'
OUTPUT.PDF
'; 
GOPTIONS DEV=SASPRTC; 
/* Procedures go here */ 
RUN;QUIT; 
Parametersinitalicscanbemodified.ThedeviceSASPRTCmustbespecifiedtodirectthegraphicsoutputtothedefault
printer.
Formorecontrolovertheplacementofobjectsintheoutput,youcanusetheOutputDeliverySystemPRINTER
destinationinstead.Youmayeitherspecify:"ODSPRINTERPRINTER=PDF"or"ODSPDF";bothstatementsrefertothe
samedestination.ThebasiccodenecessarytogenerateaPDFfilewiththismethodisasfollows:
ODS PDF FILE="
filename.pdf
"; 
/* Procedures go here */
RUN;QUIT; 
ODS PDF CLOSE; 
Parametersinitalicscanbemodified.TheFILE=parametercanpointtoapredefinedfilereferenceordirectlytoafileas
shown.WhiletheODSdestinationisopen,allproceduraloutputiswrittentothefileFILENAME.PDF.Itisimportantto
includetheRUN;andQUIT;beforethe"ODSPDFCLOSE"statementwhichterminatesthedestination.Otherwisethe
outputfromthelastproceduremaynotbeincludedinthedocument.
BeforecreatingoutputtotheODSPDFdestination,itisrecommendedthattheODSLISTINGdestinationbeclosed.On
Windowssystems,theSASPRTCdevicedriverreferstothesystemprinterswhentheLISTINGdestinationisopened;
closingLISTINGpreventstheoutputfromgoingdirectlytotheprinter.
WhentheODSPDFdestinationisopen,theSASPRTCdevicedriverproducesgraphsinthePDFfileusingPDF
commands,andmakesavailabletothegraphallthefontsavailableintheODSPDFdestination.Youcouldalsospecify
devicedriverssuchasPNGorJAVAwhenproducinggraphsintheODSPDFdestination,althoughthesedevicedrivers
maynotrecognizethesamefontsetasthetextoutputinthedocument.
t.
TherecommendedstatementsforcreatingPDFdocumentswiththeODSPDFmethodareasfollows:
ODS LISTING CLOSE; 
GOPTIONS DEV=SASPRTC; 
ODS PDF FILE="
filename.pdf
"; 
/* Procedures go here */
RUN;QUIT; 
ODS PDF CLOSE; 
GOPTIONS RESET=ALL; 
ODS LISTING;  
TheremainderofthisdocumentfocusesonusingtheODSdestinationwiththePDFUniversalprintertocreatePDF
outputfiles.
1.Fonts
a.StandardFonts
ThefontsavailablewiththeODSPDFdestinationarelistedintheSASRegistryunderthe
[CORE\PRINTING\PRINTERS\PSL\FONTFAMILIES]key.RememberthatthesefontsarenotincludedinthePDFfile,so
onlythefontsinstalledwiththeReaderwillberenderedcorrectly.Therefore,unlessyouarecertainanon-standardfont
willbeavailableontherecipient'ssystem,itisrecommendedthattheBase14fonts,thoseincludedwiththedefault
installationofReader,beused.ForthePDFUniversalprinter,thesefontsarereferencedasfollows:
Fontnamesmustbeenclosedinquotesbuttheyarenotcase-sensitive.Theparameterslistedaftertheslashesmay
comeinanyorder.NoticethatthesenamesvaryfromthenamesusedwiththePDFandPDFCdevicedrivers.
b.EmbeddableFonts
UsingtheFreeTypelibrary,SAS9.1canembedTrueTypefontsinPDFfilescreatedwiththePDFUniversal
printer.Whenafontisembedded,fontinformationiscarriedinthedocument,andtheviewerdoesnotrequire
thatthefontbeinstalledonthesysteminorderforthetexttodisplayproperly.Embeddingfontscanprevent
fontsubstitutions,andensurethatthedocumentalwayshasthesamelook.
ThenewFONTREGprocedureisusedtoaddinformationaboutfontfilesonthesystemtotheSASRegistry.Thisstep
mustbeperformedbeforetheODSPDFdestinationcanembedthesefonts.InformationabouttwoTrueTypefonts,SAS
MonospaceandSASMonospace/bold,isalreadyaddedforyou.Tomakeotherfontsavailable,followthesteps
discussedinthepaper,UsingTrueTypefontswithUniversalPrintinginSAS9.1.
Threelevelsoffontembeddingaresupported:none,partial,andfull.ThedefaultlevelforthePDFUniversalPrinteris
partial.YoucanchangethesesettingsusingtheinstructionsinChangingtheEmbeddingValuebelow.
2.ODSPDFParametersandOptions
UsingtheODSPDFmethodallowsyoutoeasilycreatePDFfilescontainingmultiplegraphsandtable.Italsogivesyou
controloverotheraspectsofthePDFdocument,includingdocumentinformation,thetableofcontents(aka"bookmarks"),
andgreatercontroloverthepagelayout.Theparametersthatcanbespecifiedareasfollows:
ws:
NamesfortheBase14Fonts
withthePDFUniversalPrinter
Courier
Helvetica
Times
Symbol
Courier/oblique
Helvetica/oblique
Times/italic
ITCZapfDingbats
Courier/bold
Helvetica/bold
Times/bold
Courier/bold/oblique
Helvetica/bold/oblique
Times/bold/italic
Documents you may be interested
Documents you may be interested