• Re: convert this PostScript file to one which works with \includegraphics

    From Peter Flynn@peter@silmaril.ie to comp.lang.postscript,comp.text.tex on Tue Jan 26 22:33:32 2021
    From Newsgroup: comp.lang.postscript

    On 26/01/2021 20:39, Phillip Helbig (undress to reply) wrote:
    Although not always elegant, I've always managed, with some combination
    of LaTeX, \includegraphics, and PostScript commands, to get the
    PostScript files I want included where and at the size I want them.

    The file below was created from a PDF file via ghostscript. In itself,
    it is fine; ghostscript and gv show it as it should be. However, when I
    try to include it, when viewed on the screen it flashes briefly into
    view before disappearing.

    Is it not encapsulated PostScript? If that is the problem, can
    ghostscript create such a file from a PDF file. Or is there some other problem?

    I think you need to remove the showpage command at the end. I seem to
    remember that hat's what makes it display in a stand-alone viewer, and
    it shouldn't be in an EPS file. But my memoery isn't what it was, and
    nor's my Postscript :-)

    Peter
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From ken@ken@spamcop.net to comp.lang.postscript,comp.text.tex on Wed Jan 27 07:58:30 2021
    From Newsgroup: comp.lang.postscript

    In article <rupulf$11ao$1@gioia.aioe.org>,
    helbig@asclothestro.multivax.de says...

    Is it not encapsulated PostScript?

    No, it is not. It isn't an EPS file it's a straight-forward PostScript program.


    If that is the problem, can
    ghostscript create such a file from a PDF file.

    The version of Ghostscript you are using (9.02), no. There are any
    number of problems with what you are doing there, not least the poor
    quality of output of the pswrite device. Also (as Peter Flynn point out)
    the program includes a showpage which is not legal in an EPS program
    (which this isn't) and causes the page to be flushed leading to your
    problem.

    My advice would be to upgrade to a recent version of Ghostscript (9.02
    is fast approaching it's 10th birthday) and use the eps2write device to
    create an EPS file from the PDF instead of the (deprecated and now
    removed) pswrite device.

    That will produce a better quality PostScript output, and it will be an
    EPS file.


    Ken
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From ken@ken@spamcop.net to comp.lang.postscript,comp.text.tex on Wed Jan 27 17:12:09 2021
    From Newsgroup: comp.lang.postscript

    In article <rur9m2$jlb$1@gioia.aioe.org>,
    helbig@asclothestro.multivax.de says...

    I admit that I don't fully understand when showpage is needed and when
    not. Certainly \includegraphics does display some PostScript files with
    the showpage command.

    showpage 'shows' the page, transfers the accumulated marking operations
    to the output device and erases the canvas ready for the next page.

    It is possible in PostScript to define a 'showpage' procedure (and any
    other operator) which will be used instead of the built-in operator, if
    the lookup is managed properly.

    /showpage {} bind def

    defines a function called showpage in the current dictionary which does nothing. As long as this dictionary is ahead of systemdict on the
    dictionary stack, then that's the definition of showpage which will be
    used. It's not an uncommon approach.

    In your case, simply remove the line with 'showpage' in it from the
    output PostScript file. It will still be a crappy level 1 PostScript
    program, but it at least won't reset the page for you.

    Provided you are placing it within another PostScript program (which is
    what EPS files are for) then the enclosing program's showpage will show
    the accumulated operations.

    Ken
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jeffrey H. Coffield@jeffrey@digitalsynergyinc.com to comp.lang.postscript,comp.text.tex on Wed Jan 27 11:53:06 2021
    From Newsgroup: comp.lang.postscript



    On 01/26/2021 12:39 PM, Phillip Helbig (undress to reply) wrote:
    Although not always elegant, I've always managed, with some combination
    of LaTeX, \includegraphics, and PostScript commands, to get the
    PostScript files I want included where and at the size I want them.

    The file below was created from a PDF file via ghostscript. In itself,
    it is fine; ghostscript and gv show it as it should be. However, when I
    try to include it, when viewed on the screen it flashes briefly into
    view before disappearing.

    Is it not encapsulated PostScript? If that is the problem, can
    ghostscript create such a file from a PDF file. Or is there some other problem?

    Presumably one could use some arguments to \includegraphics and/or edit
    the PostSCript file (included below; it's not large) to make it work.

    Any help would be appreciated, as would an explanation of why it works,
    so that I can learn something.

    For various reasons, I don't want to use pdflatex.


    I use the following code in PostScript documents that are going to
    include eps files:

    ----------------------------------
    /BeginEPSF {
    /b4_Inc_state save def
    /dict_count countdictstack def
    /op_count count 1 sub def
    userdict begin
    /showpage {} def
    0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin
    10 setmiterlimit [] 0 setdash newpath
    /languagelevel where
    { pop languagelevel 1 ne
    { false setstrokeadjust false setoverprint } if
    } if
    } bind def

    /EndEPSF {
    count op_count sub {pop} repeat
    countdictstack dict_count sub {end} repeat
    b4_Inc_state restore
    } bind def

    ---------------------------------

    and then use something like the following to place the eps where I want it:

    BeginEPSF 100 100 translate .5 .5 scale (simple.eps) run EndEPSF

    This also allows the eps to be used in a cached PostScript form which
    speeds up printing and reduces file size such as a complex logo that is
    on hundreds of pages.

    Jeff Coffield
    www.digitalsynergyinc.com
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Dr Eberhard W Lisse@nospam@lisse.NA to comp.lang.postscript,comp.text.tex on Sat Jan 30 16:15:48 2021
    From Newsgroup: comp.lang.postscript

    If it was a PDF, whi not include the PDF in the first place?

    el
    On 2021-01-26 22:39 , Phillip Helbig (undress to reply) wrote:
    [...]
    The file below was created from a PDF file via ghostscript. In itself,
    it is fine; ghostscript and gv show it as it should be. However, when I
    try to include it, when viewed on the screen it flashes briefly into
    view before disappearing.

    [...]
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Dr Eberhard W Lisse@nospam@lisse.NA to comp.lang.postscript,comp.text.tex on Sun Jan 31 16:07:34 2021
    From Newsgroup: comp.lang.postscript

    I still don't get it.

    The file was generated from a PDF. So include that one as PDF

    If there are many PS files which are generated from PDF include
    many PDFs.

    If there are PS generated from other means, include them as PS.

    I handle 'many files' by way of a Makefile, which works on Linux and
    the Mac (and I am sure on Windoze (and VMS :-)-O))

    el

    On 2021-01-30 22:28 , Phillip Helbig (undress to reply) wrote:
    In article <i7l80lFjr52U2@mid.individual.net>, Dr Eberhard W Lisse <nospam@lisse.NA> writes:

    If it was a PDF, whi not include the PDF in the first place?

    Because there are many PostScript files to be included. So convert one
    PDF to PostScript, or several PostScript to PDF.

    --- Synchronet 3.21d-Linux NewsLink 1.2