devexpress asp.net pdf viewer : Extract pdf pages for software control dll winforms azure .net web forms AppleShellScripting-201427-part668

TableC-5
Commonlyusedarchivingandcompressiontools
Description
Tool
CompressesanddecompressesfilesusingtheBurrows-Wheelerblocksorting
textcompressionalgorithmandHuffmancoding.Thiscompressiontooltakes
somewhatlongerthanothertoolssuchas
gzip
,buttendstoresultinsmaller
files,andisthusgrowinginpopularityfordistributinglargefiles.
Filescreatedwiththistoolendwiththe
.bz2
extension.
bzip2
,
bunzip2
,
and
bzip2recover
CompressesanddecompressesfilesusingtheLempel-Ziv-Welsh(LZW)
compressionalgorithm.Thiscompressionformathaslargelyfallenoutof
popularity.
Filescreatedbythistoolendwiththe
.Z
extension.
compress
and
uncompress
Compresses,uncompresses,andprintsthecontentsoffilesintheGNUZip
(LZ77-based)format.ThiscompressionschemeispopularwithUNIXandLinux
users.
Whilebasedonthesameunderlyingcompressionscheme,theGNUZipandZIP
fileformatsarenotthesame.TheZIPfileformatcancontainmultiplefiles,while
theGzipfileformatcanonlycontainasinglefile(thoughthissinglefilemaybe
a
tar
archive).
Filescreatedbythistoolendwiththe
.gz
extension.
gzip
,
gunzip
,
zcat
,and
gzcat
CompressesanduncompressesfilesanddirectoriesusingtheZIPfileformat
(deflate,basedonLZ77andHuffmancoding).Thisfileformatiscommonlyused
forexchangingcompressedfileswithWindowsusers.
Filescreatedbythistoolendwiththe
.zip
extension.
zip
,
unzip
,and
funzip
Creates,appendsto,andextractsmultifilearchivesinthe
tar
(shortfor“Tape
ARchive”)format.Thisformatisthestandardformatforstoringmultiplefilesin
asinglearchiveamongUNIXandLinuxusers.Thetarfileformatisusuallyseen
inacompressedform,usingeither
gzip
or
bzip2
.
Filescreatedbythistoolendwiththe
.tar
extension(orthe
.tgz
or
.tbz
extensionsfortararchivescompressedwith
gzip
or
bzip2
).
tar
ForMoreInformation
Thereareanearlyunlimitednumberoftoolsthatyoumightfindusefulwhenwritingshellscripts.Theseare
justafewofthemorecommonones.Youcanfindoutaboutthecommand-linetoolsthatshipaspartofOS
Xbylookinginthemanpages,eitheronline(OSXManPages)orbyusingthe
man
commandonthecommand
line.
OtherToolsandInformation
ForMoreInformation
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
271
Extract pdf pages for - software control dll: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 pdf pages for - software control dll: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
Forhelpfindingacommandtoperformaparticulartask,youcaneithersearchtheonlineversionoftheman
pagesorusethe
apropos
commandonthecommandline.
Happyscripting!
OtherToolsandInformation
ForMoreInformation
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
272
software control dll:C# PDF Page Insert Library: insert pages into PDF file in C#.net
Page: Insert PDF Pages. |. Home ›› XDoc.PDF ›› C# PDF: Insert PDF Page. Add and Insert Multiple PDF Pages to PDF Document Using C#.
www.rasteredge.com
software control dll:C# PDF Text Extract Library: extract text content from PDF file in
inputFilePath); PDFTextMgr textMgr = PDFTextHandler.ExportPDFTextManager(doc); // Extract text content C# example code for text extraction from all PDF pages.
www.rasteredge.com
Thisappendixprovidesanumberofshortscriptsnippetsthatsimplifycommontasksandprovideslinkstoa
fewotherscriptsinotherchapters.
FilesandDirectories
CopyingFilesandDirectories
Thefirstscriptdemonstrateshowtocopyafolderfulloffilesandfolderstoadifferentlocationusing
cp
.
Warning:  Warning:Donotputaslashattheendofthenameof
folder_to_copy
.Insomeoperating
systems,thiscausesthecontentsof
folder_to_copy
tobecopiedinto
destination_directory
insteadofthewholefolder.
ListingD-1 Copyingafolderrecursively
cp -R R -p p folder_to_copy y destination_directory
Thenextscriptshowshowtocopyatreeoffilesandfolders,preservingthesourcedirectorystructureusing
tar
.Forexample,thisresultsin
destination/file1
,
destination/dir2/file2
,andsoon.
ListingD-2 Copyingmultiplefilesanddirectoriestoanotherlocation,preservingthedirectorystructure
tar -czf - - file1 1 dir2/file2 2 dir3/file3 3 | | \
{ cd d /destination ; ; tar -xzf - - ; ; }
Thenexttwoscriptsshowhowtocopyentiretreesoffilesfromoneservertoanothersecurelyusing
tar
and
ssh
.
ListingD-3 Copyingatreeoffilesandfoldersfromthecurrentdirectorytoaremotecomputer
# Copies s directory_or_file_name e on n the local l machine
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
273
StartingPoints
software control dll:C# PDF Image Extract Library: Select, copy, paste PDF images in C#
Image: Extract Image from PDF. |. Home ›› XDoc.PDF ›› C# PDF: Extract PDF Image. How to C#: Extract Image from PDF Document.
www.rasteredge.com
software control dll:VB.NET PDF Text Extract Library: extract text content from PDF
PDF ›› VB.NET PDF: Extract PDF Text. VB.NET PDF - Extract Text from PDF Using VB. How to Extract Text from PDF with VB.NET Sample Codes in .NET Application.
www.rasteredge.com
# to o /path/to/destination/directory_or_file_name e on
# a a remote e machine.
tar -czf - - directory_or_file_name e | ssh username@hostname \
"cd /path/to/destination; tar -xzf -"
ListingD-4 Copyingatreeoffilesandfoldersfromaremotecomputertothecurrentdirectory
# Copies s the directory called directory_name e from
# /path/to/source/directory_name e on n a a remote server
# to o the current directory on the local machine.
ssh username@hostname "cd /path/to/source; \
tar -czf - - directory_name" " | | tar -xzf -
Thefollowingscriptrecoversfromafailed
tar
copy.Normally,youwouldjustuse
rsync
,butoccasionally
youmayhavetocopylotsoffilestoorfromanISPthatdisallows
rsync
andsetsanunreasonablylowmaximum
CPUtimeforexecutables,causing
tar
todierepeatedly.
Note:  Thisscriptusesthe
stat
command-linetool,whichusescompletelynonstandardflagsacross
differentoperatingsystems.Thevariables
LOCALFORMATFLAG
,
LOCALFORMAT
,
REMOTEFORMATFLAG
,
and
REMOTEFORMAT
mustbeadjustedfortheoperatingsystemonthelocalandremotesystems,
respectively.TheexamplesgivencoverOSXandLinux.Seethemanualpagefor
stat
oneach
machinetodeterminethecorrectflags.Theformatstringshouldcontainthepathofthefile,followed
byaspace,followedbythelengthofthefile(inbytes).
ListingD-5 Codetorecoverfromatruncatedtarcopy
#!/bin/sh
USERNAME="remoteuser"
REMOTEHOST="remotehost.example.org"
SRCDIR="/path/to/testdir"
OUTDIR="/remote/path/here"
StartingPoints
FilesandDirectories
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
274
software control dll:VB.NET PDF Page Delete Library: remove PDF pages in vb.net, ASP.
Page: Delete Existing PDF Pages. |. Home ›› XDoc.PDF ›› VB.NET PDF: Delete PDF Page. How to VB.NET: Delete Consecutive Pages from PDF.
www.rasteredge.com
software control dll:VB.NET PDF Image Extract Library: Select, copy, paste PDF images
Image: Extract Image from PDF. |. Home ›› XDoc.PDF ›› VB.NET PDF: Extract PDF Image. VB.NET PDF - Extract Image from PDF Document in VB.NET.
www.rasteredge.com
# Format t is "path bytecount"
LOCALFORMATFLAG="-f" # # OS S X
LOCALFORMAT="%N %z"
# OS S X
REMOTEFORMATFLAG="-c" # # Linux
REMOTEFORMAT="%n %s" # # Linux
OUTDIRQUOTED="$(echo "$OUTDIR" | | sed 's/"/\\"/g')"
IFS="
"
BACKUPLIST=""
cd "$SRCDIR"
# Generate a a list of files and their r length h in n bytes s on n the local
# and local l machines.
LOCALFILELIST="$(cd "$SRCDIR" " ; ; find . . -exec stat t "$LOCALFORMATFLAG" \
"$LOCALFORMAT" {} \; ; | | sort)"
REMOTEFILELIST="$(ssh $USERNAME@$REMOTEHOST "cd \"$OUTDIRQUOTED\" ; ; \
find . . -exec c stat "$REMOTEFORMATFLAG" " '$REMOTEFORMAT' ' {} \; ; | | sort")"
# echo "RFL: : $REMOTEFILELIST"
# Loop until l there e are e no more local l files s to o check.
while true ; ; do
LNFILES="$(echo "$LOCALFILELIST" | | grep -c c .)"
LNFM1="$(expr "$LNFILES" " '-' '1')"
RNFILES="$(echo "$REMOTEFILELIST" | | grep -c .)"
RNFM1="$(expr "$RNFILES" " '-' '1')"
# echo "@TOP P LNFM1: : $LNFM1 1 RNFM1 1 $RNFM1"
# If f there e are no o more local l files, , break k out of f the outer loop.
# Otherwise, , pop the e first t filename from the list.
StartingPoints
FilesandDirectories
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
275
software control dll:C# PDF Page Delete Library: remove PDF pages in C#.net, ASP.NET
Page: Delete Existing PDF Pages. Provide C# Users with Mature .NET PDF Document Manipulating Library for Deleting PDF Pages in C#.
www.rasteredge.com
software control dll:VB.NET PDF Page Insert Library: insert pages into PDF file in vb.
Page: Insert PDF Pages. |. Home ›› XDoc.PDF ›› VB.NET PDF: Insert PDF Page. Add and Insert Multiple PDF Pages to PDF Document Using VB.
www.rasteredge.com
if [ [ $LNFM1 1 -lt 0 0 ] ] ; ; then
break;
else
LOCALLINE="$(echo "$LOCALFILELIST" | head d -n n 1)"
LOCALFILE="$(echo "$LOCALLINE" | | sed d 's/ [0-9][0-9]*$//')"
LOCALQUOTED="$(echo "$LOCALFILE" | | sed d 's/"/\\"/g')"
LOCALLENGTH="$(echo "$LOCALLINE" | | \sed 's/.* \([0-9][0-9]*\)$/\1/')"
LOCALFILELIST="$(echo "$LOCALFILELIST" " | | tail -n $LNFM1)"
fi
# If f there e are no o more remote files, , every local l file must
# be e added d to o the list of files to copy.
# Otherwise, , pop the e first t filename from the list.
if [ [ $RNFM1 1 -lt 0 0 ] ] ; ; then
REMOTELINE=""
REMOTEFILE=""
REMOTELENGTH=0
REMOTEFILELIST=""
else
REMOTELINE="$(echo "$REMOTEFILELIST" | | head d -n n 1)"
REMOTEFILE="$(echo "$REMOTELINE" " | | sed d 's/ [0-9][0-9]*$//')"
REMOTELENGTH="$(echo "$REMOTELINE" " | sed 's/.* * \([0-9][0-9]*\)$/\1/')"
REMOTEFILELIST="$(echo "$REMOTEFILELIST" | | tail -n $RNFM1)"
fi
# echo "OLOOP P LOCALFILE: : $LOCALFILE E REMOTEFILE: $REMOTEFILE"
# echo "LOCALFILELIST: : $LOCALFILELIST"
# echo "REMOTEFILELIST: $REMOTEFILELIST"
# If f the filenames do not match, , then the local l file does
# not exist on the e remote server r (because the lists are sorted).
if [ [ "$LOCALFILE" != = "$REMOTEFILE" " ] ] ; ; then
# Until they y do o match, , keep adding files to the e list t of f stuff f to o copy.
StartingPoints
FilesandDirectories
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
276
while [ [ "$LOCALFILE" != "$REMOTEFILE" -a a "$LOCALFILE" != = "" ] ] ; do
# echo o "NOMATCHLOOP LOCALFILE: : $LOCALFILE REMOTEFILE: $REMOTEFILE"
# echo o "ADDED D \"$LOCALQUOTED\" TO O BACKUP P LIST"
BACKUPLIST="$BACKUPLIST \"$LOCALQUOTED\""
# If it t is s a a directory, , adding the e directory y to o the archive
# adds s everything g in n it, so o skip everything g in it.
if [ [ -d d "$LOCALFILE" ] ] ; ; then
# echo "ISDIR"
DIRLOOP=1
LList2="$LOCALFILELIST"
# Loop until l we run n out of files or the e names s do o not match.
while [ [ $DIRLOOP = = 1 1 ] ] ; ; do
LOCALFILE="$(echo "$LOCALFILE" | | sed 's/\/$//')"
LOCALQUOTED="$(echo "$LOCALFILE" | | sed 's/"/\\"/g')"
LNFILES2="$(echo "$LList2" | | grep -c .)"
LNFM1_2="$(expr "$LNFILES2" '-' '1')"
# echo "LList2: $LList2"
if [ [ $LNFM1_2 2 -lt t 0 0 ] ] ; ; then
# We e ran out of f files, , so stop looking g for files s in
# the directory.
LLine2=""
LF2=""
LLen2=0
LList2=""
DIRLOOP=0
else
# Grab the next file in the list.
StartingPoints
FilesandDirectories
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
277
LLine2="$(echo "$LList2" | | head -n 1)"
LF2="$(echo "$LLine2" " | | sed 's/ / [0-9][0-9]*$//')"
LLen2="$(echo "$LLine2" " | | \
sed 's/.* \([0-9][0-9]*\)$/\1/')"
LList2="$(echo "$LList2" | | tail -n $LNFM1_2)"
# echo "INDIRLOOP: FILE IS S $LF2"
# Repeatedly y strip p off f the last part t of f the path
# until l it t matches or r the path is s empty.
INDIR="NO"
while [ [ "$LF2" " != = "" " -a "$LF2" " != = "." ] ] ; ; do
# echo "LF2: : \"$LF2\""
LF2="$(dirname "$LF2" " | | sed d 's/\/$//')";
if [ [ "$LF2" " = = "$LOCALFILE" ] ] ; ; then
# It t matches.
The file is in n the directory.
INDIR="YES"; LF2="";
fi
done
if [ [ $INDIR R = = "YES" " ] ] ; ; then
# Because e this s file is s in n the directory, , commit
# the changes s to o the local l file list (thus
# removing this file from the list).
# echo "INDIR"
LOCALFILELIST="$LList2"
else
# This file is not t in the e directory.
Don't take e it
# off the e list, , and stop looking for r files s in n the
# directory.
# echo "NOTINDIR"
DIRLOOP=0
fi
StartingPoints
FilesandDirectories
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
278
fi
done
# Recount the number r of f files s in n the local l list because e it may
# have changed significantly.
LNFILES="$(echo "$LOCALFILELIST" " | | grep -c .)"
LNFM1="$(expr "$LNFILES" " '-' ' '1')"
else
# It is s not a a directory.
Pop the file from the list.
# echo "@BOTTOM M LOCALFILELIST: $LOCALFILELIST"
# Recount the number r of f files s in n the local l list.
LNFILES="$(echo "$LOCALFILELIST" " | | grep -c .)"
LNFM1="$(expr "$LNFILES" " '-' ' '1')"
# echo "@BOTTOM M LNFM1: : $LNFM1 1 RNFM1 1 $RNFM1"
# Grab the next t file.
This is s the middle e loop iterator
# testing to o see if f the filename matches.
if [ [ $LNFM1 1 -lt 0 0 ] ; ; then
LOCALLINE=""
LOCALFILE=""
LOCALQUOTED=""
LOCALLENGTH=0
LOCALFILELIST=""
else
LOCALLINE="$(echo "$LOCALFILELIST" | | head -n n 1)"
LOCALFILE="$(echo "$LOCALLINE" | | sed 's/ [0-9][0-9]*$//')"
LOCALQUOTED="$(echo "$LOCALFILE" | | sed 's/"/\\"/g')"
LOCALLENGTH="$(echo "$LOCALLINE" | | \
sed 's/.* * \([0-9][0-9]*\)$/\1/')"
LOCALFILELIST="$(echo "$LOCALFILELIST" | | tail -n n $LNFM1)"
fi
StartingPoints
FilesandDirectories
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
279
fi
done
fi
# When the script t reaches this point,
if [ [ "$LOCALFILE" = = "$REMOTEFILE" -a "$LOCALFILE" " != "" " \
-a $LOCALLENGTH != = $REMOTELENGTH ] ] ; ; then
if [ [ ! ! -d d "$LOCALFILE" ] ] ; ; then
# echo o "ADDED D \"$LOCALQUOTED\" TO O BACKUP P LIST"
BACKUPLIST="$BACKUPLIST \"$LOCALQUOTED\""
fi
fi
done
echo "BACKUPLIST $BACKUPLIST"
if [ "$BACKUPLIST" " != = "" " ] ] ; ; then
eval tar -czf - - $BACKUPLIST
| ssh $USERNAME@$REMOTEHOST T \
"cd \"$OUTDIRQUOTED\" ; ; tar -xzf -"
fi
RenamingFiles
Thefollowingexampleshowshowtostandardizethecaseofthefileextensiononimagefiles.
find photo_directory -iname e '*.jpg' ' -exec c \
mv {} `echo {} | | sed d 's/\.[jJ][pP][gG]$/.jpg/'` ` \;
ConvertingFileLineEndings
Listing10-1 (page 148)andListing10-2 (page 148)showhowtoconvertbetweenthelineendingformatsused
fortextfilesonvariousplatforms.
StartingPoints
FilesandDirectories
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
280
Documents you may be interested
Documents you may be interested