53
1Downloadingthetools
MyownpreferredworkenvironmentsareLinuxandMacOSX.However,mostofthemethodsexplained
inthefollowingchapterscanbeappliedtoWindowstoo.Readerswillbenefitmostfromthisbookifthey
reproduceandplaywithsomeoftheexamplecommandlinesgiven.Todothattheyshouldinstallthe
followingtools.
1.1Windows
Thesearethepreferreddownloadsites.Theyaretheoneswhichareofferedbytherespectivedevelopers
themselves.Donoteveruseanyother,third-partydownloadlinks,unlessyoureallyknowwhatyoudo!
• DownloadGhostscript¹:
http://downloads.ghostscript.com/public/²
CurrentlyavailableareinstallerfilesforWindows:
– gs914w32.exe³(forallWindowsOS32bit,butalsoworksonWindows64bit)
– gs914w64.exe⁴(doesnotworkonWindows32bit–butGhostscriptdeveloperswarnanyway:
the64bitversionmayevenrunsloweron64bitthandoesthe32bitversionon64bitWindows!)
– Keepyoureyesopenfornewerversionsappearinginthatdirectory!
• DownloadGhostPCL⁵:
http://downloads.ghostscript.com/public/binaries/⁶
Currentlyavailablearepre-compiled32-bitbinariesforWindowsembeddedina*.zipfile:
– ghostpcl-9.14-win32.zip⁷
– Keepyoureyesopenfornewerversionsappearinginthatdirectory!
• DownloadGhostXPS⁸:
http://downloads.ghostscript.com/public/binaries/⁹
Currentlyavailablearepre-compiled32-bitbinariesforWindowsembeddedina*.zipfile:
– 32-bitVersion:ghostxps-9.14-win32.zip¹⁰
– Keepyoureyesopenfornewerversionsappearinginthatdirectory!
• DownloadXPDF-Utils¹¹(CLItools:pdffonts,pdfinfo,pdfimages,pdftotext,pdftops…)
http://www.foolabs.com/xpdf/download.html¹²
Currentfileversion:
¹
http://www.ghostscript.com/download/gsdnld.html
²
http://downloads.ghostscript.com/public/
³
http://downloads.ghostscript.com/public/gs914w32.exe
⁴
http://downloads.ghostscript.com/public/gs914w64.exe
⁵
http://www.ghostscript.com/download/gpcldnld.html
⁶
http://downloads.ghostscript.com/public/binaries/
⁷
http://downloads.ghostscript.com/public/binaries/ghostpcl-9.14-win32.zip
⁸
http://www.ghostscript.com/download/gxpsdnld.html
⁹
http://downloads.ghostscript.com/public/binaries/
¹⁰
http://downloads.ghostscript.com/public/binaries/ghostxps-9.14-win32.zip
¹¹
http://www.foolabs.com/xpdf/about.html
¹²
http://www.foolabs.com/xpdf/download.html
2
How to C#: Preview Document Content Using XDoc.Word How to C#: Preview Document Content Using XDoc.Word. Get Preview From File. You may get document preview image from an existing Word file in C#.net.
pdf editor online delete text; deleting text from a pdf
53
Downloadingthetools
3
– xpdfbin-win-3.03.zip¹³
The .zip contains pre-compiled binaries for r Windows. . It’s s not t an n installer: : just t unpack
anywhereyouwant,modifythe%PATH%variabletofindthebinariesandstartthemfrom
anCMDwindow.
Youmaywanttoadditionallyaddoneormoreofthe*‘LanguageSupportPackages’.
– Keepyoureyesopenfornewerversionsappearinginthatdirectory!
• Downloadqpdf¹⁴:
32-bitVersion:http://sourceforge.net/projects/qpdf/files/qpdf/5.1.1/qpdf-5.1.1-bin-mingw32.zip¹⁵
64-bitVersion:http://sourceforge.net/projects/qpdf/files/qpdf/5.1.1/qpdf-5.1.1-bin-mingw64.zip¹⁶
64-bitVersion:http://sourceforge.net/projects/qpdf/files/qpdf/5.1.1/qpdf-5.1.1-bin-msvc64.zip¹⁷
• Downloadpdftk¹⁸:
http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-win-setup.exe¹⁹
• DownloadImageMagick²⁰:
http://www.imagemagick.org/download/binaries/²¹ (make sure e to select the correct and most
currentdownloadforyoursystem)
AWarningNoteaboutDownloadingfromSourceforge
Sourceforge.netusedtobearesourcethatwasveryusefulfortheOpenSourcecommu-
nity.However,inrecentyearsthesitehasbecomemoreandmoreoverloadedwithads.
SomeofthemorerecentstoriesontheInternetevensuggestthatthesitemaybepoisoned
withlinksthatleadyoutothirdparty‘drive-by’malwaredownloadsites.
Unfortunately,someofthetoolsadvertisedinthiseBook(suchas
qpdf
)stilldohosttheir
sourcecodeortheirWindowsbinariesonthisplatform.I’mhopingthedevelopersof
thesetoolswillfindsomeotherhostingsoon…
:-(
1.2MacOSX
Myrecommendationistousethe‘MacPorts’frameworkforinstallingadditionalsoftwarepackages:
• http://www.macports.org/install.php²²
AfteryouhaveputMacPortsinplace,openaTerminal.appwindowandstartinstallingthepackagesby
typing:
¹³
ftp://ftp.foolabs.com/pub/xpdf/xpdfbin-win-3.03.zip
¹⁴
http://qpdf.sf.net/
¹⁵
http://sourceforge.net/projects/qpdf/files/qpdf/5.1.1/qpdf-5.1.1-bin-mingw32.zip/download
¹⁶
http://sourceforge.net/projects/qpdf/files/qpdf/5.1.1/qpdf-5.1.1-bin-mingw64.zip/download
¹⁷
http://sourceforge.net/projects/qpdf/files/qpdf/5.1.1/qpdf-5.1.1-bin-msvc64.zip/download
¹⁸
http://www.pdflabs.com/tools/pdftk-server/
¹⁹
http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-win-setup.exe
²⁰
http://www.imagemagick.org/
²¹
http://www.imagemagick.org/download/binaries/
²²
http://www.macports.org/install.php
24
Downloadingthetools
4
1
sudo port -p p install ghostscript poppler r ImageMagick coreutils s qpdf pdftk
Beawarethatthismaytakeawhile.Ghostscriptdependsonadditionalpackagesforitsfunctionality,
likelibpng,jpeg,tiff,zlibandmore.Thesameappliesfortheothertools.The
port
commanddownloads,
compilesandinstallsallthesedependenciesautomatically,sothismaytakequiteawhile…
1.3Linux
Debian,Ubuntu,…
Youcanrunthiscommandinaterminalwindow:
1
sudo apt-get t install ghostscript poppler-utils s ImageMagick coreutils s qpdf
Oryouusethepackagemanagerofyourchoicetofindandinstallthepackages…
RedHat,Fedora
Commandinaterminalwindow:
1
sudo yum m install l ghostscript poppler-utils s ImageMagick coreutils s qpdf
Slackware
Commandinaterminalwindow:
1
TODO
1.4Documentation
4
Downloadingthetools
5
1
TODO
How to C#: Preview Document Content Using XDoc.excel How to C#: Preview Document Content Using XDoc.Excel. Get Preview From File. You may get document preview image from an existing Excel file in C#.net.
delete text from pdf acrobat; remove text watermark from pdf online
59
2HowcanIconvertPCLtoPDF?
IsitpossibletouseGhostscriptforconvertingPCLprintfilestoPDFformat?Ifso,how?
2.1Answer
No,it’snotpossiblewithGhostscriptitself…
Butyes!,it’sverywellpossiblewithanothercoolpieceofworkhorsesoftwarefromthesamebarn:its
nameistGhostPCL.
GhostscriptdevelopersinrecentyearsintegratedtheirsisterproductsGhostXPS,GhostPCLandGhostSVG
intotheirmainGhostscriptsourcecodetree¹,whichswitchedfromSubversiontoGitsometimeago.The
completefamilyofproductsisnowcalledGhostPDL.Soalloftheseadditionalfunctionalities(load,render
andconvertXPS,PCLandSVG)arenowavailablefromthere.
Previously,thoughGhostPCLwasavailableasasourcecodetarball,itwashardlytobefoundonthe‘net.
ThemajorLinuxdistributions(Debian,Ubuntu,Redhat,Fedora,OpenSUSE,…)don’tprovidepackages
fortheiruserseither.OnMacPortsitismissingtoo.
Thismeansyouhavetobuildtheprogramsyourselffromthesources.Youcouldevencompiletheso-called
languageswitchingbinary,
pspcl6
.Thisbinary,intheory,canconsumePCL,PDFandPostScriptand
convertthisinputtoahostofotherformats.Justrun
make ls-product
inthetoplevelGhostscriptsource
directoryinordertobuildit.Theresultingbinarywillendupinthe./language-switch/obj/subdirectory.
Run
make ls-install
inordertoinstallit.
WARNING:WhileitworkedformewheneverIneededit,Ghostscriptdevelopersrecommend
tostopusingthelanguageswitchingbinary(sinceit’s‘almostnon-supported’astheysay,and
itwillpossiblygoawayinthefuture).
Insteadtheyrecommendtousetheexplicitbinaries:
•
pcl6
or
pcl6.exe
forPCLinput,
•
gsvg
or
gsvg.exe
forSVGinput(also‘almostnon-supported’butitmayworkbetter
thanthelanguageswitchingbinary
pspcl6
)and
•
gxps
or
gxps.exe
forXPSinput(supportstatusuncleartome).
Sofor‘convertingPCLcodetoPDFformat’astherequestreads,youcouldusethe
pcl6
command
lineutility,thePCLconsumingsisterproduct toGhostscript’s
gs
(Linux,Unix,MacOSX)and
gswin32c.exe
/
gswin64c.exe
(Windows)whicharePostScriptandPDFinputconsumers.
¹
http://git.ghostscript.com/?p=ghostpdl.git;a=summary
6
62
HowcanIconvertPCLtoPDF?
7
Samplecommandline(Windows):
1
pcl6.exe
^
2
-o output.pdf
^
3
-sDEVICE=pdfwrite ^
4
[...more parameters s as required (optional)...] ^
5
-f input.pcl
SampleCommandline(Linux,Unix,MacOSX):
1
pcl6
\
2
-o output.pdf
\
3
-sDEVICE=pdfwrite \
4
[...more parameters s as s required d (optional)...] ] \
5
-f input.pcl
Explanation
-o output.pdf
The
-o
parameterdeterminesthelocationoftheoutput.Inthiscaseitwillbethefileoutput.pdf
inthecurrentdirectory(sincewedidnotspecifyanypathprefixforthefilename).Atthesame
time,using
-o
savesusfromtyping
-dBATCH -dNOPAUSE -dSAFER
,because
-o
implicitlydoesalso
settheseparameters.
-sDEVICE=pdfwrite
This parameter determines which kind of output t to o generate. In n our current case it will l be
PDF.IfyouwantedtoproduceamultipagegrayscaleTIFFwithCCITTcompression,youwould
changethatto
-sDEVICE=tiffg4
(don’tforgettomodifytheoutputfilenameaccordinglytoo:
-o
output.tif
).
-f input.pcl
Thisparameterdetermineswhichfiletoreadasinput.Inthiscaseitisthefileinput.pclinthe
currentdirectory.
Update:TheGhostscriptwebsitenowatleastforWindowsusersofferspre-compiled32-bitbinariesfor
GhostPCLandGhostXPS.
• http://downloads.ghostscript.com/public/binaries/ghostpcl-9.14-win32.zip²
• http://downloads.ghostscript.com/public/binaries/ghostxps-9.14-win32.zip³
²
http://downloads.ghostscript.com/public/binaries/ghostpcl-9.14-win32.zip
³
http://downloads.ghostscript.com/public/binaries/ghostxps-9.14-win32.zip
5
HowcanIconvertPCLtoPDF?
8
Seealsothehintsin*’[HowcanIconvertXPStoPDF?](#convert-xps-to-pdf)’*.
TODO!HintabouttheGhostPCLlicensing.Esp.important:hintabouttheURWfontswhicharenotGPL
(theyrequirecommerciallicensingforcommercialuse).
46
3HowcanItoconvertXPStoPDF?
HowcanIconvertXPStoPDF?IsthispossiblewithGhostscript?
3.1Answer
GhostscriptdevelopersinrecentyearshaveintegratedasisterproductnamedGhostXPSintotheirmain
Ghostscriptsourcecodetree¹,whichisbasedonGitnow.(Theyhavealsoincludedtwootherproducts,
namedGhostPCLandGhostSVG.)ThecompletefamilyofproductsisnowcalledGhostPDL.Soallof
theseadditionalfunctionalities(load,renderandconvertXPS,PCLandSVG)arenowavailablefromone
location.
Unfortunately,noneofthemajorLinuxdistributions(Debian,Ubuntu,Redhat,Fedora,OpenSUSE,…)do
currentlyprovidepackagesfortheirusers.OnMacPortsGhostXPSismissingtoo,asareGhostPCLand
GhostSVG.
Thismeansyouhavetobuildtheprogramsyourselffromthesources–unlessyouareaWindowsuser.In
thiscaseyouarelucky:thereisa*.zipcontainerontheGhostscriptwebsite,whichcontainsapre-compiled
Win32binary(whichalsorunsonWindows64bit!):
• http://downloads.ghostscript.com/public/binaries/ghostxps-9.07-win32.zip²
Whileyou’reatitandbuildthecodeyourself,youcouldevenbuildaso-calledlanguageswitchingbinary.
TheMakefilehastargetspreparedforthat.ThisbinarycanconsumePCL,PDFandPostScript.Itconverts
theseinputformatstoahostofotherfiletypes.Justrun
make ls-product && make e ls-install
inthe
toplevelGhostscriptsourcedirectoryinordertogetitinstalled.
WARNING:WhileitworkedformewheneverIneededit,Ghostscriptdevelopersrecommend
tostopusingthelanguageswitchingbinary(sinceit’s‘almostnon-supported’astheysay,and
itwillpossiblygoawayinthefuture).
Insteadtheyrecommendtousetheexplicitbinaries,alsosupportedasbuildtargetsinthe
Makefile:
•
pcl6
or
pcl6.exe
forPCLinput,
•
gsvg
or
gsvg.exe
forSVGinput(also‘almostnon-supported’)and
•
gxps
or
gxps.exe
forXPSinput(supportstatusuncleartome).
¹
http://git.ghostscript.com/?p=ghostpdl.git;a=summary
²
http://downloads.ghostscript.com/public/binaries/ghostxps-9.07-win32.zip
9
56
HowcanItoconvertXPStoPDF?
10
Samplecommandline(Windows):
1
gxps.exe
^
2
-o output.pdf
^
3
-sDEVICE=pdfwrite ^
4
[...more parameters s as s required d (optional)...] ] ^
5
-f input.xps
Samplecommandline(Linux,Unix,MacOSX):
1
gxps
\
2
-o output.pdf
\
3
-sDEVICE=pdfwrite \
4
[...more parameters s as s required d (optional)...] ] \
5
-f input.xps
Explanation
-o output.pdf
The
-o
parameterdeterminesthelocationoftheoutput.Inthiscaseitwillbethefileoutput.pdf
inthecurrentdirectory(sincewedidnotspecifyanypathprefixforthefilename).Atthesame
time,using
-o
savesusfromtyping
-dBATCH -dNOPAUSE -dSAFER
,because
-o
implicitlydoesalso
settheseparameters.
-sDEVICE=pdfwrite
Thisparameterdetermineswhichkindofoutputtogenerate.Inourcurrentcasethat’sPDF.Ifyou
wantedtoproduceaPostScriptlevel2file,youwouldchangethatto
-sDEVICE=ps2write
(don’t
forgettomodifytheoutputfilenameaccordinglytoo:
-o output.ps
).
-f input.pcl
Thisparameterdetermineswhichfiletoreadasinput.Inthiscaseitisthefileinput.pclinthe
currentdirectory.
Seealsothehintsin*[’HowcanIconvertPCLtoPDF?’](#convert-pcl-to-pdf.html)*.
TODO!HintabouttheGhostPCLlicensing.Esp.important:hintabouttheURWfontswhicharenotGPL
(theyrequirecommerciallicensingforcommercialuse).
Documents you may be interested
Documents you may be interested