Bug 693929 - Regression: Error: /undefined in --run--
Summary: Regression: Error: /undefined in --run--
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: 9.07
Hardware: Macintosh MacOS X
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
: 694078 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-22 11:56 UTC by Pavel
Modified: 2013-05-27 08:25 UTC (History)
3 users (show)

See Also:
Customer:
Word Size: ---


Attachments
problem pdf file (10.61 MB, application/pdf)
2013-04-22 12:32 UTC, Pavel
Details
problem pdf file (one page) (850.48 KB, application/pdf)
2013-04-22 12:55 UTC, Pavel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel 2013-04-22 11:56:36 UTC
I'm just trying to make one pdf from another with command line like this:

gs -sDEVICE=pdfwrite -o new.pdf old.pdf

And I get the error:

GPL Ghostscript 9.07 (2013-02-14)
Copyright (C) 2012 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in --run--
Operand stack:
--dict:1/1(L)-- Nums
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1900 1 3 %oparray_pop 1899 1 3 %oparray_pop 1883 1 3 %oparray_pop --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1161/1684(ro)(G)-- --dict:1/20(G)-- --dict:82/200(L)-- --dict:82/200(L)-- --dict:109/127(ro)(G)-- --dict:292/300(ro)(G)-- --dict:25/32(L)--
Current allocation mode is local
GPL Ghostscript 9.07: Unrecoverable error, exit code 1

What does this error mean? What is the problem?
Comment 1 Ken Sharp 2013-04-22 12:03:31 UTC
Please attach an example file to reproduce the problem, its not possible to tell what the problem is without seeing the file.
Comment 2 Pavel 2013-04-22 12:13:01 UTC
http://www.sendspace.com/file/fdyi4f - here is that pdf that i'm using
Comment 3 Ken Sharp 2013-04-22 12:18:43 UTC
Please attach the PDF here, it can be some time before we get to look at a bug, and by that time the file can have disappeared or moved.
Comment 4 Pavel 2013-04-22 12:32:09 UTC
Created attachment 9581 [details]
problem pdf file
Comment 5 Ken Sharp 2013-04-22 12:37:12 UTC
This is a 116 page file, could you not find a smaller one, or reduce the problem to a single page ?
Comment 6 Ken Sharp 2013-04-22 12:42:01 UTC
Indeed a single page is enough to exhibit the problem, which is due to the format of the page numbering.
Comment 7 Pavel 2013-04-22 12:55:52 UTC
Created attachment 9582 [details]
problem pdf file (one page)
Comment 8 Pavel 2013-04-22 12:56:43 UTC
I was given this PDF file... I've made a new file with just one page (first one) in it... can you tell me now what is the problem?

I used Multivalent.jar to make this single page PDF
Comment 9 Pavel 2013-04-22 13:57:25 UTC
Can you tell me now what is the problem?
Comment 10 Ken Sharp 2013-04-22 14:06:11 UTC
(In reply to comment #9)
> Can you tell me now what is the problem?

See comment #6
Comment 11 Pavel 2013-04-22 14:13:55 UTC
Thank you but what is this problem exactly? I mean what should I tell to the people who give me these PDF files? How should they fix their PDF file?
Comment 12 Ken Sharp 2013-04-22 14:20:50 UTC
(In reply to comment #11)
> Thank you but what is this problem exactly? I mean what should I tell to the
> people who give me these PDF files? How should they fix their PDF file?

The PDF file is perfectly valid, its a GS bug (limited to pdfwrite since other devices don't process page numbers). I'll look at the bug when I have time.
Comment 13 Pavel 2013-04-22 14:28:08 UTC
thank you. please let me know when you fix this bug
Comment 14 Ken Sharp 2013-05-16 14:18:08 UTC
*** Bug 694078 has been marked as a duplicate of this bug. ***
Comment 15 Marcos H. Woehrmann 2013-05-19 18:19:15 UTC
This is a regression, starting with:


commit 5784bfbfba7191cacce5309e88afac0851287460
Author: Ken Sharp <ken.sharp@artifex.com>
Date:   Tue Oct 2 11:07:09 2012 +0100

    Add preservation of PageLabels from input PDF files when using pdfwrite
    
    Bug #692901 "Preserve Page labels from input PDF when the output is PDF"
    
    Because hte defined pdfmark /PAGELABEL is not flexible enough to handle all
    the possible kinds of page labels in PDF, and because it transpires we don't
    emit pdfmarks when producing PostScript with ps2write, this feature does
    not use teh pdfmark syntax.
    
    It does work in a broadly similar way, we create a string from the PageLabels
    entry in the Catalog dictionary (if present) and then pass that via put_params
    with a parameter naem of pdfpagelabels (pdfmark uses a name of pdfmark).
    
    This string is then stored in the Catalog dictionary, and emitted when the
    output PDF is created.
    
    I'm unable to test this against the original report, as no specimen PDF file
    was provided.
    
    No differences expected, this makes no changes in rendering.
Comment 16 Ken Sharp 2013-05-19 18:41:53 UTC
(In reply to comment #15)
> This is a regression, starting with:

I know that, previously we didn't preserve the PageLabes at all, now we do. The test file has a /Nums array where the objects are indirect, which is what causes the problem.
Comment 17 Ken Sharp 2013-05-24 15:20:27 UTC
This commit f08dfcd4db7f6a95ac9ee983692d922c09a1ffd ignores PageLabel trees that we cannot handle. This is not a complete fix, just removes the error for now.
Comment 18 Ken Sharp 2013-05-27 08:25:15 UTC
Fixed in commit c00e028429fa7bbbe1f3902286d5b3710b670815