Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #755 > unrolled thread

Show on several pages

Started byCecil Westerhof <Cecil@decebal.nl>
First post2012-06-25 03:18 +0200
Last post2012-06-25 17:34 +0200
Articles 14 — 6 participants

Back to article view | Back to comp.lang.postscript


Contents

  Show on several pages Cecil Westerhof <Cecil@decebal.nl> - 2012-06-25 03:18 +0200
    Re: Show on several pages ken <ken@spamcop.net> - 2012-06-25 07:47 +0100
      Re: Show on several pages gernot.hoffmann@hs-emden-leer.de - 2012-06-24 23:53 -0700
        Re: Show on several pages Cecil Westerhof <Cecil@decebal.nl> - 2012-06-25 09:30 +0200
          Re: Show on several pages ken <ken@spamcop.net> - 2012-06-25 16:39 +0100
            Re: Show on several pages Peter Davis <Peter.Davis@mathworks.com> - 2012-06-25 11:48 -0400
              Re: Show on several pages gernot.hoffmann@hs-emden-leer.de - 2012-06-25 09:08 -0700
            Re: Show on several pages Cecil Westerhof <Cecil@decebal.nl> - 2012-06-25 20:13 +0200
        Re: Show on several pages Peter Davis <Peter.Davis@mathworks.com> - 2012-06-25 09:02 -0400
      Re: Show on several pages Cecil Westerhof <Cecil@decebal.nl> - 2012-06-25 09:33 +0200
        Re: Show on several pages ken <ken@spamcop.net> - 2012-06-25 16:40 +0100
        Re: Show on several pages luser- -droog <mijoryx@yahoo.com> - 2012-06-25 20:58 -0700
      Re: Show on several pages Peter Davis <Peter.Davis@mathworks.com> - 2012-06-25 09:00 -0400
    Re: Show on several pages Michael Unger <spam.to.unger@spamgourmet.com> - 2012-06-25 17:34 +0200

#755 — Show on several pages

FromCecil Westerhof <Cecil@decebal.nl>
Date2012-06-25 03:18 +0200
SubjectShow on several pages
Message-ID<87bok8kx3e.fsf@Compaq.site>
I want to make two pages. On the first page is one sentence. The
second page has the same sentence and another. I tried several things,
including the following:
    %!PS-Adobe-3.0 EPSF-3.0
    %%BoundingBox: 0 0 600 400

    /usedFont     /Bookman findfont def
    /authorFont   10 def

    usedFont
    authorFont scalefont
    setfont

    newpath

    50 350 moveto
    (Line to show on page one and two) show

    save

    showpage

    restore

    50 300 moveto
    (Line to show only on page two) show

    save

    showpage

But the text:
    Line to show on page one and two
is only shown on the first page. Is what I want not possible, or am I
doing something wrong?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [next] | [standalone]


#756

Fromken <ken@spamcop.net>
Date2012-06-25 07:47 +0100
Message-ID<MPG.2a5219bfa0367eef989888@usenet.plus.net>
In reply to#755
In article <87bok8kx3e.fsf@Compaq.site>, Cecil@decebal.nl says...

> But the text:
>     Line to show on page one and two
> is only shown on the first page. Is what I want not possible, or am I
> doing something wrong?

save only saves the graphics state (colour font, linewidth etc), it 
doesn't save any marks on the page. showpage implicitly erases the new 
page, so the new page is blank.

If you want to repeat a 'show' operation you actually need to repeat the 
sequence of marking operators.

There are a number of ways of doing this, the simplest being to just 
repeat the code. If you explain what it is you need to achieve I could 
offer more concrete advice.

			Ken

[toc] | [prev] | [next] | [standalone]


#757

Fromgernot.hoffmann@hs-emden-leer.de
Date2012-06-24 23:53 -0700
Message-ID<cdeccb4d-8c33-4e32-bbb4-dd5263b1eb11@googlegroups.com>
In reply to#756
On Monday, June 25, 2012 8:47:04 AM UTC+2, ken wrote:
> Cecil says...
> 
> > But the text:
> >     Line to show on page one and two
> > is only shown on the first page. Is what I want not possible, or am I
> > doing something wrong?
> 
> save only saves the graphics state (colour font, linewidth etc), it 
> doesn't save any marks on the page. showpage implicitly erases the new 
> page, so the new page is blank.
> 
> If you want to repeat a 'show' operation you actually need to repeat the 
> sequence of marking operators.
> 
> There are a number of ways of doing this, the simplest being to just 
> repeat the code. If you explain what it is you need to achieve I could 
> offer more concrete advice.
> 
> 			Ken

Can an EPS contain more than one page?

Best regards --Gernot Hoffmann

[toc] | [prev] | [next] | [standalone]


#758

FromCecil Westerhof <Cecil@decebal.nl>
Date2012-06-25 09:30 +0200
Message-ID<877guvluft.fsf@Compaq.site>
In reply to#757
Op maandag 25 jun 2012 08:53 CEST schreef gernot hoffmann:

