how to use abcpdf in c# : Batch pdf metadata editor control application platform web page azure html web browser tlgc2extra10-part270

22.1 Displaylanguages:PostScript,PDF,andSVG
installing Adobe’s
Acrobat Reader
.¹ Other PDF viewers exist as well. e best-known free ones are
ghostscript
(seeSection22.3),
Evince
(seeSection22.3.4),and
xpdf
.²
22.1.3 SVGforScalableVectorGraphics
As the web has grown in popularityand complexity, users and content providers have sought ever
better,moreprecise,and,aboveall,scalablegraphicalrendering.AsacomplementtoPDF,theWorld
WideWebConsortiumhasdevelopedSVG,³anopen-standardvectorgraphicslanguagefordescribing
two-dimensionalgraphicsusingXMLsyntax.Itletsyouproducewebpagescontaininghigh-resolution
computergraphics.
AsanXMLinstance,SVGconsistsofUnicodetext.Itfeaturestheusualvectorgraphicsfunctions.
Itsfundamentalprimitiveisthegraphicsobject,whosemodelcontainsthefollowing:
• Graphicspathsconsistingofpolylines,Béziercurves,andotherelements:
– simpleorcompound,closedoropen;
– (gradient)filled,(gradient)stroked;
– canbeusedforclipping;
– canbeusedforbuildingcommongeometricshapes.
• Patternsandmarkers.
• Templatesandsymbollibraries.
• Transformations:
– defaultcoordinatesystem:xisright,yisdown,theunitisonepixel;
– a2×3transformationmatrixletsyouspecifyhowyouwanttotranslate,rotate,scaleorskew
thecoordinatesystem;
– canbenested;
– viewportmapsanareainworldcoordinatestoanareaonscreen.
• Inclusionofbitmaporrasterimages.
• Clipping,filter,andrastereffects;alphamasks.
• Animations,scripts,andextensions.
• Groupingsandstyles.
• SVGfonts(independentfromfontsinstalledonthesystem).
SeveralDVIdriversexiststotranslateaDVIfileintoSVG:
dvi2svg
(
http://www.activemath.org/~adrianf/dvi2svg
) developed by Adrian
Frischauf;
dvisvg
(
http://dvisvg.sourceforge.net
)developedbyRudolfSabo;
dvisvgm
(
http://dvisvgm.sourceforge.net
)developedbyMartinGieseking.
¹Freelydownloadablefromhttp://www.adobe.com/products/reader/.
²Seehttp://www.foolabs.com/xpdf/home.html.
³SVGstandsforScalableVectorGraphics.eW3Cwebsite(http://www.w3.org/Graphics/SVG)isagoodfirstsource
ofinformationonSVGandhasalotofpointerstoothersites.ecurrentspecification(version1.1)oftheSVGlanguageis
availableathttp://www.w3.org/TR/SVG11/.
⁴ereferencepointofthedisplayareainSVGistheupper-lecorner.ForPostScript,whereyrunsupward,thereference
pointofthepageisthelower-lecorner.
ch-psextra2.tex,v:2.27
2007/08/13
91
Batch pdf metadata editor - add, remove, update PDF metadata in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Allow C# Developers to Read, Add, Edit, Update and Delete PDF Metadata
add metadata to pdf programmatically; pdf keywords metadata
Batch pdf metadata editor - VB.NET PDF metadata library: add, remove, update PDF metadata in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Enable VB.NET Users to Read, Write, Edit, Delete and Update PDF Document Metadata
search pdf metadata; adding metadata to pdf files
22
POSTSCRIPTANDPDFTOOLS
22.1.4 Comparinganexampleof PostScript,PDF, andSVG
ToseeinwhichwayPostScript,PDF,andSVGdifferletusconsiderthefollowingsmallLAT
E
Xexample
thattypesetsashortsentenceinHelveticainsidearedrectanglewithlines1mmwideandfilledwith
ayellowbackground.
Goodtypographyisfun!
\usepackage{xcolor}
\renewcommand{\rmdefault}{phv}
\pagestyle{empty}
\setlength{\fboxrule}{1mm}
\setlength{\fboxsep}{1mm}
\fcolorbox{red}{yellow}{Good typography is fun!}
Exa.
22-1-1
22.1.4.1 ePostScriptinstance
eaboveexampleisequivalenttothefollowingPostScriptcode.
1
%!PS-Adobe-3.0 EPSF-3.0
2
%%BoundingBox: 25 25 142 46
3
%
mystring contains text string to be output
4
/mystring (Good typography is fun!) def
5
/mm {2.83 mul} def % 1 mm = 2.83 points
6
/fontsize 10 def
% the size of the font is 10 pt
7
/box {newpath % stack: llx lly
8
moveto
9
wx 0 rlineto
10
0 wy rlineto
11
wx neg 0 rlineto
12
closepath} def
13
/x0 10 mm def
14
/y0 10 mm def
15
/Helvetica findfont fontsize scalefont setfont
16
/wx mystring stringwidth pop 2 mm add def
17
/wy fontsize 2 mm add def
18
gsave % Paint background box in yellow
19
0 0 1 0 setcmykcolor
20
x0 y0 box
21
fill
22
grestore
23
gsave % Draw 1 mm tick red box around it
24
1 mm setlinewidth
25
1 0 0 setrgbcolor
26
x0 y0 box stroke
27
grestore
28
gsave % Get depth of characters below baseline
29
newpath
30
0 0 moveto
31
(y) true charpath flattenpath pathbbox
32
pop pop /lly exch def pop
33
grestore
34
% Go to start point of box and write text
35
x0 y0 moveto
36
% Move 1 mm right and 1 mm plus depth up
37
1 mm 1 mm lly neg add rmoveto mystring show
InPostScriptlinesstartingwithapercentsign(%)arecommentlinesandareignoredbyaPostScript
interpreter. However, thetwofirstlinesare specialcomments:a declarationthat weare dealingwith
aPostScript level 3filethat isencapsulated (line 1), and a specificationof thedimensions, in Post-
Scriptpoints,oftheboundingboxoftheimage(line2).Suchcommentsaremainlyusefulforexternal
programs,e.g.,LAT
E
X,which havetoknowthespacetoleaveontheoutput pagetoplacetheincluded
material(infact,thatishowLAT
E
XreservesthespaceforincludingtheresultoftypesettingExample22-
1-1,andallotherexamplesinthisbook).
92
ch-psextra2.tex,v:2.27
2007/08/13
C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
Studio .NET project. Powerful .NET control to batch convert PDF documents to tiff format in Visual C# .NET program. Free library are
online pdf metadata viewer; clean pdf metadata
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
Powerful components for batch converting PDF documents in C#.NET program. Convert PDF to multiple MS Word formats such as .doc and .docx.
edit pdf metadata online; preview edit pdf metadata
22.1 Displaylanguages:PostScript,PDF,andSVG
entheactualPostScriptcodestartswithadefinitionofthevariable
mystring
thatcontainsthe
texttobeprinted“Goodtypographyisfun!”(line4,line3isausercommentandisignored).Wethen
definethecommand
mm
whichdefinesthattoexpressmillimetersinPostScriptpoints(thePostScript
defaultunit)onehastousethemultiplicationfactor2.83(line5),andwesetthe
fontsize
variable
to10points(line6). e
box
command(lines7–12)drawsa rectangleof width
wx
andheight
wy
.It
hastobecalledwiththexandycoordinatesofthelowerlecorneroftherectangleonthestack.
Aerthesepreliminarydefinitionswedefine(lines13–14)thecoordinatesofthelowerlecorner
oftherectangle(
x0
=10mm,
y0
=10mm),anssetthefonttoHelvetica(line15)atasizeof10pt(using
fontsize
definedonline6).Nowthatthefontissetwecancalculatethewidthofthetexttobetypeset
(line 16, whichusesthestring
mystring
,definedonline 4), andsetthe heighttothefont size plus
2mm(line17),sincewewantaseparationof1mmbetweenthetextandeachsideoftherectangle.
eoutput is prepared inthreestages: Firstly, we draw the yellow backgroundof the rectangle
(lines18–22).WeusetheCMYKmodelandactivateonlythethird(i.e.,pureyellow)component(line
19)beforedrawinginmemorytherectanglewiththe
box
commandwhichconsumesthecoordinates
(
x0
,
y0
)whichwereputonthestack(line20),andthenfillitwiththe(yellow)color(line21).Secondly,
wedrawthesidesoftherectangle(line23–27).Aersettingthelinewidthto1mm(line24)and the
colorusingtheRGBmodelto“red”(line25)therectangleisonceagaindrawninmemoryanditssides
arestroked(line26).irdly,wewanttodrawthetextinsidetherectangle.Butfirst,inordertoposition
thetextcorrectlyverticallyinsidetherectanglewemusttakeintoaccounttheextendofthedescenders
belowthebaselineofthetext(lines28–33).ereforewechoosethecharacterinthetextstringwhich
hasthelowestdescender(“y”inthiscase)andcalculateitsboundingbox(line31).Wegetholdofthe
lowery-coordinateofthecharacterandsaveitinthevariable
lly
(line32).Finally,weareready(line
35)towritethetextinsidetherectangleatthecoordinate(
x0
,
y0
).Topositionthetextstringwemove
right1mmandupby1mmplusthe(negativeofthe)depthofthedescenderandshowthestring(line
37).
22.1.4.2 ePDFinstance
We havetranslated the previous PostScript codeintoPDF with
epstopdf
(seepage134), and trans-
formeditintoareadableformatwiththe
pdftk
utilityandits
uncompress
function(seeSection22.6.1).
Weobtainthefollowingoutput.
1
%PDF-1.3
2
%âãÏÓ
3
1 0 obj
4
<<
5
/Pages 2 0 R
6
/Type /Catalog
7
>>
8
endobj
9
2 0 obj
10
<<
11
/Kids [3 0 R]
12
/Count 1
13
/Type /Pages
14
>>
15
endobj
16
3 0 obj
17
<<
18
/Parent 2 0 R
19
/Resources
20
<<
21
/ExtGState 4 0 R
22
/Font 5 0 R
23
/ProcSet [/PDF /Text]
24
>>
25
/MediaBox [0 0 117 21]
26
/pdftk_PageNum 1
27
/Contents 6 0 R
ch-psextra2.tex,v:2.27
2007/08/13
93
C# PDF File Merge Library: Merge, append PDF files in C#.net, ASP.
NET components for batch combining PDF documents in C#.NET class. Powerful library dlls for mering PDF in both C#.NET WinForms and ASP.NET WebForms.
add metadata to pdf; remove metadata from pdf acrobat
C# PDF Print Library: Print PDF documents in C#.net, ASP.NET
NET search text in PDF, C#.NET edit PDF bookmark, C#.NET edit PDF metadata, C#.NET Quicken PDF printer library allows C# users to batch print PDF file in
pdf xmp metadata; pdf remove metadata
22
POSTSCRIPTANDPDFTOOLS
28
/Type /Page
29
>>
30
endobj
31
4 0 obj
32
<<
33
/R7 7 0 R
34
>>
35
endobj
36
5 0 obj
37
<<
38
/R8 8 0 R
39
>>
40
endobj
41
6 0 obj
42
<<
43
/Length 233
44
>>
45
stream
46
q 0.1 0 0 0.1 0 0 cm
47
/R7 gs
48
0 0 1 0 k
49
1 i
50
32.9961 32.9961 1118.25 156.598 re
51
f
52
28.3 w
53
1 0 0 RG
54
32.9961 32.9961 1118.25 156.598 re
55
S
56
0 G
57
0 g
58
q
59
10 0 0 10 0 0 cm BT
60
/R8 10 Tf
61
1 0 0 1 6.1293 8.30937 Tm
62
(Good typography is fun!)Tj
63
ET
64
Q
65
Q
66
67
endstream
68
endobj
69
7 0 obj
70
<<
71
/Type /ExtGState
72
/OPM 1
73
>>
74
endobj
75
8 0 obj
76
<<
77
/BaseFont /Helvetica
78
/Subtype /Type1
79
/Type /Font
80
>>
81
endobj
82
9 0 obj
83
<<
84
/Producer (ESP Ghostscript 815.04)
85
/ModDate (D:20071104141918)
86
/CreationDate (D:20071104141918)
87
>>
88
endobj
89
xref
90
0 10
91
0000000000 65535 f
92
0000000015 00000 n
93
0000000066 00000 n
94
0000000125 00000 n
95
0000000705 00000 n
96
0000000738 00000 n
97
0000000299 00000 n
98
0000000586 00000 n
99
0000000633 00000 n
100
0000000771 00000 n
101
trailer
94
ch-psextra2.tex,v:2.27
2007/08/13
C# Create PDF from Tiff Library to convert tif images to PDF in C#
NET component for batch converting tiff images to PDF documents in C# class. Create PDF from Tiff in both .NET WinForms and ASP.NET application.
pdf metadata viewer; pdf metadata viewer online
C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF
PowerPoint. Professional .NET PDF converter control for batch conversion. Export PowerPoint hyperlink to PDF in .NET console application.
edit multiple pdf metadata; endnote pdf metadata
22.1 Displaylanguages:PostScript,PDF,andSVG
102
103
<<
104
/Info 9 0 R
105
/Root 1 0 R
106
/Size 10
107
/ID [(...) (...)]
108
>>
109
startxref
110
889
111
%%EOF
AcanonicalPDFfilecontainsatleastfourparts:
• Aone-lineheader,whichidentifiesthePDFspecificationversionusedtobuildthefile(line1).¹
• Abodythatcontainsalltheobjectsthatmakeupthedocument(lines3–88).
• Across-referencetablewhichdescribesalltheindirectobjectsinthefile(lines89–100).
• Atrailerwiththelocationofthecross-referencetableandofcertainspecialobjectsinthebodyof
thefile(lines101–110).
ebodyofthefileconsistsofaseriesofobjects(delimitedby
obj
endobj
keywords).Objects
cancontainmanytypesofdata.Inourcaseweuseonlydictionaryobjects(between
<<
>>
delimiters)
andstream objects(delimitedby
stream
endstream
keywords,seelines45–67),andcharacterized
byalength(line43).Allobjectsinourexampleareindirectobjects,whichhaveauniqueobjectidentier,
bywhichotherobjectscanrefertoit.isidentifierconsistsoftwoparts:apositiveobjectnumberand
anon-negativegenerationnumber. Inour examplewehaveeight objects,allwithgenerationnumber
zero(e.g.,object“1”startsonline3,object“2”online9,etc.).
Object“1”(lines3–8)istherootofthePDFdocument structure(itisreferencedinthetrailer on
line105).It isoftype
/Catalog
(line6)andpointstotherootofthepagetree(the
/Pages
entryin
thedictionaryonline5,whichreferstoobject“2”).
Object “2” (lines9–15), of type
/Pages
(line 13), hasonlyone descendant leaf node (
/count
entryhas the value1, seeline 12) and henceone immediate child node(
/Kids
entry, referring to
object“3”,seeline11).
Object“3”(lines16–30)isoftype
/Page
(line28),itsparentisobject“2”(line18),anditsbound-
ariesinuserspaceunits(similartotheboundingboxinEPSfiles)aregivenbythe
/MediaBox
entry
(line 25). Furthermore, the page needs theresourcesenumerated onlines 21–23:
/ExtGState
,de-
scribingthe graphics state (refers to object “4”),
/Font
,describingthe fonts (refers to object “5”),
and
/ProcSet
,definingtheproceduresetnamesusedinthecontent streamsofthe page(
/PDF
for
paintingand graphics state and
/Text
for textprocedures). Finally, the
/Contents
entry(line27)
describesthecontentsofthepage(referstoobject“6”).
Object“4”(lines31–35)definesthevariable
/R7
asareferencetoobject“7”.
Object“5”(lines36–40)definesthevariable
/R8
asareferencetoobject“8”.
Object“6”(lines41–68)describesthepagecontents(asannouncedonline27).Itisastreamobject
(line 45), whose length isspecified as the
/Length
entryinthe dictionary(lines 42–44) to be233
bytes.eremaininglines of theobjectdraw thevariousitems andwritethetext. egraphics state
is saved before definingthe transformationmatrix, which introducesa scalingfactor of 10 between
thecoordinatesused inthefileandtheuserspace(line46),andsettingthegraphicsstateparameters
(referencetoobject “7”, seeline47).e colorisset toyellow(usingtheCMYKmodel, line48), the
flatnesstoleranceto“1”(line49)andarectangleisdrawninmemory(line50)andfilled(line51).e
linewidthissetto1mm(line52)andthecolortored(usingtheRBGmodel,line53)beforedrawing
thesamerectangle(line54)butnowstrokingitssides(line55).en,thecolorforstrokingandnon-
strokingoperationsissettoblack(lines56–57)andthegraphicsstateissavedoncemore(line58).e
¹e second comment on line 2 contains four binary characters to help ensure proper behaviour of file transfer
applications[3,Section3.4.1FileHeader].
ch-psextra2.tex,v:2.27
2007/08/13
95
C# Create PDF from Excel Library to convert xlsx, xls to PDF in C#
Professional .NET PDF converter control for batch conversion. Merge all Excel sheets to one PDF file. Export PDF from Excel with cell border or no border.
embed metadata in pdf; batch edit pdf metadata
C# Create PDF from Word Library to convert docx, doc to PDF in C#.
and ASP.NET. Convert both DOC and DOCX formats to PDF files. Professional .NET control for batch conversion in C#.NET class. Easy to
read pdf metadata online; pdf metadata reader
22
POSTSCRIPTANDPDFTOOLS
transformationmatrixisredefinedandthestartofatextobjectisinitiated(line59).Aerdefiningthe
fontbyareferencetoobject“8”(line60)thetextmatrixisset(line61)andthetextdrawn(line62).e
textobject(declaredonline59)isended(line63),andthegraphicsstatesarerestored(line64restores
thegraphicsstatesavedonline58,andline65theonesavedonline46).
Object“7”(lines69–74)setthegraphicsstatefordrawingin“overpaintmode”(line72).iswas
usedforfillingandpaintingtherectangle,sothattheredsidesarepaintedwithouttranparencyontop
oftheyellowbackground(line55).
Object“8”(line 75–81)defines afont dictionaryof subtype
/Type1
(line78). e
/BaseFont
entryspecifiesthePostScriptnameof thefont,inthiscaseHelvetica(line 77),which isoneofthe14
standardfonts,andhencecanbeusedwithoutspecifyingfurtherinformation.
Object“9”(lines82–88)isaninformationalrecordaboutthePDFfile,specifyingitsproducer(line
84),anditscreation(line86)andmodification(line85)dates.
eremainingpartofthefilecontainsthecross-referencetable(lines89–100).Itstartswithastatic
entry(line91)thatisfollowedbynineentries(lines92–100)whichspecifythestartbyteofobjects“1”
to“9”inthefile. Nextcomesthetrailer (lines101–108)withreferencestothe
/Info
object “9”(line
104),the
/Root
object“1”(line105),thesizeofthecross-referencetable(line106),andaconstructed
uniqueidentifier
/ID
(notshownonline107).¹Finally,thebyteoffsetfromthebeginningofthefileto
thebeginningofthecross-referencesection(line89)isgivenbythenumberfollowingthe
startxref
keyword(line110).
22.1.4.3 SVGinstance
XMLisadeclarativemetalanguageandSVGisaninstanceofanXMLgrammar,which implementsa
vocabularyoptimizedforthedescriptionofvectorgraphics.
1
<?xml version=”1.0”?>
2
<!DOCTYPE svg PUBLIC ”-//W3C//DTD SVG 1.1//EN”
3
”http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd”>
4
<svg width=”142pt” height=”46pt”
5
xmlns=”http://www.w3.org/2000/svg” version=”1.1”>
6
<!-- Draw rectangle sides in red and fill with yellow -->
7
<rect x=”25pt” y=”25pt” width=”113pt” height=”19pt”
8
fill=”yellow” stroke=”red” stroke-width=”1mm” />
9
<!-- Write the text in the rectangle -->
10
<text x=”30pt” y=”37.5pt” font-family=”Helvetica”
11
font-size=”10pt” fill=”black”>
12
Good typography is fun!
13
</text>
14
</svg>
AertheusualXMLdeclaration(line1)andthedefinitionofitsgrammarbyspecifyingitsDTD
(lines2–3), weencounterthe
svg
element,whichbracketsthewholefile(lines4–14).estart tagof
the
svg
element(lines4–5)definesthedimensionsandviewportofthegraphicsimage,thenamespace,
andtheversionofSVGtowhichtheelementvocabularyadheres.econcisenessoftheSVGsyntaxis
clearlydisplayedonthefollowinglines,wherewedrawaredrectanglewithits1mmwidesidescolored
redanditssurfacepaintedyellow(
rect
elementonlines7–8).Finally,the
text
element(lines10–13)
typesetsthestringinblackusingHelveticaatasizeof10pt.
PDF nor SVG can perform calculations, i.e., all dimensions, coordinates, etc. must be pre-
calculatedbyanexternalprogramandfedintothePDForSVGsource(e.g.,lines17,43,47,and54in
thePDF instanceandlines4,7,and10intheSVGinstanceofourexample).Ontheotherhand, the
PostScriptinterpreterwhenreadingthePostScriptinstancecalculatesthesizeoftherectanglebymea-
suringthewidthofthetextstringatthespecifiedpointsizeinthegivenfont.Moreover,wedecidedto
useafont(Helvetica)whichisrecognizedaspartofthe“basicsystem”bytheprogramswhichinterpret
¹euseofthisentryimprovesanapplication’schancesoffindingtheintendedfileandallowsittowarntheuserifthe
filehaschangedsincetheidentifierwascreated[3,Section10.3FileIdentifiers].
96
ch-psextra2.tex,v:2.27
2007/08/13
22.2 DVItoPostScriptdriversanddvips
PostScript,PDF,anSVG.Ifweweretouseanon-sasicfontornon-encodedspecialcharacters,thefont
wouldhavetobedeclared,includedandre-encoded.iswouldhavemadetheexamplesmuchmore
complex.
Finally, the PostScript, PDF, or SVGoutput generated by theutilityprograms described inthis
chapter(e.g.,
dvips
,
ps2pdf
,
dvi2svg
)ismuchmorecomplexthanthecodeshowninthissection.is
isbecauseintheirpreambletheydefinealotofgenericcommandsandfunctions(abbreviations,font
definitions,etc.)thattheyusethroughouttheoutputfileinordertominimizeitssizeandoptimizeits
performanceoninterpretersandviewers.
22.2 DVItoPostScript driversanddvips
AllcurrentimplementationsofT
E
XincludeaDVI-to-PostScriptdriverorgeneratePostScriptorPDF
directly.epossibilitiesinthisareaofsomeofthemorenotablecommercialandpublic-domainpro-
gramsarereviewedbelow.
• edriverin
Textures
(
http://www.bluesky.com/products/textures.html
fortheMac-
intoshsupports virtualfonts, direct PostScript inclusionandallthe functionalityneeded bythe
LAT
E
Xgraphicspackage.
Textures
takesspecialcaretoprovidefacilitiesforhigh-endprepresswork,
withcarefulattentiontothedetailsoftheAdobeDocumentStructuringConventions¹andtheneeds
ofcolorwork.
• AndrewTrevorrow’ssharewareMacintoshT
E
Xpackage,
OzTeX
(see
http://www.trevorrow.
com/oztex
), has support for PostScript Type1and TrueTypefonts, andincludes
dvips
,whose
\special
itrecognizesforitson-screenrendering.
• edriversinY&YT
E
X(amatched pairof
dvipsone
and theWindowspreviewer
dviwindo
pre-
viewer,see
http://www.tug.org/yandy/
)areuniqueinthat theyrelytotallyon
AdobeType
Manager
(ATM)fordisplay,andsupportPostScriptType1fontsdirectly,withouttheneedforfont
metricfiles,since theyobtainmetricinformationdirectlyfromthe outlinefont file. edrivers
arestrongonfontre-encodingfacilitiesbutdonotsupport virtualfontsandtheyprovidepartial
fontdownloading.
• MichaelVulis’
VTeX
(VisualT
E
X,seehttp://www.micropress-inc.com/)isaT
E
Xsystemthat
onMicrosoWindowsoffers nativesupportfor PostScript, SVG,PDF,HTML, as wellasOpen-
TypeandPostScriptType1fontmanipulationfrominsidetheT
E
Xengine.
• PersonalT
E
X’sPCTeX(http://www.pctex.com)isanintegratedsystemonMicrosoWindows
thatcangeneratePostScriptandPDFdirectly,hasfullsupportforPostScriptType1andTrueType
fonts, and knows about
dvips\special
commands. It comes with thenicelycraedMathTime
Profonts.
Inchoosingaprogramforpreparingyourgraphicsyoushouldtakeintoaccounttheimportance
ofportability,andthereforeuseasmuchaspossiblethestandardgraphicsandcolorpackagesthatwe
describeinthisbook.InanycasetheoutputdriversshouldconformtostandardforEncapsulatedPost-
Script,orelseinclude rawPostScriptintheoutput thataDVI-to-PostScriptdriver understands. e
list abovedetailsthefunctionssupportedbydifferent drivers and isa good startingpoint forreaders
consideringwhichsystemordrivertouse.emostwidelyusedDVIdrivertodayisundoubtedlyTom
Rokicki’s
dvips
,whichwedescribenext.
¹Seehttp://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf.
ch-psextra2.tex,v:2.27
2007/08/13
97
22
POSTSCRIPTANDPDFTOOLS
22.2.1 edvips PostScriptdriver
ForoveradecadeTomRokicki’s
dvips
DVI-toPostScript driver hasbeenrightlyregardedasthestan-
dardbywhichotherdriversaremeasured.Beingaverymatureproductitisnowastandardpartofthe
T
E
XLivedistributionandthusavailableforallcurrentcomputerplatforms(includingLinux,Macin-
tosh,andMicrosoWindows).e
dvips
programhasmanyimportantandusefulfeatures,inpartic-
ularitssupportfor
\special
commandsisextensive(MetaPost,emT
E
X,and
tpic
,colors).
Twofeaturesof
dvips
areparticularlyuseful:
• Automaticgenerationofmissingfonts:ifallelsefails,
dvips
temporarilyhaltsandcallsanotherpro-
gram tobuild what isneeded. is facilityis configurable and is not limited simplyto running
MetaFont (for the automaticgenerationof fonts a script, e.g., onLinux
MakeTeXPK
is normally
called).
• Namedcongurationles:almostallsettingscanbechangedinconfigurationfilesthatcanbespec-
ifiedonthecommandline.ismakesiteasytocontrolseveraldeviceswithdifferentcharacter-
istics.
22.2.2 Commandline andconfigurationfileoptions
eoutputfrom
dvips
canbecontrolledintwoways:bycommandlineswitchesforaparticularjoband
bycommandsinoneormoreconfigurationfiles,which letyou set parametersgloballyforthewhole
system,onaper-printerbasis,andonaper-userbasis.
When
dvips
starts up, a global
config.ps
fileissearched for(thismust exist; the search path
for configurationfiles dependsonhow theprogram was compiled). Aer this masterfileis loaded,
Unixversionsof
dvips
trytoloadaconfigurationfilecalled
.dvipsrc
fromtheuser’shomedirectory,
and othersystemslookforafilecalled
dvips.ini
.Next thecommandlineisread.If the
-P
option
is used, the correspondingconfigurationfileisreadat thispoint. Each configurationfile(therecan
bemultiple
-P
options)canoverrideanythingintheglobaloruserconfigurationfile, and itcanalso
overrideanythingseeninthecommandlineuptothepointthatthecurrent
-P
optionisread.
Aerthecommandline has beencompletelyscanned, if no
-P
optionwas selected, andthe
-o
and
-f
options werenot set, a
PRINTER
environment variableis searchedfor. If this variableexists
andaconfigurationfileforthecorrespondingprinterexists,thisconfigurationfileisloadedlastofall.
Sincetheconfigurationpathusuallyincludesthecurrentdirectoryandcanbesettoincludeanyofthe
user’sdirectories,userscanprovidelocalversionsofprinter-specificconfigurationfilestooverrideany
globalsystemcopies.
elistofallcommandlineoptionsisdisplayedbycalling
dvips
asfollows.
> dvips --help
Usage: dvips [OPTION]... FILENAME[.dvi]
a*
Conserve memory, not time
A
Print only odd (TeX) pages
b # Page copies, for posters e.g.
B
Print only even (TeX) pages
c # Uncollated copies
C # Collated copies
d # Debugging
D # Resolution
e # Maxdrift value
E*
Try to create EPSF
f*
Run as filter
F*
Send control-D at end
G*
Shift low chars to higher pos.
h f Add header file
i*
Separate file per section
j*
Download fonts partially
k*
Print crop marks
K*
Pull comments from inclusions
l # Last page
98
ch-psextra2.tex,v:2.27
2007/08/13
22.2 DVItoPostScriptdriversanddvips
m*
Manual feed
M*
Don’t make fonts
mode s Metafont device name
n # Maximum number of pages
N*
No structured comments
noomega
Disable Omega extensions
o f Output file
O c Set/change paper offset
p # First page
P s Load config.$s
pp l Print only pages listed
q*
Run quietly
r*
Reverse order of pages
R*
Run securely
s*
Enclose output in save/restore S # Max section size in pages
t s Paper format
T c Specify desired page size
u s PS mapfile
U*
Disable string param trick
v
Print version number and quit
V*
Send downloadable PS fonts as PK
x # Override dvi magnification
X # Horizontal resolution
y # Multiply by dvi magnification
Y # Vertical resolution
z*
Hyper PS
Z*
Compress bitmap fonts
# = number
f = file
s = string
* = suffix, ‘0’ to turn off
c = comma-separated dimension pair (e.g., 3.2in,-32.1cm)
l = comma-separated list of page ranges (e.g., 1-4,7-9)
Email bug reports to tex-k@mail.tug.org.
enumberofcommand-lineswitches(andconfigurationoptions)isratherlarge(infactmostfunc-
tionscanbeaccessedineitherway).efollowingcatalogueclassifiestheavailablefunctionsbycom-
mand lineswitch and/ortheconfigurationfilecommand letter. Most options with noparametercan
beturnedoffbyimmediatelysuffixingtheoptionwithazero.¹Withinaconfigurationfile, anyempty
lineorlinestartingwith aspace,asterisk,equalsign,orapound signisignored.Allother linesmust
taketheformofacommandletter,followedbyaspace,andthensomeparameter.
Pageselection
-p
number
Startprintingatthepagenumberednumber.edefaultisthefirstpageinthe
document.Ifnumberisprefixedby
=
,thenitistreatedastheabsolutesequencenumberratherthan
theLAT
E
Xpagenumber(technically,thevalueof
\count0
).us,using
-p=9
startswith theninth
pageofthedocument,regardlessofhowthepagesareactuallynumberedontheprintout.
-l
number
Stopprintingaerthepagenumberednumber.edefaultisthelastpageinthe
document.Aprefixof
=
meansthatthenumberisrelativetothenumberofpagesinthefilerather
thantheL
A
T
E
Xpagenumbers.
-pp
numbers
Print therange of pages specifiedbya comma-separated list ofnumbers. is
listcanconsistofindividualpagenumbersorpagerangesoftwonumbersseparatedbyacolon.us
youcanprintpages3to10,21,and73to92byspecifyingtheoption
-pp 3:10,21,73:92
;note
thatyoucannotusethistoreversethesequenceofpages—ifyousay
-pp 3,2,1
,pages3,2,and1
areprintedintheirnaturalorder.
-n
number
Printnumberpages;thedefaultis100000,e.g.,toget20pagesstartingfrompage
53,say
-p 53 -n 20
.
-A
Printonlytheodd-numberedpages.
-B
Printonlytheeven-numberedpages.
¹Forinstance,toturnoffpagereversalifitisonbydefault,use-r0onthecommandlineorr0inaconfigurationfile.
eoptionsthatcanbeturnedoffinthiswayare-a,-E,-f,-F,-G,-i,-j,-k,-K,-m,-M,-N,-q,-r,-R,-s,-U,-V,-z,
and-Z.eyaresignaledwitha*intheoutputofthecommanddvips --help
.
ch-psextra2.tex,v:2.27
2007/08/13
99
22
POSTSCRIPTANDPDFTOOLS
-r
r
Producepagesinreverseorder;bydefault,page1isprintedfirst.isoptionisusefulon
printerslikeHPDeskjetsthatstackpaperfaceup,sothatthepageprintedfirst is at thebottomof
thestack.
Output
-D
D
number
Setthe thehorizontaland verticalresolution indpi(dots per inch) tonumber.
isaffectsthechoiceofbitmapfontsthat areloadedandalsothepositioningoflettersinresident
PostScriptfonts.enumbermustbebetween10and10000.
-f
f
WritethePostScript tostandardoutput.Note, incidentally, that
dvips
requiresthe
.dvi
filetobe“seekable”,sotheinputcannotcomefromapipe.
-m
Specifymanualfeedfortheprinter.
-o
o
name
SendthePostScriptoutputtoafilecalledname;ifnofilenameisgiven,thenforan
inputfilecalledle
.dvi
,the output file iscalledle
.ps
.Ifthefirst characterofnameisanexcla-
mationmark, thentheremainder is used asacommandtopipe theoutput;e.g.,ifyouspecify
-o
!lpr
,theoutputisfedtothestandardUnix
print
command.(ismaynotbeenabledundersome
operatingsystems.)eoptionalsodisablestheuseofthe
PRINTER
environmentvariableandturns
offtheautomaticsendingofcontrol-Difitwasturnedonwiththe
-F
optionorintheconfiguration
file;use
-Faer
thisoptionifyouwantboth.
-O
O
offset
Movetheoriginofthepage.eosetisacomma-separatedpairofx,yvalues
suchas
.1in,-.3cm
;thexvaluemovesthepagetotherightandtheyvaluemovesitdownwards.
edefaultoriginisoneinchdownandoneinchtotherightfromtheupperlecornerofthepaper.
-t
papertype
Setthetypeofthepapertopapertype.evalueofpapertypeshouldbede-
finedinoneoftheconfigurationfiles,alongwiththeappropriatecodetoselectit.Youcanalsospecify
-t landscape
,which rotatesadocumentby90degrees. Torotateadocumentwhosesizeisnot
letter,youcanusethe
-t
optiontwice,onceforthepagesizeandoncefor
landscape
.eupper
lecornerofeachpageinthe
.dvi
fileisplacedoneinchfromtheleandoneinchfromthetop.
Useofthisoptionishighlydependentontheconfigurationfile,sincethisiswherepapertypesare
defined.
@
Defineapapersizeinaconfiguration;describedindetailinSection22.2.3.
-T
offset
Setthesizeofthepapertothepairofdimensions
offset
.isoptiontakesits
argumentsinthesamestyleas
-O
.Itoverridesanypapersize
\special
inthe
.dvi
file.
-x
number
Set themagnicationratiotonumber/1000(numbermust be between10 and
100000, and canbe areal number if increased precisionisdesired), overridingthemagnification
specified inthe
.dvi
file. It is recommended to use standard magstep values (1095, 1200, 1440,
1728,2074,2488,2986,andsoon)tolimitthetotalnumberof
.pk
filesgenerated.
-X
X
number
Setthehorizontalresolutiononlyindotsperinchtonumber.
-y
number
Setthemagnicationratiotonumber/1000times themagnificationspecifiedin
the
.dvi
file(see
-x
above).
Outputconfiguration
-E
Attempt togenerateEncapsulatedPostScriptwith thecorrect boundingbox.isworks
onlyonone-pagefiles(orone-pageselectionsfromlongerfiles),anditconsidersonlythepositions
of characters andrules,ignoringanyincludedgraphics(seep.133fora descriptionof the
epstool
programtocorrecttheboundingboxinformation, ifneeded).Inaddition,itgetstheglyphmetrics
fromthe
.tfm
file, so characterslyingoutsidetheirenclosing
.tfm
boxmayconfuseit;Notealso
100
ch-psextra2.tex,v:2.27
2007/08/13
Documents you may be interested
Documents you may be interested