[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Difference between ps and pdf
From: |
Valery Ushakov |
Subject: |
Re: Difference between ps and pdf |
Date: |
Wed, 6 Apr 2016 14:52:24 +0300 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, Apr 06, 2016 at 09:32:09 +0200, Matej Cepl wrote:
> On 2016-04-06, 02:40 GMT, Valery Ushakov wrote:
> > PDF backend is not really suitable for anything advanced.
> > It's ok for text and tables, but graphics doesn't really work.
> > Advanced graphics in Lout relies on PS interpreter to do
> > computations to "finish" the layout. This obviously can't
> > work with PDF.
>
> My question is whether Lout generated PostScript travels without
> problems to PDF via ps2pdf. Could one be certain that whatever
> tricks they make in PostScript will carry to PDF?
Absolutely. This is what distillers do by definition.
If you need reassurance - the user manual that uses all lout features
and distills ok :).
You can see obvious examples of this in graphf.etc, e.g.:
def "*"
precedence 35
left x
right y
{
x y "mul"
}
etc to "compile" infix notation of Lout expressions into postfix PS
code. Or
def xloop
named from { 0 }
named to { 0 }
named by { 1 }
named do named x { "xval" } {}
{
from by to "{ /xval exch def" do "} for"
}
to emit PS loops.
PDF backend prodives only a very simple hack for basic graphics (see
READMEPDF). And even when PDF backend scripting hack is powerful
enough to what you need, you have to to explicitly write
@BackEnd @Case {
PostScript @Yield {
{ ... ps code ... } @Graphic x
}
PDF @Yield {
{ ... pseudo code ... } @Graphic x
}
}
which is messy and error prone because the code is duplicated. So
it's much easier to just use PS and distill to PDF.
PS: (no pun intended) Still, the standalone PDF backend, warts and
all, is quite handy when you need it and understand its limitations.
-uwe