> On Monday, June 25, 2012 8:47:04 AM UTC+2, ken wrote:
>> Cecil says...
>>
>>> But the text:
>>> Line to show on page one and two
>>> is only shown on the first page. Is what I want not possible, or am I
>>> doing something wrong?
>>
>> save only saves the graphics state (colour font, linewidth etc), it
>> doesn't save any marks on the page. showpage implicitly erases the new 
>> page, so the new page is blank.
>>
>> If you want to repeat a 'show' operation you actually need to repeat the
>> sequence of marking operators.
>>
>> There are a number of ways of doing this, the simplest being to just
>> repeat the code. If you explain what it is you need to achieve I could 
>> offer more concrete advice.
>>
>> 			Ken
>
> Can an EPS contain more than one page?

Yes, I have a lot that contain more as one. Almost all of my EPS-files
have more as one page.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#764

Fromken <ken@spamcop.net>
Date2012-06-25 16:39 +0100
Message-ID<MPG.2a5296a173f5cf96989889@usenet.plus.net>
In reply to#758
In article <877guvluft.fsf@Compaq.site>, Cecil@decebal.nl says...

> > Can an EPS contain more than one page?
> 
> Yes, I have a lot that contain more as one. Almost all of my EPS-files
> have more as one page.

No, legal EPS files can only contain one page, showpage is not permitted 
in a EPS file.

[toc] | [prev] | [next] | [standalone]


#768

FromPeter Davis <Peter.Davis@mathworks.com>
Date2012-06-25 11:48 -0400
Message-ID<jsa18n$rg2$1@newscl01ah.mathworks.com>
In reply to#764
On 6/25/2012 11:39 AM, ken wrote:
> In article <877guvluft.fsf@Compaq.site>, Cecil@decebal.nl says...
>
>>> Can an EPS contain more than one page?
>>
>> Yes, I have a lot that contain more as one. Almost all of my EPS-files
>> have more as one page.
>
> No, legal EPS files can only contain one page, showpage is not permitted
> in a EPS file.
>

Although showpage is not legal in an EPS file, some files that would 
otherwise be EPS do contain showpage. That makes it possible to view or 
print the file on its own for proofing.

Many applications that allow EPS embedding include something like

save
/showpage{}bind def
... included EPS ...
restore

to avoid problems.

[toc] | [prev] | [next] | [standalone]


#769

Fromgernot.hoffmann@hs-emden-leer.de
Date2012-06-25 09:08 -0700
Message-ID<49346d84-4164-42c4-b2eb-ebe8205292a8@googlegroups.com>
In reply to#768
On Monday, June 25, 2012 5:48:39 PM UTC+2, Peter Davis wrote:
> On 6/25/2012 11:39 AM, ken wrote:
> > In article Cecil says...
> >
> >>> Can an EPS contain more than one page?
> >>
> >> Yes, I have a lot that contain more as one. Almost all of my EPS-files
> >> have more as one page.
> >
> > No, legal EPS files can only contain one page, showpage is not permitted
> > in a EPS file.
> >
> 
> Although showpage is not legal in an EPS file, some files that would 
> otherwise be EPS do contain showpage. That makes it possible to view or 
> print the file on its own for proofing.
> 
> Many applications that allow EPS embedding include something like
> 
> save
> /showpage{}bind def
> ... included EPS ...
> restore
> 
> to avoid problems.

I'am using always one-page EPS (there is no multi-page EPS), 
where the last code line is 'showpage'.
This works perfectly for Quite PSAlter and for all Adobe CS
programs.
http://www.fho-emden.de/~hoffmann/pstutor22112002.pdf
http://www.fho-emden.de/~hoffmann/ciegraph17052004.pdf

Best regards --Gernot Hoffmann

[toc] | [prev] | [next] | [standalone]


#770

FromCecil Westerhof <Cecil@decebal.nl>
Date2012-06-25 20:13 +0200
Message-ID<878vfb8dl7.fsf@Compaq.site>
In reply to#764
Op maandag 25 jun 2012 17:39 CEST schreef ken@spamcop.net:

> In article <877guvluft.fsf@Compaq.site>, Cecil@decebal.nl says...
>
>>> Can an EPS contain more than one page?
>>
>> Yes, I have a lot that contain more as one. Almost all of my EPS-files
>> have more as one page.
>
> No, legal EPS files can only contain one page, showpage is not permitted
> in a EPS file.

Then epstopdf works not correctly, because I have several EPS files
that get converted to PDF files of several pages.

Not that I am complaining. ;-}

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#763

FromPeter Davis <Peter.Davis@mathworks.com>
Date2012-06-25 09:02 -0400
Message-ID<js9nhq$8l0$2@newscl01ah.mathworks.com>
In reply to#757
On 6/25/2012 2:53 AM, gernot.hoffmann@hs-emden-leer.de wrote:
>
> Can an EPS contain more than one page?

No. By definition, an EPS can not contain showpage or any other 
operators that would require multiple pages. The "E" in EPS stands for 
"encapsulated," meaning that it's meant to be usable within other 
documents, so it has to operate in an unknown graphics state, and leave 
the graphics state as it was.

