Bug 17241

Summary: does not handle correctly documents without the %%Page comments
Product: libspectre Reporter: Pino Toscano <toscano.pino>
Component: generalAssignee: Carlos Garcia Campos <carlosgc>
Status: RESOLVED MOVED QA Contact: Carlos Garcia Campos <carlosgc>
Severity: normal    
Priority: medium CC: bugs, carlosgc, yu.shijun
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Pino Toscano 2008-08-21 06:09:23 UTC
There are documents without the %%Page comments, that gs (and gv) can render only incrementally (ie one page after another), without possibility to go back to the previous page or navigate to a specific page.

One example of that is the document attached to:
  http://bugs.kde.org/show_bug.cgi?id=169530
Comment 1 Carlos Garcia Campos 2009-10-10 04:13:18 UTC
*** Bug 20924 has been marked as a duplicate of this bug. ***
Comment 2 Christopher Yeleighton 2010-06-20 05:43:31 UTC
Indeed, the following file (without any comments) does not draw anything in Okular:

.5 .5 scale
100 100 translate
.5 setgray 
0 0 1000 1000 rectstroke 
10 dict begin
/ob 50 def
/barv .3 def
/stw 100 def
/h1 1000 ob add barv mul def
/h2 h1 stw add def
/w2 stw h2 1000 ob add div 500 mul add def
/l2 2 500 w2 sub mul def
/h3 500 ob add l2 mul 500 div def
0 setgray
0 0 moveto
500 1000 ob add rlineto
500 -1000 ob sub rlineto
stw neg 0 rlineto barv -500 mul h1 rlineto
barv 1 sub 1000 mul stw 2 mul add 0 rlineto
barv -500 mul h1 neg rlineto
stw neg 0 rlineto closepath
w2 h2 rmoveto l2 0 rlineto l2 -.5 mul h3 rlineto 
l2 -.5 mul h3 neg rlineto closepath 
eofill
end
showpage
Comment 3 Christopher Yeleighton 2010-06-20 08:09:45 UTC
(In reply to comment #2)
> Indeed, the following file (without any comments) does not draw anything in
> Okular:
> 

It seems that %!PS-Adobe-* prolog is required, otherwise nothing is rendered.  This feature is, however, undocumented.
Comment 4 Christopher Yeleighton 2010-06-20 08:21:39 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Indeed, the following file (without any comments) does not draw anything in
> > Okular:
> > 
> 
> It seems that %!PS-Adobe-* prolog is required, otherwise nothing is rendered. 
> This feature is, however, undocumented.

It is documented in libspectre/ps.c; however, that file is not in the public API and therefore Doxygen does not process it at all.

Also, the AUTHORS file should mention Timothy O. Theisen and Jose E. Marchesi because their code is used.
Comment 5 Christopher Yeleighton 2010-06-20 08:24:50 UTC
(In reply to comment #4)
> Also, the AUTHORS file should mention Timothy O. Theisen and Jose E. Marchesi
> because their code is used.

And the README file should state "Contains code from ghostview".
Comment 6 Carlos Garcia Campos 2010-09-05 02:12:21 UTC
*** Bug 29749 has been marked as a duplicate of this bug. ***
Comment 7 GitLab Migration User 2018-10-12 21:36:08 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/libspectre/libspectre/issues/9.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.