how to use abcpdf in c# : Change pdf metadata application SDK utility azure .net winforms visual studio tlgc2extra11-part271

22.2 DVItoPostScriptdriversanddvips
that
dvips
output mayberesolution-dependent if
.pk
fonts areused and thisdoes not makevery
goodEPSfiles,especiallyiftheimagesaretobescaled.
-e
e
number
Placeeach charactersothatitisnomorethan numberpixelsfromits“true”
resolution-independent position on the page. e default value of this parameter is resolution-
dependent(itisthenumberofentriesinthelist100,200,300,400,500,600,800,1000,1200,1600,
2000,2400,2800,3200,…thatarelessthanorequaltotheresolutionindotsperinch).Allowingin-
dividualcharactersto“dri”fromtheircorrectlyroundedpositionsbyafewpixelsandthenregain
thetruepositionatthebeginningof eachnew wordimprovesthespacingofletterswithinwords.
However, this facilitycanbedangerous insome tabular work(e.g., with the
hhline
package) with
complicatedrulesthatmaynotbealignedproperly.Ifyouencounterproblems,setthevalueto0.
-h
h
name
Insert filenameas anadditionalPostScriptheader. If the name is simply“
-
”, this
optionsuppresses the additionof all header files to the output. e contents of the header file is
insertedintothePostScript
userdict
dictionary.
-k
Printcropmarks. isoptionincreasesthepapersize(whichshouldbespecified,either
withapapersize
\special
orwiththe
-T
option)byhalfaninchineachdimension.Eachpageis
thenmovedbyaquarterofaninchandcropmarksaredrawnineachcorner.
Fonthandling
--mode
M
mode
SpecifytheMetaFontmodeforany
.pk
fonts that mayhavetobecreated.If
thiscontradictsaspecifiedresolution,itisignored.
-M
Turn oautomaticfont generation.Ifanyfontsaremissing,commandstogeneratethe
fontsareappendedtothefile
missfont.log
inthecurrentdirectory.
-V
DownloadnonresidentPostScriptfontsasbitmaps.isrequiresuseofprogramslike
ps2pk
or
gsftopk
(bothpartoftheT
E
XLivedistribution)togeneratetherequiredbitmapfonts.
-Z
Z
Compressbitmappedfontsbeforetheyaredownloaded,therebyreducingthesizeofthe
PostScript file. isisveryusefulathighresolutionsorwhenverylargefontsareused,butitslows
downprinting,especiallyonolderprinters.
-j
j
PartiallydownloadPostScriptType1fonts.Fontsubsetsarecreatedcontainingonlythose
charactersusedinthedocument.
R
numbers
Listofdefault resolutions (theentriesinthelist,numbers, should besortedin
increasingorderandseparatedbyspaces).eseresolutionsareusedtosearchfor
.pk
fonts,ifthe
sizerequested isnot available. e output thenusesPostScript scalingto scale thefont up to the
requestedsize.e resultant output is ugly, and awarningis issued. To turnthisfeatureoff, use a
linecontaining
R
andnonumbers.
econfigurationfileandtheprinter
-P
configname
Set up theoutput for a particularconguration orprinter. isis imple-
mentedbyreadingin
config.congname
,which canset most of theoptions. Itisrecommended
thatallstandarddefaultsgoinonemaster
config.ps
fileandthatonlythingsthatvaryfromprinter
toprinter gointheconfigurationfiles,as
config.ps
isread before
config.congname
.Ifno
-P
commandisgiven, theenvironmentvariable
PRINTER
ischecked.Ifthatvariableexistsandacor-
respondingconfigurationfileisfound,thatlatterfileisread.Alternatively(underUnixonly),spec-
ifyinga
-P
optionwith nocorrespondingconfigurationfileisinterpretedasa requestto send the
output toa systemprinter calledcongname. us
-Plp1
would direct output tothe system
lp1
printerqueueif
config.lp1
doesnotexist.
ch-psextra2.tex,v:2.27
2007/08/13
101
Change pdf metadata - 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
pdf xmp metadata editor; change pdf metadata creation date
Change pdf metadata - 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
remove metadata from pdf online; modify pdf metadata
22
POSTSCRIPTANDPDFTOOLS
m
number
Setnumber(default 180000)asthesizeofprintermemorythat canbe used for
fonts. is is intended for memoryconservationand automatic splittingof the PostScript output
intosections.¹FortypicalT
E
Xjobs,youshouldworryifthereportedmemorysizeislessthanabout
300000
.Ifyouhave“unlimited”virtualmemory,justuseaveryhighnumberlikeonemillion.
I
Ignorethe
PRINTER
environmentvariable.
p
name
Set the name of thefile (default
psfonts.map
)which lists availablePostScript
fonts. is optioncandistinguish between different sets of residentfontsinprinters. Ifthe name
startswitha“
+
”character,thentherestofthenameisusedasanadditionalmapfile,ratherthanone
overridingthecurrentset.
-u
psmapfile
Set
psmapfile
tobethefilethat
dvips
usesfor lookingupPostScript font
aliases. If
psmapfile
beginswitha“
+
”character,thentherestofthenameisusedasthenameof
themap file,and themap fileisappendedto thelistofmapfiles (insteadofreplacingthe list). In
eithercase,ifthenamehasnoextension,then
.map
isaddedattheend(similartothe
p
command
in
config.ps
).
Memoryconsiderations
-a
a
Conservememorybymakingthreepassesoverthe.dvifileinsteadoftwoinorderto
loadonlythosecharactersactuallyused.
-i
Outputeachsectionintoaseparatefile.Undercertaincircumstances,
dvips
splitsthedoc-
umentupinto“sections”tobeprocessedindependently.Withthisoption,
dvips
placeseachsection
intoa separatefile; thenew filenames areconstructedbyreplacingthe suffixof thesupplied out-
putfilenamebyathree-digitsequencenumber.isoptionismostoenusedinconjunctionwith
the
-S
option,whichsetsthemaximumsectionlengthinpages.If,forinstance,yourdevicecannot
handlemorethan10pagesatatimeinonejob,youcanuse
-i -S 10
tosplititautomaticallyinto
ten-pagesectionsthatarewrittenintoseparatefiles.
--noomega
Disabletheuseof
Omega
extensionswheninterpretingDVIfiles.Bydefault,
theadditionalopcodes“129”and“134”arerecognizedby
dvips
as
Omega
extensionsandinterpreted
as requests to set two-byte characters, which means that the virtualfont array will(temporarily)
require65536positionsinsteadofthedefault256positions,andmakethememoryrequirementsof
dvips
slightlylarger.Ifthisisunacceptablethisoptionswitchestheextensionoff.
-S
i
number
Setthemaximumnumberofpagesineach“section”.isoptionismostcommonly
usedwith
-i
;whenusedinaconfigurationfile,the
i
optionisequivalentto
-i -S
.
Miscellaneous
-b
b
number
Generatenumbercopiesofeachpagebyduplicatingthepagebody.iscanbe
used,forexample,inconjunctionwithaheaderfilesetting
bop-hook
todocolorseparationsorto
typesetposters.
-c
number
Generatenumbercopiesof everypagebyusingPostScript’s
#copies
feature.
Defaultis1(forcollatedcopies,seethe
-C
option).
-C
number
Createnumberofcollated copies(byreplicatingthedatainthePostScriptfile).
¹eavailablememorycanbequeriedbysendingafilecontainingthefollowingtoyourprinter:
%!PS-Adobe-3.0
/Times-Roman findfont 30 scalefont setfont 144 432 moveto
vmstatus exch sub 40 string cvs show pop showpage
Itisusuallyagoodideatotell
dvips
thattheprinterhasratherless memorythanthenumberreturnedbythisprocedure,as
otherthingsmayfillupmemory.
102
ch-psextra2.tex,v:2.27
2007/08/13
VB.NET PDF File Compress Library: Compress reduce PDF size in vb.
Document and metadata. outputFilePath = Program.RootPath + "\\" 3_optimized.pdf"; 'create optimizing TargetResolution = 150.0F 'to change image compression
edit pdf metadata acrobat; batch pdf metadata editor
How to C#: Modify Image Metadata (tag)
Merge PDF Files; Split PDF Document; Remove Password from PDF; Change PDF Permission Settings. in PDF, C#.NET edit PDF bookmark, C#.NET edit PDF metadata, C#.NET
google search pdf metadata; view pdf metadata in explorer
22.2 DVItoPostScriptdriversanddvips
istakeslongertoprintthanwiththe
-c
option,butitismuchmoreconvenientandiseasierthan
submittingthesamePostScriptfileoverandoveragain.
-d
number
Setdebuggingoptions.isisintendedonlyforemergenciesordetailedexami-
nationbyexperts;itworksonlyif
dvips
hasbeencompiledwiththe
DEBUG
option.eusefulvalues
ofnumberarediscussedinSection22.2.7;useavalueof
-1
formaximumoutput.
--help
Printtheusagemessageandexit(seepage98).
-q
q
Runinquietmode.Normally,
dvips
showspagenumbers and thenamesoffiles thatare
included;thisoptiontellsittoprintnothingbuterrormessagestothenormalerroroutput.
-R
z
Runsecurely.isdisablescommandexecutionin
\special
(via
)andconfiguration
files(viathe“E”option),pipesasoutputfiles,andopeningofanyabsolutefilenames.e
-R1
option
overridesa
z
commandintheconfigfile.
--version
Printthe
dvips
versionnumberandexit.
-v
Identicalto
--version
.
-z
Pass “hypertext”specialsthrough totheoutputforeventualdistillationintoPDF(with
Adobe
Acrobat
or
ps2pdf
,seepage131).e
-z
optionis not enabledbydefault. With the
-z
op-
tionactive,
dvips
willconvert
\special:html...
commands intothe corresponding
pdfmark
commands,otherwisetheywillbeignored.
E
command
Executethesystemcommand immediately,whiletheconfigurationfileisbeing
read.Inmanyinstallationsthisisdisabledsoastosimplyproduceanerrormessage,asitisclearlya
securityrisk.
W
text
Iftextisgiven, itiswrittentothestandard(error)output;just theoptionbyitself
cancelsanyprevious message.isisusefulinthedefault configurationfileif you want torequire
theusertospecifyaprinter,for instance,orifyouwanttonotifytheuserthat theresultant output
hasspecialcharacteristics.
Paths
H
path
SearchpathforPostScriptheaderfiles(includingPostScriptType1fonts).een-
vironmentvariable
DVIPSHEADERS
overridesthis.
P
path
Searchpathforbitmap
.pk
fontfiles.If
%
charactersarefoundinpath,substitutions
asdescribedbelowaremade,dependingonthefollowingletter,andasearchisthenundertakenfor
theresultingfilename.
%f
fontname
%b
outputdevicehorizontalresolution(dotsperinch)
%d
fontsize(dotsperinch)
%p
fonttype(thisisalways
.pk
)
%m
fontmode(givenbythe
M
option)
Ifapathdoescontaina
%
character,thefullfilenamemustbegiven,includingthepath,ratherthan
justthedirectoryname;apathelementsuchas
/fonts/%b
triestoopen
/fonts/300
whenlooking
for
cmr10.329pk
,forinstance, andthis maynot bewhat is intended;
/fonts/%b/%f.%dpk
is
needed.
S
path
Searchpathforillustrations(suchasEncapsulatedPostScriptfiles).
T
path
Searchpathfor
.tfm
files.
V
path
Searchpathforvirtualfont
.vf
files.
ch-psextra2.tex,v:2.27
2007/08/13
103
VB.NET PDF Library SDK to view, edit, convert, process PDF file
PDF Metadata Edit. Offer professional PDF document metadata editing APIs, using which VB.NET developers can redact, delete, view and save PDF metadata.
extract pdf metadata; change pdf metadata
C# PDF File Compress Library: Compress reduce PDF size in C#.net
Document and metadata. All object data. Program.RootPath + "\\" 3_optimized.pdf"; // create optimizing TargetResolution = 150F; // to change image compression
metadata in pdf documents; edit multiple pdf metadata
22
POSTSCRIPTANDPDFTOOLS
Compatibilityissues
-F
Add Control-D(ASCIIcode4) asthe verylast character of thePostScript file. is is
usefulwith an operatingsystem interfacethat talks to theprinter directlyinstead ofvia spooling
soware.eControl-DindicatestosomePostScriptinterpretersthatajobisfinished.
-G
Shinon-printingcharacters(ASCIIcodes0–32,mostlycontrolcharacters,and127)to
higher-numberedpositions.ismaybeusefulsometimes.
-K
K
Removecomments whenincludingPostScript graphics, font files, and headers. is is
sometimesnecessarytogetaroundbugsinspoolersorPostScriptpost-processingprograms.Specif-
ically,
%%Page
comments inside EPSfiles oencausedifficulties.However, use of thisoptioncan
causesomeincludedgraphicstofail,sincethePostScriptheadermacrosfromsomesowarepack-
agesreadportionsoftheinputstreamlinebyline,searchingfor aparticularcomment. eoption
is turnedon bydefault because some PostScript previewersand spoolers have problems with the
structuringconventions.
-N
N
Turnoffstructuredcomments;thismightbenecessaryonsomesystemsthattrytointerpret
PostScriptcommentsinthewrongway,oronsomeoldPostScriptprintersorsoware.
-s
s
Enclose theentire output ina PostScriptsave andrestore pair. Tryto avoid usingthis,
sincetheresultisnotproperEPS,butitmaybenecessaryifyouaredrivingtheprinterdirectlyand
donotcareabouttheportabilityoftheoutput.
-U
U
DisableaPostScriptvirtualmemorysavingoptimizationthatstoresthecharactermetric
informationinthesamestringused tostorethebitmapinformation.isisonlynecessarywhen
usingaXerox4045PostScriptinterpreter,whichhasanoddbug.
Allof thepath-searchingconfigurations can be overriddenat run-time bysettingenvironment
variables(seetheprogramdocumentationformoredetails).
22.2.2.1 estandarddvipsconfigurationfile
eT
E
XLivedistributioncomeswiththefollowing
config.ps
configurationfile.
1
% teTeX’s config.ps. Thomas Esser, 1998, public domain.
2
3
% Memory available. Download the three-line PostScript file:
4
%
%! Hey, we’re PostScript
5
%
/Times-Roman findfont 30 scalefont setfont 144 432 moveto
6
%
vmstatus exch sub 40 string cvs show pop showpage
7
% to determine this number. (It will be the only thing printed.)
8
m 3500000
9
10
% z1 is ”secure”, i.e., inhibits execution of ‘shell commands‘ in
11
% \specials.
Dvips allows this by default.
12
z1
13
14
% How to print, maybe with lp instead lpr, etc. If commented-out, output
15
% will go into a file by default.
16
%o |lpr
17
18
% Default resolution of this device, in dots per inch.
19
D 600
20
X 600
21
Y 600
22
23
% Metafont mode.
(This is completely different from the -M
24
% command-line option, which controls whether mktexpk is invoked.)
25
% See ../../metafont/misc/modes.mf for a list of mode names.
This mode
26
% and the D number above must agree, or mktexpk will get confused.
27
M ljfour
28
29
% Last resort bitmap sizes.
30
R 300 600
104
ch-psextra2.tex,v:2.27
2007/08/13
C# PDF Library SDK to view, edit, convert, process PDF file for C#
accordingly. Multiple metadata types of PDF file can be easily added and processed in C#.NET Class. Capable C#.NET: Edit PDF Metadata. PDF SDK
embed metadata in pdf; change pdf metadata creation date
C# TIFF: TIFF Metadata Editor, How to Write & Read TIFF Metadata
C# TIFF - Edit TIFF Metadata in C#.NET. Allow Users to Read and Edit Metadata Stored in Tiff Image in C#.NET Application. How to Get TIFF XMP Metadata in C#.NET.
view pdf metadata in explorer; edit pdf metadata
22.2 DVItoPostScriptdriversanddvips
31
32
% Correct printer offset. You can use testpage.tex from the LaTeX
33
% distribution to find these numbers.
34
O 0pt,0pt
35
36
% Bitmap font compression. Results in more compact output files, but
37
% sometimes causes trouble. So the default is disabled. Set Z1 to enable
38
% this feature.
39
Z0
40
41
% Partially download Type 1 fonts by default.
Only reason not to do
42
% this is if you encounter bugs.
(Please report them to
43
% @email{tex-k@@mail.tug.org} if you do.)
44
j
45
46
% This shows how to add your own map file.
47
% An ”all-in-one” psfonts.map.
48
p psfonts.map
49
50
% Instead of psfonts.map, you can use smaller ”modules”.
51
% See updmap script for how they are concatenated to make psfonts.map
52
53
% To use the CM Type1 fonts
54
% p +bsr.map
55
% ”real” bakoma instead of interpolated bsr
56
% p +bakomaextra.map
57
% this one *or* the previous one. Not both!
58
% p +bsr-interpolated.map
59
% Taco Hoekwater’s additions
60
% p +hoekwater.map
61
62
% 0 0 595 842 is the right bounding box that most applications expect
63
% for A4.
Since dvips always rounds up, choose something slightly smaller.
64
65
@ A4size 594.99bp 841.99bp
66
@+ ! %%DocumentPaperSizes: a4
67
@+ %%PaperSize: A4
68
69
@ letterSize 8.5in 11in
70
@+ ! %%DocumentPaperSizes: Letter
71
72
.... MANY ENTRIES NOT SHOWN ....
73
74
@ unknown 0in 0in
75
@+ statusdict /setpageparams known { hsize vsize 0 1 statusdict begin {
76
@+ setpageparams } stopped end } { true } ifelse { statusdict /setpage known
77
@+ { hsize vsize 1 statusdict begin { setpage } stopped pop end } if } if
Aertheexplanationoftheconfigurationfileoptionsonthepreviouspagesmostoftheentriesshould
beself-evident.epagesizedefinitions(lines65–77)areexplainedinthenextsection.Infactweonly
showthefirsttwoentriesthatarepresentinthefileinstalledbyT
E
XLive.¹.Itisimportanttonotethat
thefirstpagesizeinthefile(
A4size
online65)willbeused as thedefaultifnoexplicitpagesizeis
specifiedwhenrunning
dvips
.elastfourlines(74–77)aresimilartothedefinitionsneededfor the
linotype (seep.107). Formore informationaboutthe thefont-relatedmapentries(lines 46–60)see
Section22.2.5.
22.2.3 Papersizes
Documentsarenormallydesignedforaparticularpapersize,whetherinportraitorlandscapeorien-
tation.Informationonpagesizeshouldideallybeplacedinthe
.dvi
file,notchosenatprinttime,and
dvips
thereforesupportsa
papersize\special
command,althoughitcanalsobespecifiedincon-
figurationfilesandonthecommandline. eformatofthe
\special
command(whichmustoccur
¹efulllistofpagesizesdefinedis:letter,legal,ledger,tabloid,a6,a5,a4,a3,a2,a1,a0,b6,b5,b4,b3,jisb0,
jisb1,jisb2,jisb3,jisb4,jisb5,jisb6,jisb7,and jisb8,seealsoTable22.1
ch-psextra2.tex,v:2.27
2007/08/13
105
C# PDF Password Library: add, remove, edit PDF file password in C#
Able to change password on adobe PDF document in C#.NET. To C# Sample Code: Change and Update PDF Document Password in C#.NET. In
remove metadata from pdf; read pdf metadata java
C# PDF Annotate Library: Draw, edit PDF annotation, markups in C#.
Able to edit and change PDF annotation properties such as font size or color. Abilities to draw markups on PDF document or stamp on PDF file.
pdf metadata viewer online; read pdf metadata online
22
POSTSCRIPTANDPDFTOOLS
somewhereonthefirstpageofthedocument)¹is:
\special{papersize=dimension,dimension}
efirst dimensionis thehorizontalsizeofthepaperand thesecond isthe verticalsize; theycanbe
expressedusinganyofthenormalT
E
Xdimensionsofin (inches),cm (centimeters),mm(millimeters),
pt(points),sp(scaledpoints),bp(bigpoints,thesameasthedefaultPostScriptunit),pc(picas),dd
(didotpoints),andcc(ciceros).usAmericanletter-sizepaperwouldbechosenbyputting:
\special{papersize=8.5in,11in}
intheL
A
T
E
Xdocument(or,better,inthedocumentclass),andA4papertobeusedinlandscapewould
bechosenwith:
\special{papersize=297mm,210mm}
Of course, usingsuch a command merelyinforms
dvips
of thedesired papersize; you must set the
\textwidth
and
\textheight
dimensions(andtheappropriatemargins)inyourLAT
E
Xdocument
classtoactuallymakeuseofthepagesize.
When
dvips
processes a file, it matches up therequested paper sizewith asetupdefined inthe
configurationfile,fromwhichitworksoutwhattoputinthePostScriptoutput.Papersizesaredefined
inconfigurationfilesbylinesstartingwith
@
.
erearethreeformatsfor
@
lines.First,anoptionspecifiedonalinebyitself,withnoparameters,
instructs
dvips
todiscard allother paper sizeinformation(possiblyfrom another configurationfile)
and start from scratch. Second, if the option contains three parameters, a keyword followed bytwo
dimensions, itisinterpreted asstartinga new papersizedescription,wherethekeywordisthename
andthedimensionsarethehorizontalandverticalsizeofthesheetofpaper.ird,ifbothdimensions
arezero(notethatyoumuststillsupplyunits,like
0mm
),thenanypagesizeinthe
.dvi
fileisamatch.If
the
@
characterisimmediatelyfollowedbya
+
character,thentheremainderoftheline(aerskipping
anyleadingblanks)istreatedas PostScript codeto send tothe printer toselect thepaper size being
defined.Withinthose
+
lines,if thefirst characterisanexclamationmark,thentheline isputinthe
initialcommentssectionofthe finaloutput file; otherwise, it is put inthesetup sectionof theoutput
file—thusthedefinitionofA4paperinthestandardconfigurationfilelookslikethis:
@ A4 210mm 297mm
@+ ! %%DocumentPaperSizes: A4
@+ %%BeginPaperSize: A4
@+ a4
@+ %%EndPaperSize
is indicates that the structured comment
%%DocumentPaperSizes: A4
is to be placed inthe
initialdocument descriptionarea,andthe
PaperSize
linesgointhesetupsection.Inthisexample,
thesinglePostScriptcommand
a4
(definedinthe
dvips
headerfiles)iswhatactuallydoestheworkof
instructingthePostScriptinterpreter,butthecodemaybearbitrarilycomplicated.Ifyouknowthatall
yourprintersunderstandLevel2PostScript,youcanuseacommandlike:
@+ << /PageSize [ 595 842 ] >> setpagedevice
When
dvips
sees a paper format on the command line, it looks for a match byname; whenit sees
a
papersize\special
command, it looks for a match bydimensions (theymust match withina
quarter ofaninch). efirstmatchfound(intheorder inwhichthepapersizeinformationis found
¹L
A
T
E
Xhasaconvenientwayofdoingthiswiththe\AtBeginDvimacro.
106
ch-psextra2.tex,v:2.27
2007/08/13
22.2 DVItoPostScriptdriversanddvips
intheconfigurationfile)isused.Ifnothingmatches,awarningisprintedandthefirstpapersizegiven
isused,sothefirstpapersizeshouldalwaysbethedefault.
Landscape mode for all paper sizes is supported automatically; aer tryingto match a pair of
dimensions,
dvips
thentriestomatchtheminreverse.Ifthatsucceeds,itinsertsPostScriptcodeinthe
outputtorotatethepages.Notethatthisisnotthesameasincludinginstructionsaskingtheprinterto
switchtoadifferentpapertray.
IfourL
A
T
E
Xfilecontains
\special{papersize=297mm,210mm}
dvips
finds thata paper sizeof210mm× 297mm inthe configurationfilemakes amatch, but adds
landscapemode. Bydefaultit behaves as ifthe paperwererotated ninetydegrees counterclockwise;
if your landscape orientationshould be rotated clockwise, the document class or document should
includethefollowingcode:
\special{! /landplus90 true store}
(
\special
commandslikethisarediscussedinSection22.2.4).However, iftheprinterdirectlysup-
portslandscapeA4paper,thentheconfigurationfileshouldhaveaspecialentryfor297mm×210mm
andsupplythecorrectPostScriptcodetoselectthedevice.
If your printer has a command to set special arbitrarypaper sizes, thenspecifydimensions of
sizezero(like
0in 0in
); thePostScript codethatsetsthepaper size canrefer to theuser-requested
dimensionsas
hsize
and
vsize
which are macros defined in PostScript that returnthe requested
sizeindefaultPostScriptunits.Forexample,insendingoutputtoaLinotronictypesetter,whichhasa
continuousrollofpaper,youcandefineapapersizenametomakethetextrunacrossthewidthofthe
filmasfollows:
@ film1 0in 0in
@+ statusdict /setpageparams known
@+ { hsize vsize 0 1 statusdict begin
@+ { setpageparams } stopped end }
@+ { true }
@+ ifelse
@+ { statusdict /setpage known
@+
{ hsize vsize 1 statusdict begin
@+
{ setpage } stopped pop end } if
@+ }
@+if
iscouldthenbeusedwithacommandlineoptionof
-t film1 -T 297mm,420mm
tosetA3pages
withthelongsidealongtheedgeofthefilm.
dvips
isdistributedwithaconfigurationfile
config.lino
thatdefinessuchsetups.
NotethatthePostScriptcommandsusedtodefinepapersizesmaywellbedevicedependentand
thusmaketheoutputlessportable.
22.2.4 InteractionwithPostScript
Itisstronglyrecommended tonotdirectlyuse
dvips\special
commandsinyourLAT
E
Xdocuments,
but instead usehigher-levelmacropackagesthatprovideportableinterfaces.Inparticular,allgraph-
ics inclusion, rotation, scaling, and color typesetting should be performed using thestandard L
A
T
E
X
ch-psextra2.tex,v:2.27
2007/08/13
107
22
POSTSCRIPTANDPDFTOOLS
graphicx
and
color
packages.elower-levelfunctionsbrieflydescribed inthissectionaremerelyin-
tentedtogivewritersofnew macropackages and thosecuriousabouthowthepackages workunder
thehoodahintofwhatisavailable.¹
ewiderangeof
\special
commandssupportedby
dvips
fallintoseveralgroups:
1. specifyingresources,generalconfigurationwithextradefinitions(e.g.,headerfiles);
2. insertingPostScriptfigures,inparticularEPSfiles;
3. insertingliteralPostScriptcode;
4. definingandusingcolor;
5. producingHyperPostScripttomakePDF;
6. supportingtheconventionsofemT
E
X,
tpic
,andMetaPost.
22.2.4.1 IncludingPostScriptfilesandliteralPostScriptcode
e
\special
commandstosteertheinclusionofresourcesandgraphicsarethefollowing:
Name
Example
Comments
papersize
\special{papersize=5in,8in}
setpapersize
landscape
\special{landscape}
specialformof
papersize
toselectlandscapeorienta-
tionofdefaultpapersize
PSfile
\special{PSfile=”pot.ps”}
insertgraphicsfile
psfile
\special{psfile=pot.ps}
insertgraphicsfile(alternativesyntax)
header
\special{header=duplex.pro}
insertPostScriptheaderfileintooutput
e
\special{PSfile=...}
commandisfollowedbyasetofkeyword=valuepairs(each pair
separatedbyspaces)tospecifythepicturesizeandotherparameters.epossiblekeysaresimilarto
thoseofthe
graphicx
package(seethe
dvips
documentation).Moreover,
dvips
doesnotinterpretitself
thegraphicsfiletobeincludedtodeterminetheboundingbox,clipping,etc. sothat inanycase this
informationwillhavetobetransmittedto
dvips
bythe
graphicx
package.
Toincludesomegraphicsfilesin
dvips
outputortosupportsophisticatedpackagesthatuseliteral
PostScriptinLAT
E
X(suchas
PSTricks
),acertainfontorheaderfilemighthavetobesentfirst.erefore,
dvips
providesthe
\special{header=...}
syntax,whosegeneralformisasfollows:
\special{header={file.ps} pre={pre code} post=post code}
eheader
file.ps
willbeincludedintheoutputdocument,precededbythePostScriptcode
pre
code
,andfollowedby
post code
.issyntaxrequirestheuseofbalancedbracesinallarguments.
Forinstance,ifthesamelogoisusedseveraltimesinadocument,itisappropriatetoloaditonly
onceatthebeginningofthedocument,e.g.,
\special{header=mylogo.eps}
Ifanonbuilt-infontisusedinoneofthefigures,itmustbeincludedseparately.Asanexampleafont
instanceofAdobeUtopiaRomancanbeincludedasfollows:
\special{header=putr.pfb}
erearetwo ways to insertPostScriptcodedirectlyinto theoutput;inthe first, “safe”method,
thecodeissurrounded intheoutput byPostScript commands tolimit its effect;the second method
is unprotectedand can affect thecurrent drawingstate. e latter is needed for operations liketext
¹efulldocumentationathttp://www.tug.org/texinfohtml/dvips.htmlshouldbeconsultedformoredetails.
108
ch-psextra2.tex,v:2.27
2007/08/13
22.2 DVItoPostScriptdriversanddvips
rotation,whenwereallydowanttochangethecurrentstate,whiletheformermightbeusedtodrawa
pageborderindependentlyofthemaintext.
e
\special
commandsforthesafeinsertionofliteralPostScriptare:
Name
Example
Comments
\special{”newpath 0 0 moveto}
insertliteralPostScript
100 100 lineto stroke
!
\special{! /magscale false def}
insertliteralPostScriptintouserdictionary
Youcandefineyourownmacrosforuseinliteralgraphicscode;theyaredefinedjustlikeliteralgraph-
ics,except thatthe
\special
commandbeginswithanexclamationmarkinsteadofadoublequote.
eseliteralmacrosareincludedaspartoftheheadermaterialinaspecialdictionary,
SDict
,which
isthefirstoneonthePostScriptdictionarystackwhenanyliteralPostScriptisused.
e
\special
commandsfortheunprotectedinsertionofliteralPostScriptare:
Name
Example
Comments
ps:
\special{ps: .5 setgray}
insertliteralPostScript
ps::
\special{ps:: 0.5 setgray}
insertliteralPostScript
ps::[begin]
\special{ps::[begin]gsave .5 setgray}
startinsertingliteralPostScript
ps::[end]
\special{ps::[end]grestore}
endinsertingliteralPostScript
ps:plotfile
\special{ps: plotfile foo.ps}
insertfileintooutput
e
::
commandscanbeused to construct anunbrokenset of PostScript commands inthe output
withaseriesof
ps::
commands,startingwith
ps::[begin]
andendingwith
ps::[end]
.ismay
beusefulwhenyouhavealotofPostScripttowrite.Ingeneral,however,usethesimple
ps:
convention
wherever possible.Whenwritingunprotected PostScript you should realizethat
dvips
workswith its
owncoordinatesystem,which isdependentontheresolution(storedinthe PostScript macro called
Resolution
).
Detailsabouthow
dvips
supportscolorandhypertextareinthe
dvips
referencedocumentation.
22.2.5 Fontsupport
Historically,T
E
Xsystemssuppliedbitmap(
.pk
)fontstoprinters.Nowadays,theprintingdevicemost
oensupportsPostScript,sothatwecanusePostScriptType1(orTrueType)variantsoftheT
E
Xfonts,
aswellas built-infonts.
dvips
manages theassociationbetweenfont names and PostScriptfont files
withthehelpoftheconfigurationfile
psfonts.map
,whichconsistsoflinesthatmapaT
E
Xfontname
ontoafullPostScriptfontname.Ithastheform:
filename PostScript-name [options]
esimplestcasesomethinhlikethefollowingline,whichinstructs
dvips
tomaptheT
E
Xname
bold-
times
ontothefullPostScriptname
Times-Bold
:
boldtimes Times-Bold
Moregenerally,
dvips
interpretstheentriesinthe
psfonts.map
fileasfollows.
1. Emptylinesorlinesbeginningwithaspace,percent,asterisk,semicolon,orhashmarkareignored.
2. Otherwise,thelineisseparatedinto“words”,definedasagroupofcharactersseparatedbyspaces,
tabs,enclosed insidedoublequotes, or startingwithadoublequoteand extendinguntiltheend
oftheline.
ch-psextra2.tex,v:2.27
2007/08/13
109
22
POSTSCRIPTANDPDFTOOLS
3. Awordstartingwith “
<<
”corresponds toa font file that isto be fullydownloaded (i.e.,partial
downloadingisprescribed).
4. Awordstartingwith“
<[
”correspondstoanencodingfiletobedownloaded(filenameendingin
.enc
).Note,however,thatencodingfilesareoenincludedjustasheaderfiles(seenextitem).
5. Awordstartingwith“
<
”correspondstoaheaderfiletobedownloaded.Ifthenameendsin
.pfa
or
.pfb
,it is takena a PostScript Type 1 font file (partiallydownloaded if the
-j
option is in
effect).Afontcanhavemorethanoneheader.Ifa“
<
”isawordbyitself,thenextwordistakenas
thenameoftheheaderfile.
6. Awordstartingwithadoublequote(
)isinprepretedasPostScriptcodetobeusedingenerating
thefontinstance.ecodeisinsertedverbatimintotheoutputattheappropriatepoint(thedouble
quotesbeginningandendingthewordareremoved).
7. Otherwisethewordisaname.efirstsuchnameisthe
.tfm
filethatavirtualfontfilecanrefer
to.Ifthereisasecondname,itisusedasthePostScriptname.Ifonlyasinglenameisspecifiedit
isusedforboththeT
E
XandthePostScriptname.
When
dvips
findsa fontnameinthe
.dvi
fileit is checkedagainst thelist foundinthemapfile
psfonts.map
.Usuallyfontnames follow thenamingschemedescribedinSection21.7onpage67.
Letushavealookatafewvariantsofthebuilt-inPaladinofont.
1
pplr8r
Palatino-Roman
”TeXBase1Encoding ReEncodeFont” <8r.enc
2
pplr8rn
Palatino-Roman
”.82 ExtendFont TeXBase1Encoding ReEncodeFont” <8r.enc
3
pplrr8re Palatino-Roman
”1.2 ExtendFont TeXBase1Encoding ReEncodeFont” <8r.enc
4
pplro8r
Palatino-Roman
”.167 SlantFont TeXBase1Encoding ReEncodeFont” <8r.enc
5
pplru8r
Palatino-Italic ”-.1763 SlantFont TeXBase1Encoding ReEncodeFont” <8r.enc
ese entries show two features of the mappingfile described in the list above. First, (see item6.
above) thePostScript code insidedoublequotes is applied to thefont when it isloaded. estring
TeXBase1Encoding ReEncodeFont
re-encodesthefonttomakeallthecharactersavailable(lines
1–5)inawayT
E
Xcanusethem. ePostScriptcommands
ReEncodeFont
,
Extendfont
(to apply
horizontal scalingtosquash the font to82% of its normalwidth, as shownonline2 or toextendit
to120%ofits normalwidth, as shownonline3) and
Slantfont
(line4shows how toslantanup-
rightfont0.167totheright creatinganobliquevariant,whileline5showshowtoslantanItalicfont
−0.176totheletocreateanuprightvariant)aredefinedintheheaderfilesthat
dvips
downloads.
Second,anythingfollowinga
<
isinterpretedasafilenamewhosecontentsaretobeplacedintheout-
put (list item5. above); inthiscase thefile
8r.enc
defines the
TeXBase1Encoding
encoding(see
Sections21.2.2onpage23andff.).
esame
<
canalsobeusedtoinstruct
dvips
todownloadafontwiththecurrentjobtotheprinter
andthereaertreatitasifitwerebuilt-in.efollowinglineindicatesthatthefont
cmr10.pfb
should
bedownloadedtosatisfyrequestsfor
cmr10
(PostScriptname
CMR10
).
cmr10 CMR10 <cmr10.pfb
Alltheavailablefeatures are exercised inthe followingtwodeclarations, which are functionally
(almost)equivalent:¹
putro8r Utopia-Regular ”.167 SlantFont TeXBase1Encoding ReEncodeFont”
<8r.enc <putr8a.pfb
putro8r Utopia-Regular ”.167 SlantFont TeXBase1Encoding ReEncodeFont”
<[8r.enc <<putr8a.pfb
¹esedeclarationsshouldbeonasinglelineisthepsfonts.mapfile.Wehavesplitthembetweentwolinesforreasons
areadability.
110
ch-psextra2.tex,v:2.27
2007/08/13
Documents you may be interested
Documents you may be interested