title: Ghostscript error limitcheck in string
body: <p>Why is the final part of my PDF creation process failing please.  See output from ps2pdf command below.  This is at the end of my own developed tool chain.  I harvest images from Matlab, stitch them together using LaTeX and then create the final PDF using latexmk.</p>
  
  <p>This has worked fine until now when the document in question has grown to 3356 pages!</p>
  
  <p>File position 238282 in file output.ps (as mentioned in the ghostscript error output) is towards the end of the "SDict begin [ {Catalog} &lt;&lt; /PageLabels&lt;>1&lt;>2 " line.  This line is 51542 chars long and describes all 3356 pages.</p>
  
  <p>Is this line length just too long now?  If I trim my .tex file down towards 3000 pages and re-run the latexmk it completes fine.</p>
  
  <p>Running ps2pdf in isolation to show error.  Same error when run from latexmk:</p>
  
  <pre><code>C:\temp&gt;c:\MiKTeX\miktex\bin\ps2pdf.exe output.ps output.pdf &gt; error.txt 2&gt;&amp;1
  </code></pre>
  
  <p>Gave output:</p>
  
  <pre><code>Error: /limitcheck in --string--
  Operand stack:
     --nostringval--   --nostringval--   --dict:1/1(L)--   PUT   --nostringval--   2   --nostringval--   2   false   --nostringval--   --nostringval--   (])   --nostringval--   --nostringval--   (3327)   --nostringval--   --nostringval--   P   1   .pdfcvstring   (&lt;&lt;\n/P \(3225\)\n&gt;&gt; 3226 &lt;&lt;\n/P \(32)   (&lt;&lt;\n/Nums [0 &lt;&lt;\n/P \(1\)\n&gt;&gt; 1 &lt;&lt;\n/P \(1\)\n&gt;&gt; 2 &lt;&lt;\n/P \(2\)\n&gt;&gt; 3 &lt;&lt;\n/P \(3\)\n&gt;&gt; 4 &lt;&lt;\n/P \(4\)\n&gt;&gt; 5 &lt;&lt;\n/P \(5\)\n&gt;&gt; 6 &lt;&lt;\n/P \(6\)\n&gt;&gt; 7 &lt;&lt;\n/P \(7\)\n&gt;&gt; 8 &lt;&lt;\n/P \(8\)\n&gt;&gt; 9 &lt;&lt;\n/P \(9\)\n&gt;&gt; 10 &lt;&lt;\n/P \(10\)\n&gt;&gt; 11 &lt;&lt;\n/P \(11\)\n&gt;&gt; 12 &lt;&lt;\n...)   65550
  Execution stack:
     %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_pop   1893   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1917   4   5   %oparray_pop   --nostringval--   3   1   2   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   --nostringval--   --dict:1/1(L)--   --nostringval--   1   %dict_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   --nostringval--   --dict:1/1(L)--   --nostringval--   1   %dict_continue   --nostringval--   --nostringval--   %zwritecvp_continue   1   %s_proc_write_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--
  Dictionary stack:
     --dict:1159/1684(ro)(G)--   --dict:0/20(G)--   --dict:81/200(L)--   --dict:188/300(L)--   --dict:36/200(L)--   --dict:10/10(G)--
  Current allocation mode is local
  Last OS error: No such file or directory
  Current file position is 238282
  MiKTeX GPL Ghostscript  9.00: Unrecoverable error, exit code 1
  </code></pre>
  
  <p>Edit: Added my complete page labels line from the postscript file that goes into ps2pdf.  See pastebin entry <a href="http://pastebin.com/FFvZpaRY" rel="nofollow">http://pastebin.com/FFvZpaRY</a></p>