/
usr
/
share
/
ghostscript
/
8.70
/
lib
/
/usr/share/ghostscript/8.70/lib
mkdir
upload
Name
Size
Mode
Actions
acctest.ps
4324
0644
edit
dl
rm
addxchar.ps
9848
0644
edit
dl
rm
align.ps
2313
0644
edit
dl
rm
bdftops.ps
23403
0644
edit
dl
rm
bj8.rpd
639
0644
edit
dl
rm
bj8gc12f.upp
1528
0644
edit
dl
rm
bj8hg12f.upp
1527
0644
edit
dl
rm
bj8oh06n.upp
1513
0644
edit
dl
rm
bj8pa06n.upp
1521
0644
edit
dl
rm
bj8pp12f.upp
1538
0644
edit
dl
rm
bj8ts06n.upp
1526
0644
edit
dl
rm
bjc610a0.upp
1523
0644
edit
dl
rm
bjc610a1.upp
1512
0644
edit
dl
rm
bjc610a2.upp
1513
0644
edit
dl
rm
bjc610a3.upp
1518
0644
edit
dl
rm
bjc610a4.upp
1526
0644
edit
dl
rm
bjc610a5.upp
1513
0644
edit
dl
rm
bjc610a6.upp
1513
0644
edit
dl
rm
bjc610a7.upp
1516
0644
edit
dl
rm
bjc610a8.upp
1522
0644
edit
dl
rm
bjc610b1.upp
1512
0644
edit
dl
rm
bjc610b2.upp
1513
0644
edit
dl
rm
bjc610b3.upp
1518
0644
edit
dl
rm
bjc610b4.upp
1526
0644
edit
dl
rm
bjc610b6.upp
1513
0644
edit
dl
rm
bjc610b7.upp
1517
0644
edit
dl
rm
bjc610b8.upp
1522
0644
edit
dl
rm
bjc6000a1.upp
1660
0644
edit
dl
rm
bjc6000b1.upp
1660
0644
edit
dl
rm
caption.ps
1721
0644
edit
dl
rm
cbjc600.ppd
11040
0644
edit
dl
rm
cbjc800.ppd
11383
0644
edit
dl
rm
cdj550.upp
1686
0644
edit
dl
rm
cdj690.upp
1995
0644
edit
dl
rm
cdj690ec.upp
2056
0644
edit
dl
rm
cid2code.ps
4475
0644
edit
dl
rm
decrypt.ps
350
0644
edit
dl
rm
dmp_init.ps
7246
0644
edit
dl
rm
dmp_site.ps
459
0644
edit
dl
rm
dnj750c.upp
2804
0644
edit
dl
rm
dnj750m.upp
1971
0644
edit
dl
rm
docie.ps
7373
0644
edit
dl
rm
dumphint.ps
20044
0644
edit
dl
rm
escp_24.src
350
0644
edit
dl
rm
font2c.ps
19591
0644
edit
dl
rm
font2pcl.ps
17568
0644
edit
dl
rm
ghostpdf.ppd
25643
0644
edit
dl
rm
gslp.ps
19643
0644
edit
dl
rm
gsnup.ps
2725
0644
edit
dl
rm
gs_ce_e.ps
2364
0644
edit
dl
rm
gs_cmdl.ps
4844
0644
edit
dl
rm
gs_fform.ps
3162
0644
edit
dl
rm
gs_il2_e.ps
2777
0644
edit
dl
rm
gs_kanji.ps
3942
0644
edit
dl
rm
gs_ksb_e.ps
3291
0644
edit
dl
rm
gs_l.xbm
1945
0644
edit
dl
rm
gs_l.xpm
2751
0644
edit
dl
rm
gs_lgo_e.ps
2886
0644
edit
dl
rm
gs_lgx_e.ps
1912
0644
edit
dl
rm
gs_l_m.xbm
1955
0644
edit
dl
rm
gs_m.xbm
945
0644
edit
dl
rm
gs_m.xpm
1437
0644
edit
dl
rm
gs_m_m.xbm
955
0644
edit
dl
rm
gs_pfile.ps
4349
0644
edit
dl
rm
gs_rdlin.ps
862
0644
edit
dl
rm
gs_s.xbm
594
0644
edit
dl
rm
gs_s.xpm
957
0644
edit
dl
rm
gs_s_m.xbm
604
0644
edit
dl
rm
gs_t.xbm
345
0644
edit
dl
rm
gs_t.xpm
605
0644
edit
dl
rm
gs_t_m.xbm
355
0644
edit
dl
rm
gs_wl1_e.ps
2530
0644
edit
dl
rm
gs_wl2_e.ps
2528
0644
edit
dl
rm
gs_wl5_e.ps
2546
0644
edit
dl
rm
ht_ccsto.ps
228194
0644
edit
dl
rm
image-qa.ps
73323
0644
edit
dl
rm
impath.ps
5538
0644
edit
dl
rm
jispaper.ps
930
0644
edit
dl
rm
landscap.ps
1525
0644
edit
dl
rm
level1.ps
110
0644
edit
dl
rm
lines.ps
3868
0644
edit
dl
rm
markhint.ps
3473
0644
edit
dl
rm
markpath.ps
1890
0644
edit
dl
rm
mkcidfm.ps
7305
0644
edit
dl
rm
necp2x.upp
1041
0644
edit
dl
rm
necp2x6.upp
1065
0644
edit
dl
rm
packfile.ps
10358
0644
edit
dl
rm
pcharstr.ps
3584
0644
edit
dl
rm
pdf2dsc.ps
8377
0644
edit
dl
rm
PDFA_def.ps
1170
0644
edit
dl
rm
pdfopt.ps
36516
0644
edit
dl
rm
pdfwrite.ps
11676
0644
edit
dl
rm
PDFX_def.ps
1868
0644
edit
dl
rm
pf2afm.ps
15351
0644
edit
dl
rm
pfbtopfa.ps
1141
0644
edit
dl
rm
PM760p.upp
1160
0644
edit
dl
rm
PM760pl.upp
1124
0644
edit
dl
rm
PM820p.upp
1142
0644
edit
dl
rm
PM820pl.upp
1117
0644
edit
dl
rm
ppath.ps
1974
0644
edit
dl
rm
pphs
391
0644
edit
dl
rm
pphs.ps
6922
0644
edit
dl
rm
prfont.ps
6487
0644
edit
dl
rm
printafm.ps
3775
0644
edit
dl
rm
ps2ai.ps
22485
0644
edit
dl
rm
ps2ascii.ps
44618
0644
edit
dl
rm
ps2epsi.ps
8187
0644
edit
dl
rm
quit.ps
5
0644
edit
dl
rm
ras1.upp
211
0644
edit
dl
rm
ras3.upp
210
0644
edit
dl
rm
ras4.upp
216
0644
edit
dl
rm
ras8m.upp
205
0644
edit
dl
rm
ras24.upp
215
0644
edit
dl
rm
ras32.upp
192
0644
edit
dl
rm
rollconv.ps
11765
0644
edit
dl
rm
s400a1.upp
1454
0644
edit
dl
rm
s400b1.upp
1603
0644
edit
dl
rm
sharp.upp
1936
0644
edit
dl
rm
showchar.ps
2932
0644
edit
dl
rm
showpage.ps
9
0644
edit
dl
rm
sipixa6.upp
529
0644
edit
dl
rm
st640ih.upp
2277
0644
edit
dl
rm
st640ihg.upp
1504
0644
edit
dl
rm
st640p.upp
1910
0644
edit
dl
rm
st640pg.upp
1137
0644
edit
dl
rm
st640pl.upp
1874
0644
edit
dl
rm
st640plg.upp
1101
0644
edit
dl
rm
stc.upp
1919
0644
edit
dl
rm
stc2.upp
1900
0644
edit
dl
rm
stc2s_h.upp
2268
0644
edit
dl
rm
stc2_h.upp
1875
0644
edit
dl
rm
stc200_h.upp
1844
0644
edit
dl
rm
stc300.upp
2132
0644
edit
dl
rm
stc300bl.upp
1337
0644
edit
dl
rm
stc300bm.upp
1426
0644
edit
dl
rm
stc500p.upp
1899
0644
edit
dl
rm
stc500ph.upp
1899
0644
edit
dl
rm
stc600ih.upp
2277
0644
edit
dl
rm
stc600p.upp
1147
0644
edit
dl
rm
stc600pl.upp
1111
0644
edit
dl
rm
stc640p.upp
1091
0644
edit
dl
rm
Stc670p.upp
1159
0644
edit
dl
rm
Stc670pl.upp
1124
0644
edit
dl
rm
Stc680p.upp
1140
0644
edit
dl
rm
Stc680pl.upp
1115
0644
edit
dl
rm
stc740ih.upp
2123
0644
edit
dl
rm
Stc740p.upp
1039
0644
edit
dl
rm
Stc740pl.upp
1115
0644
edit
dl
rm
Stc760p.upp
1141
0644
edit
dl
rm
Stc760pl.upp
1115
0644
edit
dl
rm
Stc777p.upp
1140
0644
edit
dl
rm
Stc777pl.upp
1115
0644
edit
dl
rm
stc800ih.upp
2154
0644
edit
dl
rm
stc800p.upp
1111
0644
edit
dl
rm
stc800pl.upp
1093
0644
edit
dl
rm
stc1520h.upp
2150
0644
edit
dl
rm
stcany.upp
669
0644
edit
dl
rm
stcany_h.upp
677
0644
edit
dl
rm
stcinfo.ps
25733
0644
edit
dl
rm
stcolor.ps
5221
0644
edit
dl
rm
stc_h.upp
1909
0644
edit
dl
rm
stc_l.upp
730
0644
edit
dl
rm
stocht.ps
2646
0644
edit
dl
rm
Stp720p.upp
1158
0644
edit
dl
rm
Stp720pl.upp
1115
0644
edit
dl
rm
Stp870p.upp
1140
0644
edit
dl
rm
Stp870pl.upp
1115
0644
edit
dl
rm
traceimg.ps
1528
0644
edit
dl
rm
traceop.ps
2734
0644
edit
dl
rm
type1enc.ps
2536
0644
edit
dl
rm
type1ops.ps
7576
0644
edit
dl
rm
uninfo.ps
6136
0644
edit
dl
rm
unprot.ps
1904
0644
edit
dl
rm
viewcmyk.ps
2113
0644
edit
dl
rm
viewgif.ps
4573
0644
edit
dl
rm
viewjpeg.ps
4949
0644
edit
dl
rm
viewmiff.ps
3778
0644
edit
dl
rm
viewpbm.ps
5307
0644
edit
dl
rm
viewpcx.ps
4345
0644
edit
dl
rm
viewps2a.ps
1282
0644
edit
dl
rm
wftopfa.ps
8923
0644
edit
dl
rm
winmaps.ps
3743
0644
edit
dl
rm
wrfont.ps
18168
0644
edit
dl
rm
zeroline.ps
2463
0644
edit
dl
rm
Edit:
/usr/share/ghostscript/8.70/lib/pdfwrite.ps
(11676B)
% Copyright (C) 1999, 2000, 2001 Aladdin Enterprises. All rights reserved. % % This software is provided AS-IS with no warranty, either express or % implied. % % This software is distributed under license and may not be copied, % modified or distributed except as expressly authorized under the terms % of the license contained in the file LICENSE in this distribution. % % For more information about licensing, please refer to % http://www.ghostscript.com/licensing/. For information on % commercial licensing, go to http://www.artifex.com/licensing/ or % contact Artifex Software, Inc., 101 Lucas Valley Road #110, % San Rafael, CA 94903, U.S.A., +1(415)492-9861. % $Id: pdfwrite.ps 9246 2008-11-27 01:58:54Z alexcher $ % Writer for transmuting PDF files. % NOTES: % We do editing by replacing objects (in the cache) and then doing a % simple recursive walk with object renumbering. % Free variables: % RMap [per input file] (dict): input_obj# => output_obj# % PDFfile (file): current input file % OFile (file): current output file % XRef (dict): output_obj# => output_file_pos % ToWrite: 0..N-1 => [obj# gen#] .languagelevel 2 .setlanguagelevel .currentglobal true .setglobal /PDFWRDEBUG where { pop } { /PDFWRDEBUG false def } ifelse % ======== Long dictionary support =============== % % The key must be a non-negative iteger. /ld_dict { % <len> ld_dict <ldict> pop << 0 <<>> >> } bind def /ld_length { % <ldict> ld_length <length> 0 exch { exch pop length add } forall } bind def /ld_get { % <ldict> <key> ld_get <any> dup 3 1 roll -15 bitshift get exch get } bind def /ld_put { % <ldict> <key> <any> ld_put - 3 1 roll dup % any ldict key key 4 1 roll -15 bitshift % key any ldict key>>15 2 copy known { get % key any subdict 3 1 roll put % - } { 64 dict dup 6 1 roll % <<>> key any ldict key>>15 <<>> put put } ifelse % - } bind def /ld_known { % <ldict> <key> ld_known <bool> dup 3 1 roll -15 bitshift % key <<>> key<<15 2 copy known { get exch known } { pop pop pop //false } ifelse } bind def /ld_knownget { % <ldict> <key> ld_known false | <any> true dup 3 1 roll -15 bitshift % key <<>> key<<15 2 copy known { get exch .knownget } { pop pop pop //false } ifelse } bind def /ld_def { % <key> <any> ld_def - currentdict 3 1 roll ld_put } bind def /ld_forall { % <ldict> <proc} ld_forall - { forall exch pop } aload pop 4 2 roll 4 packedarray cvx forall } bind def /ld_clone { % <ldict> ld_clone <ldict copy> << exch { dup length dict copy } forall >> } bind def % ================ Object mapping ================ % % Initialize the object number and location map. /omapinit { % - omapinit - /RMap 100 ld_dict def /XRef 100 ld_dict def PDFWRDEBUG { (omapinit) = } if } bind def % Map an object number. /omapnew { % <oldobj#> omap <newobj#> <isnew> RMap 1 index ld_knownget { exch pop //false } { PDFWRDEBUG { (omap\() print dup =only } if RMap dup ld_length 1 add % old# <<>> len+1 2 index exch dup % old# <<>> old# len+1 len+1 5 1 roll % len+1 old# <<>> old# len+1 ld_put pop //true % len+1 true PDFWRDEBUG { (\) = ) print 1 index = } if } ifelse } bind def /omap { % <oldobj#> omap <newobj#> omapnew pop } bind def % Save and restore the object map. % Note that currentomap either returns a copy or calls omapinit. /currentomap { % <copy> currentomap <omap> { [RMap ld_clone XRef ld_clone] } { [RMap XRef] omapinit } ifelse } bind def /setomap { % <omap> setomap - aload pop /XRef exch def /RMap exch def PDFWRDEBUG { (setomap: #Xref = ) print XRef ld_length =only (, #RMap = ) print RMap ld_length = } if } bind def % ================ Writing ================ % % ---------------- Low-level output ---------------- % % Write a string on the output file. /ows { % <string> ows - OFile exch writestring } bind def % ---------------- Scalars ---------------- % % Note that the '#' character isn't legal in a name unless it is a prefix % for a hex encoded character (for PDF 1.2 and later). The following assumes % that the names are already valid PDF 1.2+ names so that we can treat the % '#' as a legal character. The next two hex characters are already in the % set of valid name characters. PDF 1.1 and earlier allowed spaces in names % which probably wouldn't make it past the tokenizer anyway. /pdfnamechars (!"$&'*+,-.0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\^_`abcdefghijklmnopqrstuvwxyz|~) readonly def /pdfwritename { % <name> pdfwritename - (/) ows .namestring { ( ) dup 0 4 -1 roll put //pdfnamechars 1 index search { pop pop pop } { pop 0 get 256 add 16 =string cvrs dup 0 (#) 0 get put } ifelse ows } forall } bind def % ---------------- Composite objects ---------------- % /pdfwriteprocs mark /resolveR { pdfwriteref } /O { pdfwritenewref } .dicttomark readonly def /pdfwritearray { % <array> pdfwritearray - dup xcheck { aload pop //pdfwriteprocs exch get exec } { % Because of a bug in Acrobat's parser for linearization parameters, % we have to include some whitespace after the opening [ (!). ([ ) ows { pdfwritevalue (\n) ows } forall (]) ows } ifelse } bind def /pdfwritedict { % <dict> pdfwritedict - dup xcheck { pdfwritestream } { (<<) ows { exch pdfwritevalue ( ) ows pdfwritevalue (\n) ows } forall (>>) ows } ifelse } bind def % ---------------- References ---------------- % /pdfwritenewref { % <newobj#> pdfwritenewref - OFile exch write=only ( 0 R) ows } bind def /pdfwriteref { % <obj#> <gen#> pdfwriteref - 1 index omapnew { ToWrite dup length 5 -2 roll 2 packedarray put } { exch pop exch pop } ifelse pdfwritenewref } bind def /pdfcopystring 200 string def /pdfwritestream { % <streamdict> pdfwritestream - % Remove File, FilePosition, and StreamKey; % optimize by replacing an indirect Length. dup dup length dict copy % Stack: origdict dict dup /File undef dup /FilePosition undef dup /StreamKey undef dup /Length known { dup /Length get dup oforce ne { dup /Length 2 copy oget put } if } { 1 index /File get dup 3 index /FilePosition get setfileposition dup 0 (endstream) /SubFileDecode filter flushfile .fileposition 9 sub 2 index /FilePosition get sub 1 index exch /Length exch put } ifelse exch dup /File get dup 3 -1 roll /FilePosition get setfileposition pdfcopystream } bind def % We put copying the stream contents in separate procedures so that we % can replace this function if desired. /pdfcopybytes { % <fromfile> <tofile> <length> pdfcopybytes - { dup 0 eq { exit } if //pdfcopystring 0 2 index 2 index length .min getinterval 3 index exch readstring 3 1 roll 3 index 1 index writestring length sub exch not { exit } if } loop pop pop pop } bind def /pdfcopystream { % <newstreamdict> <file> pdfcopystream - % (file has been positioned) 1 index pdfwritevalue (stream\n) ows exch /Length get OFile exch pdfcopybytes (endstream) ows } bind def % ---------------- General values/objects ---------------- % /pdfwritetypes mark % Scalars /nulltype { pop (null) ows } bind /integertype { =string cvs ows } bind /booleantype 1 index /realtype { =string cvs (e) search { % PDF has no exponential format exch pop % exp pre exch cvi exch (-) anchorsearch { ows } if (.) search { exch pop % exp (frac) (int) 1 index length % exp (frac) (int) len 3 1 roll % exp len (frac) (int) exch concatstrings % exp len (int_frac) 3 1 roll sub % (int_frac) exp-len exch % exp-len (int_frac) } if % exp (mant) 1 index 0 ge { ows { (0) ows } repeat (.) ows } { dup length % exp (mant) len 3 -1 roll add % (mant) exp+len dup 0 le { (0.) ows neg { (0) ows } repeat ows } { 2 copy 0 exch getinterval ows (.) ows 1 index length 1 index sub getinterval ows } ifelse } ifelse } { ows } ifelse } bind /stringtype { OFile exch write===only } bind /nametype { pdfwritename } bind % Composite/reference objects /arraytype { pdfwritearray } bind /packedarraytype 1 index /dicttype { pdfwritedict } bind .dicttomark readonly def /pdfwritevalue { % <obj> pdfwritevalue - PDFWRDEBUG { (****Writing: ) print dup === flush } if //pdfwritetypes 1 index type get exec } bind def % We make pdfwriteobjdef a separate procedure for external use. /pdfwriteobjheader { % <newobj#> pdfwriteobjheader - XRef 1 index OFile .fileposition ld_put PDFWRDEBUG { (XRef\() print dup =only (\) = ) print XRef 1 index ld_get = } if OFile exch write=only ( 0 obj\n) ows } bind def /pdfwriteobjdef { % <newobj#> <value> pdfwriteobjdef - exch pdfwriteobjheader pdfwritevalue (\nendobj\n) ows } bind def /pdfwriteobj { % <obj#> <gen#> pdfwriteobj - 1 index exch resolveR exch omap exch pdfwriteobjdef } bind def % ---------------- File-level entities ---------------- % % Write a PDF file header. % Free variables: OFile, PDFversion. /pdfwriteheader { % - pdfwriteheader - (%PDF-) ows OFile PDFversion write= (%\347\363\317\323\n) ows } bind def % Write a cross-reference table and trailer. /pdfwritexref { % <firstobj#> <#objs> pdfwritexref - (xref\n) ows OFile 2 index write=only ( ) ows OFile 1 index write= 1 index add 1 sub 1 exch { dup 0 eq { pop (0000000000 65535 f \n) ows } { XRef exch ld_get 1000000000 add =string cvs dup 0 (0) 0 get put ows ( 00000 n \n) ows } ifelse } for } bind def /pdfwritetrailer { % <trailer> pdfwritetrailer - (trailer\n) ows % Since we always write a complete "classic" xref, the Trailer may need to be adjusted: % - remove keys that pertain to xref-streams and hybrid-xref PDFs; % - if it's a PDF stream, turn it into a PDF dict by removing keys used for % PDF streams (both standard and GS-specific), and the executable attribute dup /XRefStm known 1 index xcheck or { dup length dict copy dup {/Type/Index/W /XRefStm /Filter/DecodeParms/Length/File/FilePosition} { undef dup } forall pop % note: the executable attribute is "removed" by not being copied } if pdfwritevalue (\n) ows } bind def /pdfwritestartxref { % <startpos> pdfwritestartxref - (startxref\n) ows OFile exch write= (%%EOF\n) ows } bind def % ================ Top-level control ================ % /pdfwrite { % <file> <trailer> pdfwrite - 10 dict begin /trailer exch def /OFile exch def /ToWrite 100 dict def omapinit % Write the PDF file header. pdfwriteheader % Write the objects. trailer { exch pop dup xcheck { % The only executable objects are references. aload pop pop pdfwriteobj } { pop } ifelse } forall % Walk the object graph. { ToWrite dup length dup 0 eq { pop pop exit } if 1 sub 2 copy get 3 1 roll undef aload pop pdfwriteobj } loop % Write the xref table and trailer. /xref OFile fileposition def 0 XRef ld_length 1 add pdfwritexref trailer dup length 1 add dict copy trailer xcheck { cvx } if dup /Size XRef ld_length 1 add put pdfwritetrailer xref pdfwritestartxref end } bind def .setglobal .setlanguagelevel
Save
cmd:
run