~ubuntu-branches/ubuntu/hardy/ghostscript/hardy

« back to all changes in this revision

Viewing changes to lib/pdf_rbld.ps

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2007-11-22 12:17:43 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071122121743-cd70s3ypq0r243mp
Tags: 8.61.dfsg.1-0ubtuntu1
* New upstream release
  o Final 8.61 release
* debian/patches/09_ijs_krgb_support.dpatch: Adapted to upstream changes.
* debian/rules: Updated CUPS-related variables for "make install" calls.
* debian/rules: Remove /usr/include/ghostscript from the ghostscript
  package, they go into lings-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14
14
% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15
15
 
16
 
% $Id: pdf_rbld.ps 8022 2007-06-05 22:23:38Z giles $
 
16
% $Id: pdf_rbld.ps 8327 2007-10-28 14:19:46Z alexcher $
17
17
% pdf_rbld.ps - Rebuilding of broken PDF files (xref errors)
18
18
 
19
19
% This module contains routines that are used if we detect an error
31
31
 
32
32
% Note:  This procedure is also used by non-rebuild code.
33
33
% Store a line in the xref array (Actually Objects and Generations arrays)
34
 
% <obj num> (strm num> <obj loc> <gen num>  setxrefentry <obj num> strm num>
35
 
%                                                        <obj loc> <gen num>
 
34
% <obj num> (strm num> <obj loc> <gen num> <rebuild>
 
35
%                         setxrefentry <obj num> strm num> <obj loc> <gen num>
36
36
/setxrefentry
37
 
{       % We store generation numbers as value + 1
 
37
{
 
38
  5 1 roll
 
39
        % We store generation numbers as value + 1
38
40
        % We reserve 0 to indicate an free xref entry
39
41
  1 add                 % increment generation number
40
42
        % To save space, generations numbers are stored in a lstring unless we
70
72
    } if
71
73
        % Set error flag if we have equal object and generation numbers
72
74
    Generations 4 index lget 1 index eq { /dup_obj_gen_num true def } if
73
 
  } ifelse
 
75
  } 8 -1 roll { ifelse } { pop if } ifelse  % Run 'else' only when rebuilding.
74
76
} bind def
75
77
 
76
78
% Print the contents of the xref array.  This actually consists of three
207
209
  exch 2 div lt { search_start_trailer } { search_end_trailer } ifelse
208
210
  % get the trailer
209
211
  PDFfile exch setfileposition          % set to the specified trailer location
 
212
  /dictlevelcount 0 def
210
213
  PDFfile traileropdict .pdfrun         % read trailer info
211
214
  /Trailer exch def
212
215
} bind def
274
277
              % save xref parameters into ObjectStream, Objects and Generations
275
278
              1 index 0                 % rearrange parms for setxrefentry
276
279
              4 index PDFoffset sub 3 index
277
 
              setxrefentry              % save parameters
 
280
              //true setxrefentry       % save parameters
278
281
              pop pop pop pop           % clear parameters
279
282
            } if                        % check if name is 'obj'
280
283
          } if                          % check if we got 'obj" string