groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Huge Filesize of PS file 12M


From: John Gardner
Subject: Re: Huge Filesize of PS file 12M
Date: Sat, 23 Jan 2021 11:37:56 +1100

>
> Because I still see a lot of this [in the Postscript file]. Can I somehow
> remove them. I don't need all those special characters.


In PostScript, you can "initialise" an array with a value with

/Encoding [
    255 {/.notdef} repeat
] def

% Set array entries individually
Encoding 0  /asciicircum put
Encoding 34 /quotedbl    put

% Print contents of array to stdout for inspection
Encoding ==


Compressed, that becomes:

/E[255{/.notdef}repeat]def E 0/asciicircum put E 34/quotedbl put


I use an enhanced alternative
<https://github.com/Alhadis/Stupid-Post-Tricks/blob/09a98036abba913c0766e60d1bac2008e7d71c5c/inspect.ps>
to PostScript's built-in `==` operator, which is imported with:

%!PS
(/path/to/inspect.ps) run

% Usage:

<< /foo (Bar) /baz (Qux) >> ===

(Check gs(1) for details on the library search-path and invocation syntax).

Cheers,
— John (@Alhadis <https://github.com/Alhadis>)



On Sat, 23 Jan 2021 at 10:08, Wim Stockman <wim.stockman@gmail.com> wrote:

> Hi, Thank you Werner for your great input.
> So I'll leave the embedded fonts out and take it a step further.
> I'm thinking of going old school. I generate once a nice stationary
> letterhead with groff.
> and for the letters themselves I start them at the right vertical
> position..
> I looked it up with the \n[ln] register. So I know where to start. And if
> they need printing or mailing.
> I create a small script two stamp the letter on to the stationary.
> I tried this out and worked like a charm.
>
> I even added gzip to reduce the postscript files which slashed the file
> size even more by 50%
> So now I have a one time stationary letter file of 88KB which contains two
> company logos. and an average letter that is around 10KB
> When I gzip them I have the header of 40KB and the average letter is less
> than 3KB.
> This is quite a victory coming from 12MB a file.
> Thank you ,
> Kind regards
> Wim Stockman
>
> Op do 21 jan. 2021 om 11:12 schreef Werner LEMBERG <wl@gnu.org>:
>
> >
> > > So thank you for the tip. I disabled the fonts in the /devps/download
> > file
> > > and it went from 12MB to 92K so that is already a big step forward.
> > > Is there a better way to disable the embedding of fonts ?
> >
> > Not that I'm aware of.
> >
> > > Because I still see a lot of this :
> > > "
> > > grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
> > > def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron
> > > /Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef
> > >
> /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
> > >
> /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
> > >
> /.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
> > > /ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
> > > "
> > > in the Postscript file.  Can I somehow remove them. I don't need all
> > > those special characters.
> >
> > No, you can't.  Those arrays are encoding vectors necessary to access
> > those fonts in general, regardless whether they are embedded or not.
> >
> > As I told you in the previous e-mail: You need to postprocess groff's
> > PS output to get something smaller since font subsetting is not
> > implemented.
> >
> >
> >     Werner
> >
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]