devexpress asp.net mvc pdf viewer : Extract pages from pdf files Library control component .net web page azure mvc AppleShellScripting-20141-part617

Listing11-13 ResizinganimageusingImageEventsandosascript:09_osascript_images.sh 208
Listing11-14 UsingFIFOstocreatecircularpipes 214
Listing11-15 Asimpledaemonbasedonnetcat 216
Listing11-16 Asimpleclientbasedonnetcat 219
PerformanceTuning
222
Table12-1
Performance(inseconds)impactofduplicatingcommoncodetoavoidredundanttests 230
Table12-2
Performance(inseconds)comparisonsof1000executionsofvariouscontrolstatementsequences
230
Table12-3
Performance(inseconds)of1000iterations,performingeachcomputationonceortwice 231
Table12-4
Relativeperformance(inseconds)of1000iterationsofthe
echo
builtinandthe
echo
command
231
Table12-5
Relativeperformance(inseconds)of1000iterationsofshellmath,
expr
,and
bc
232
Table12-6
Relativeperformance(inseconds)ofdifferentusecasesfor
sed
233
Listing12-1
AbinarysearchversionoftheBourneshell
ord
subroutine 225
CommandLinePrimer
255
TableA-1
Specialpathcharactersandtheirmeaning 256
TableA-2
Inputandoutputsourcesforprograms 258
TableA-3
Frequentlyusedcommandsandprograms 260
TableA-4
Gettingalistofshellbuiltins 264
SpecialShellVariables
265
TableB-1
Specialshellvariables 265
OtherToolsandInformation
267
TableC-1
Commonlyusedgeneralscriptingtools 267
TableC-2
Commonlyusedtextprocessingtools 268
TableC-3
Commonlyusedfilemanipulationtools 269
TableC-4
Commonlyuseddisk-relatedandpartition-relatedtools 270
TableC-5
Commonlyusedarchivingandcompressiontools 271
StartingPoints
273
ListingD-1
Copyingafolderrecursively 273
ListingD-2
Copyingmultiplefilesanddirectoriestoanotherlocation,preservingthedirectorystructure
273
ListingD-3
Copyingatreeoffilesandfoldersfromthecurrentdirectorytoaremotecomputer 273
ListingD-4
Copyingatreeoffilesandfoldersfromaremotecomputertothecurrentdirectory 274
ListingD-5
Codetorecoverfromatruncatedtarcopy 274
ListingD-6
Rotatinganimageusingsips 281
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
11
TablesandListings
Extract pages from pdf files - Library control component:C# PDF Page Extract Library: copy, paste, cut PDF pages in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Easy to Use C# Code to Extract PDF Pages, Copy Pages from One PDF File and Paste into Others
www.rasteredge.com
Extract pages from pdf files - Library control component:VB.NET PDF Page Extract Library: copy, paste, cut PDF pages in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Detailed VB.NET Guide for Extracting Pages from Microsoft PDF Doc
www.rasteredge.com
ListingD-7
SlowingdownanFTPserver 283
ListingD-8
Binarytreeexample 289
ListingD-9
binary_tree.shfromshttpd 290
ListingD-10 Scriptforaddinganewuserusingdscl(adduser.sh) 312
ListingD-11 Scriptforaddinganewgroupusingdscl(addgroup.sh) 320
AnExtremeExample:TheMonteCarlo(Bourne)MethodforPi
327
ListingE-1
AnIntegertoOctalConversionsubroutine 329
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
12
TablesandListings
Library control component:C# PDF Text Extract Library: extract text content from PDF file in
extraction from PDF images and image files. textMgr = PDFTextHandler. ExportPDFTextManager(doc); // Extract text content for text extraction from all PDF
www.rasteredge.com
Library control component:VB.NET PDF Text Extract Library: extract text content from PDF
Extract highlighted text out of PDF document. Image text extraction control provides text extraction from PDF images and image files.
www.rasteredge.com
ShellscriptsareafundamentalpartoftheOSXprogrammingenvironment.AsaubiquitousfeatureofUNIX
andUNIX-likeoperatingsystems,theyrepresentawayofwritingcertaintypesofcommand-linetoolsinaway
thatworksonafairlybroadspectrumofcomputingplatforms.
Becauseshellscriptsarewritteninaninterpretedlanguagewhosepowercomesfromexecutingexternal
programstoperformprocessingtasks,theirperformancecanbesomewhatlimited.However,becausethey
canexecutewithoutanyadditionaleffortonnearlyanymodernoperatingsystem,theyrepresentapowerful
toolforbootstrappingothertechnologies.Forexample,the
autoconf
tool,usedforconfiguringsoftware
priortocompilation,isaseriesofshellscripts.
Youshouldreadthisdocumentifyouareinterestedinlearningthebasicsofshellscripting.Thisdocument
assumesthatyoualreadyhavesomebasicunderstandingofatleastoneproceduralprogramminglanguage
suchasC.Itdoesnotassumethatyouhaveverymuchknowledgeofcommandsexecutedfromtheterminal,
though,andthusshouldbereadableevenifyouhaveneverruntheTerminalapplicationbefore.
ThetechniquesinthisdocumentarenotspecifictoOSX,althoughthisdocumentdoesnotevariousquirksof
certaincommand-lineutilitiesinvariousoperatingsystems.Inparticular,itincludesinformationaboutsome
caseswheretheOSXversionsofcommand-lineutilitiesbehavedifferentlythanothercommonlyavailable
versionssuchastheGNUequivalentscommonlyusedinLinuxandsomeBSDsystems.
Thisdocumentisnotintendedtobeacompletereferenceforshellscripting,assuchasubjectcouldfillentire
libraries.However,itisintendedtoprovideenoughinformationtogetyoustartedwritingandcomprehending
shellscripts.Alongtheway,itprovideslinkstodocumentationforvariousadditionaltoolsthatyoumayfind
usefulwhenwritingshellscripts.
Foryourconvenience,manyofthescriptsinthisdocumentarealsoincludedinthe“CompanionFile”Zip
archive.YoucanfindthisarchiveintheheadingareawhenviewingthisdocumentinHTMLformonthe
developer.apple.comwebsite.
OrganizationofThisDocument
Thisdocumentisorganizedasaseriesoftopics.Thesetopicscanbereadlinearlyasatutorial,butarealso
organizedwiththeintenttobeaquickreferenceonkeysubjects.
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
13
Introduction
Library control component:C# PDF Image Extract Library: Select, copy, paste PDF images in C#
DotNetNuke), SharePoint. Get JPG, JPEG and other high quality image files from PDF document. Able to extract vector images from PDF. Extract
www.rasteredge.com
Library control component:C# PDF Page Insert Library: insert pages into PDF file in C#.net
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 reorganize PDF document pages and how
www.rasteredge.com
BeforeYouBegin (page 15)—explainshowtogetacommandpromptinOSXandotheroperatingsystems,
providespointerstodocumentationaboutusingthecommandlineinteractively,andprovidesuseful
command-linetips(suchashowtoentercontrolcharacters).
ShellScriptBasics (page 21)—introducesbasicconceptsofshellscripting,includingvariables,control
statements,fileI/O,pipes,redirection,andargumenthandling.
Subroutines,Scoping,andSourcing (page 83)—describeshowtoobtainresultcodesfromoutside
executables,howtowriteandcallsubroutines,subroutinevariablescopingrules,howtoincludeoneshell
scriptinsideanother(sourcing),andhowtousejobcontroltoruntasksinthebackground.
PaintbyNumbers (page 93)—explainshowtouseintegermathinshellscripts.Thissectionalsoexplains
howtousethe
bc
command-lineutilityorPerltohandlemorecomplexmath,suchasfloating-point
calculations.
RegularExpressionsUnfettered (page 100)—describesbasicandextendedregularexpressionsandhow
tousethem.Thissectionalsodescribesthedifferencesbetweentheseregularexpressiondialectsandthe
dialectsupportedbyPerl,andshowshowtousePerlregularexpressionsthroughinlinescripting.
HowAWK-ward (page 122)—explainstheAWKcommand,whichprovidesadata-drivenprogramming
languagebasedonregularexpressionsandtabulardata.
DesigningScriptsforCross-PlatformDeployment (page 146)—describeskeydifferencesintheshellscripting
environmentsprovidedbyvariousoperatingsystemsandprovidestipsforwritingportablescripts.
AdvancedTechniques (page 168)—showsyouhowtosimulatedatastructuresandpointers,perform
nonblockingI/O,writetimingloops,trapsignals,usespecialbuilt-inshellvariables,drawstyledtextusing
ANSIcolorandformattingcommands,findtheabsolutepathofascript,use
osascript
tomanipulate
graphicalapplications,andusefiledescriptorsandnamedpipestotreatcommand-linetoolsasfilters.
PerformanceTuning (page 222)—describestechniquesforimprovingtheperformanceofcomplexscripts.
OtherToolsandInformation (page 267)—providesabasicsummaryofvariouscommandsthatmaybe
usefultoshellscriptdevelopers,includinglinkstoOSXdocumentationforeachofthem.
StartingPoints (page 273)—providesseveralsampleshellscriptsandsnippetsthatautomatereal-world
tasks.Thisappendixalsoprovideslinkstoothercompleteexampleselsewhereinthebook.
AnExtremeExample:TheMonteCarlo(Bourne)MethodforPi (page 327)—providesacomplexexample
toshowcasethepowerofshellscriptstoperformcomplextasks(slowly).Thecodeexampleshowsashell
scriptimplementationoftheMonteCarlomethodforapproximatingthevalueofPi.Thecodeexample
takesadvantageofanumberofnumericalandstringhandlingtechniquesdescribedintheprevious
chapters.Byshowingsomeofthesamecalculationswritteninmultipleways,italsoillustrateswhyitis
oftenbeneficial,performance-wise,toembedscriptswritteninotherlanguagessuchasPerlorAWKwhen
attemptingtasksthatsuitthoselanguagesbetter.
Happyscripting!
Introduction
OrganizationofThisDocument
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
14
Library control component:VB.NET PDF File Merge Library: Merge, append PDF files in vb.net
Merge two or several separate PDF files together and into one PDF document in VB.NET. Combine multiple specified PDF pages in into single one file.
www.rasteredge.com
Library control component:C# PDF File & Page Process Library SDK for C#.net, ASP.NET, MVC
PDF, C# print PDF, C# merge PDF files, C# view PDF online, C# convert PDF to tiff, C# read PDF, C# convert PDF to text, C# extract PDF pages, C# comment
www.rasteredge.com
Beforeyoubeginwritingshellscripts,youshouldfamiliarizeyourselfabitwiththeshellenvironment.
ObtainingaShellPrompt
Therearemanywaystogetshellaccess,dependingontheoperatingsystemyouarerunning.
InOSX
TherearefourwaystogetashellpromptinOSX:
RunTerminal.
Thisis,byfar,theeasiestwaytogetashellprompt.IthastheadvantageofprovidingaccesstootherGUI
applicationsatthesametime.Thisistherecommendedwaytogetshellaccess.
YoucanfindTerminalintheUtilitiesfolderinsideyourApplicationsfolder.
ConnectviaSSH(secureshell).
First,enable“RemoteLogin”intheSharingpreferencespane.
Next,usetheSSHclientofyourchoicetologin.Forexample,youmightusethe
ssh
commandinTerminal
torunscriptsonaremotecomputer.Formoreinformation,seethedocumentationfor
ssh
.
UsetheOSX(Mach)console.
InSystemPreferences,opentheAccountspreferencepane(UsersinOSXv10.1andearlier),andsetthe
“Displayloginwindowas”settingto“NameandPassword”.Thenlogout.
Next,attheloginwindow,Type
>console
astheusername.(Leavethepasswordfieldblank.)
Youwillthenseeatext-basedloginprompt.Loginwithyour“shortname”andpassword.
Logout(type
exit
or
logout
andpressreturn)togetbacktoGUI-land(orjustenterafewwrong
passwordsinarow).
Bootsingleuser.
Thisenvironmentisnotgenerallyrecommendedforscripting.Ittakesconsiderableefforttoenable
networking,mountexternaldisks,andenableotherfunctionality.Also,therootvolumeismounted
read-onlybydefault.Asaresult,thismodeismainlyusefulfordisasterrecovery.
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
15
Before You Begin
Library control component:C# PDF File Split Library: Split, seperate PDF into multiple files
can split target PDF document file by specifying a page or pages. If needed, developers can also combine generated split PDF document files with other PDF
www.rasteredge.com
Library control component:VB.NET PDF File Split Library: Split, seperate PDF into multiple
split target multi-page PDF document file to one-page PDF files or they can separate source PDF file to smaller PDF documents by every given number of pages.
www.rasteredge.com
InOtherUNIXVariantsorLinuxVariants
InmostotherUNIXorLinuxvariants,youcangainaccesstoashellbyrunningXTerm,GTerm,KTerm,Terminal,
orsomeothersimilarlynamedapplication.Alternatively,ifyoulogintosuchamachineremotelyusing
ssh
,
youshouldgetashellpromptassoonasyoulogin.
SomeUNIXorLinuxvariantsprovideatext-basedloginprompt.Onthesesystems,yougenerallygetashell
promptassoonasyoulogin.
InWindows
AlthoughWindowsdoesnotprovideashell,youcanaddonebyinstallingCygwin.Instructionsforinstalling
Cygwinarebeyondthescopeofthisdocument.Seehttp://www.cygwin.com/formoreinformation.
Note:  TheCygwinenvironmentisnotacompleteUNIXshellscriptingenvironment.Theexamples
inthisdocumenthavenotbeentestedinCygwinandarenotguaranteedtoworkcorrectlyinthe
Cygwinenvironment.
FamiliarizeYourselfWiththeCommandLine
ReadCommandLinePrimer (page 255)togetagoodoverviewofhowtogetthingsdoneinacommandline
environment.
TipsforShellUsers
Whilethisdocumentisprimarilyfocusedonwritingshellscripts,thereareafewhelpfultipsthatcanbeuseful
toshellusersandprogrammersalike.Thissectionincludesafewofthosetips.
ThealiasBuiltin
VariousBourneshellsalsoofferanumberofotherbuiltincommandsthatyoumayfinduseful,oneofthemore
usefulforcommand-lineusersbeing
alias
.Thiscommandallowsyoutoassignashortnametoreplacea
longercommand.Whilethe
alias
builtinisnotfrequentlyusedinshellscripts(unlessyouareintentionally
tryingtoobfuscateyourcode),itisveryconvenientwhenusingtheshellinteractively.Forexample:
alias listsource="ls *.c *.h"
BeforeYouBegin
FamiliarizeYourselfWiththeCommandLine
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
16
Library control component:C# PDF Convert to HTML SDK: Convert PDF to html files in C#.net
How to Use C#.NET Demo Code to Convert PDF Document to HTML5 Files in C#.NET Class. Add necessary references: RasterEdge.Imaging.Basic.dll.
www.rasteredge.com
Typingthecommand
listsource
afterenteringthislinewillresultinlistingallofthe
.c
and
.h
filesinthe
currentdirectory.
Formoreinformation,seethemanpage
builtins
,orforZSH,
zshbuiltins
.
C Shell Note:  TheCshellsyntaxissimilar,butnotidentical.IntheCshell,theequalssignisreplaced
withaspace.Forexample:
alias listsource "ls *.c *.h"
Analiasisonlyactivefortheremainderofthecurrentshellsession.Tomakeanaliaspermanent,youmust
addittoanappropriatescriptthatgetsrunautomaticallywheneveryourshellstartsup.SeeLoginScripts (page
17)tolearnhow.
Formoreinformation,seethemanualpageforyourloginshell(forexample,
bash
,
csh
,
sh
,
tcsh
,or
zsh
).
LoginScripts
OSXprovidessupportforloginscriptsandenvironmentpropertyliststoallowyoutosetenvironmentvariables
andaliasesthatareautomaticallysetwheneveryourunanewshell.Therearetwowaystodothis:
Bourneshell(bash,zsh,andsoon):
Topersistentlysetenvironmentvariablesandaddaliases,youcanaddtheappropriate
alias
,variable
assignment,and
export
commandstothefollowingfiles:
~/.profile
—executedautomaticallyforallloginshells.
~/.bash_profile
—similarto
.profile
,butonlyrunsfor
bash
loginshells.
~/.bashrc
and
~/.zshrc
—executedautomaticallyforallnon-login
bash
or
zsh
shells(whenyou
explicitlytype
bash
or
zsh
onthecommandlineorrunascriptthatstartswith
#!/bin/bash
or
#!/bin/zsh
).
Youmayalsofinditusefultocreatea
.bashrc
filethatsourcesyour
.profile
file.Forexample:
. $HOME/.profile
SourcingisdescribedinmoredetailinSubroutines,Scoping,andSourcing (page 83).
Cshell(csh,tcsh,andsoon):
BeforeYouBegin
TipsforShellUsers
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
17
Topersistentlysetenvironmentvariablesandaddaliases,youcanaddtheappropriate
alias
,
set
,and
setenv
commandstothefollowingfiles:
~/.login
—automaticallyexecutesforallloginshells.
~/.cshrc
—automaticallyexecutesforallnon-loginshells(whenyouexplicitlytype
bash
onthe
commandlineorrunascriptthatstartswith
#!/bin/csh
or
#!/bin/tcsh
).
Youmayalsofinditusefultocreatea
.cshrc
filethatsourcesyour
.login
file.Forexample:
source $HOME/.login
SourcingisdescribedinmoredetailinSubroutines,Scoping,andSourcing (page 83).
EnteringSpecialCharacters
Someshellstreattabsandothercontrolcharactersinspecialways.Whenwritingascriptinatextfile,the
reuseofthesecharactersforshell-specificpurposesisnotgenerallyanissue.However,whenenteringcommands
onthecommandline,itmaygetinthewayifyouneedtoenteranyofthesecharactersaspartofacommand
forsomereason.
Toenterataborothercontrolcharacteronthecommandline,typecontrol-vfollowedbythetabkeyorother
controlcharacter.Thecontrol-vtellstheshelltotreatwhatevercharactercomesnextliterallywithoutinterpreting
itinanywayduringentry.
Forexample,toentertheASCIIbellcharacter(control-G),youcantypethefollowing:
echo "control-V control-G"
Thiswillbeseenonyourscreenas:
echo "^G"
Whenyoupressreturn,yourcomputershouldbeep.
CreatingTextFilesinYourHomeDirectory
Invariouspartsofthisdocument,youneedtocreateatextfileandsaveitintoyourhomedirectory.
InTerminal,yourhomedirectoryisthedirectorythatyouareinwhenyoufirstopentheTerminalwindow.
BeforeYouBegin
CreatingTextFilesinYourHomeDirectory
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
18
IntherestofOSX,yourhomedirectorycanbefoundinthe“PLACES”listinFinderwindowsidebars,Save
dialogsidebars,andsoon.It'stheiconthatlookslikeahouse.Yourhomedirectoryisalsothedefaultlocation
ifyoucreateanewfinderwindowbychoosingFile>NewFinderWindowinFinder.
CreatingTextFileswithTextEdit
CreatingatextfileinTextEditisfairlystraightforward.
1. CreateanewfilebychoosingFile>New(fromtheFilemenu).
2. ChooseFormat>MakePlainText.
Bydefault,TextEditsavesfilesinRichTextFormat(RTF).ChoosingMakePlainTextfromtheFormatmenu
tellsitthatyouwanttoworkwithaplaintextfileinstead.
3. Typeorpasteinthescriptasdirectedinthetext.
4. ChooseFile>SaveAs.
5. IntheresultingSavedialog,scrollthesidebarontheleftuntilyouseethe“PLACES”section,andclickthe
houseiconbesideyourusername.
6. Namethefileasdirectedinthetextandsaveit.
Important:  IfyouarerunningOSXv10.7.3,anytextfilesyoucreatewithTextEditmayfailtoexecutewith
theerror“badinterpreter:Operationnotpermitted”.Tofixthisproblem,upgradetoOSXv10.7.4orlater
andpastethescriptintoanewfile.
CreatingTextFileswithXcode
CreatingatextfileinXcodeisfairlystraightforward.
1. CreateanewfilebychoosingFile>New>File...(fromtheFilemenu).
2. Choose“Other”inthe“OSX”sectionofthesidebar,thenchoose“ShellScript”asthefiletype.
3. Clickthe“Next”button.
4. IntheresultingSavedialog,clickthedisclosuretrianglesothattheentiresavepanelisvisible.Then,scroll
thesidebarontheleftuntilyouseethe“PLACES”section,andclickthehouseiconbesideyourusername.
5. Namethefileasdirectedinthetextandsaveit.
6. Typeorpasteinthescriptasdirectedinthetext.
7. ChooseFile>Save.
BeforeYouBegin
CreatingTextFilesinYourHomeDirectory
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
19
CreatingTextFileswithpicoornano
IfyouareloggingintoacomputerremotelyusingSSH,youmustuseatexteditorthatcanberunonthe
commandline(unlessyouuseX11forwardingandanX11-basededitor).
The
pico
and
nano
commandsaretwoveryeasycommand-linetexteditors.Atleastoneofthesecommands
isavailableinmostUNIXorLinux-basedoperatingsystems.
TocreateatextfileinNANOorPICO:
1. Type
nano
filenameor
pico
filenameandpressreturn.(Typethenameofthefileyouwanttocreate
oreditinsteadofthewordfilename.)
2. Editthefile.Usearrowkeystonavigate.
3. Whenyouarefinishedediting,pressControl-O.Adjustthenameofthefile(ifdesired),thenpressreturn
tosavethefiletodisk.
4. Toexittheeditor,pressControl-X.
Forothervalidcommands,seethelistofcontrolcharactersalongthebottomofthescreenorpressControl-G
formorecompletedocumentation.
BeforeYouBegin
CreatingTextFilesinYourHomeDirectory
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
20
Documents you may be interested
Documents you may be interested