-pd

[toc] | [prev] | [next] | [standalone]


#759

FromCecil Westerhof <Cecil@decebal.nl>
Date2012-06-25 09:33 +0200
Message-ID<87395jlual.fsf@Compaq.site>
In reply to#756
Op maandag 25 jun 2012 08:47 CEST schreef ken@spamcop.net:

> In article <87bok8kx3e.fsf@Compaq.site>, Cecil@decebal.nl says...
>
>> But the text:
>> Line to show on page one and two
>> is only shown on the first page. Is what I want not possible, or am I
>> doing something wrong?
>
> save only saves the graphics state (colour font, linewidth etc), it 
> doesn't save any marks on the page. showpage implicitly erases the new
> page, so the new page is blank.
>
> If you want to repeat a 'show' operation you actually need to repeat the
> sequence of marking operators.
>
> There are a number of ways of doing this, the simplest being to just
> repeat the code. If you explain what it is you need to achieve I could 
> offer more concrete advice.

I want to 'revel' something more every page. I think that I should
make a function that makes page one and call that from page two, which
is also a function, which is called from page three, …

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#765

Fromken <ken@spamcop.net>
Date2012-06-25 16:40 +0100
Message-ID<MPG.2a5296c0b189fb9398988a@usenet.plus.net>
In reply to#759
In article <87395jlual.fsf@Compaq.site>, Cecil@decebal.nl says...
 
> I want to 'revel' something more every page. I think that I should
> make a function that makes page one and call that from page two, which
> is also a function, which is called from page three, ?

That's one solution certainly

[toc] | [prev] | [next] | [standalone]


#771

Fromluser- -droog <mijoryx@yahoo.com>
Date2012-06-25 20:58 -0700
Message-ID<2aaf897d-fec8-424d-ab92-9cdfed4ced95@v33g2000yqv.googlegroups.com>
In reply to#759
On Jun 25, 2:33 am, Cecil Westerhof <Ce...@decebal.nl> wrote:
> Op maandag 25 jun 2012 08:47 CEST schreef k...@spamcop.net:
>
>
>
> > In article <87bok8kx3e....@Compaq.site>, Ce...@decebal.nl says...
>
> >> But the text:
> >> Line to show on page one and two
> >> is only shown on the first page. Is what I want not possible, or am I
> >> doing something wrong?
>
> > save only saves the graphics state (colour font, linewidth etc), it
> > doesn't save any marks on the page. showpage implicitly erases the new
> > page, so the new page is blank.
>
> > If you want to repeat a 'show' operation you actually need to repeat the
> > sequence of marking operators.
>
> > There are a number of ways of doing this, the simplest being to just
> > repeat the code. If you explain what it is you need to achieve I could
> > offer more concrete advice.
>
> I want to 'reveal' something more every page. I think that I should
> make a function that makes page one and call that from page two, which
> is also a function, which is called from page three, …

Another option is to use 'copypage' instead of 'showpage'.
copypage emits the page to the output device but does not clear
the page buffer. So you can accumulate more and more things
on each page without redrawing.

Sadly, this use has been all but deprecated. Level 3 changed
the semantics so 'copypage' is a synonym for 'showpage'.

But for gs, there's a workaround to revert to the old behavior,
described here:

   http://stackoverflow.com/q/8393604/733077

[toc] | [prev] | [next] | [standalone]


#762

FromPeter Davis <Peter.Davis@mathworks.com>
Date2012-06-25 09:00 -0400
Message-ID<js9nda$8l0$1@newscl01ah.mathworks.com>
In reply to#756
On 6/25/2012 2:47 AM, ken wrote:
> In article <87bok8kx3e.fsf@Compaq.site>, Cecil@decebal.nl says...
>
>> But the text:
>>      Line to show on page one and two
>> is only shown on the first page. Is what I want not possible, or am I
>> doing something wrong?
>
> save only saves the graphics state (colour font, linewidth etc), it
> doesn't save any marks on the page. showpage implicitly erases the new
> page, so the new page is blank.

save/restore save the entire VM state, but not the graphics that have 
already been painted on the page.

gsave/grestore are for saving/restoring the graphics state.

-pd

[toc] | [prev] | [next] | [standalone]


#767

FromMichael Unger <spam.to.unger@spamgourmet.com>
Date2012-06-25 17:34 +0200
Message-ID<a4rfh0F9iiU1@mid.individual.net>
In reply to#755
On 2012-06-25 03:18, "Cecil Westerhof" wrote:

> I want to make two pages. On the first page is one sentence. The
> second page has the same sentence and another. [...]
> 
> [...]

What about storing the sentences as string variables, i.e.:

|  /phrase_1 (first sentence) def
|  /phrase_2 (second sentence) def
|
|  [...]
|
|  ... moveto phrase_1 show
|  showpage
|  ... moveto phrase_1 show ... moveto phrase_2 show
|  showpage
|
|  [...]

Michael

-- 
Real names enhance the probability of getting real answers.
My e-mail account at DECUS Munich is no longer valid.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web