🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.linux.misc
Article #2665

Re: Shrinking huge PDF files

#2665
From: Charlie Gibbs
Date: Tue, 17 Nov 2026 02:00
50 lines
3088 bytes
On 2026-11-16, Rich <rich@example.invalid> wrote:

> Charlie Gibbs <cgibbs@kltpzyxm.invalid> wrote:
>
>> Indeed.  Thanks for the help.  Unfortunately, my tests have suddenly
>> stopped working - pgmtopbm has seemingly started ignoring my threshold
>> setting.  Stripping down the commands to work on a single-page PDF:
>> 
>> $ gs -dNOPAUSE -q -r300 -sDEVICE=pgmraw -dBATCH -sOutputFile=testfile3.pgm testfile.pdf
>> $ pgmtopbm -threshold -value 0.82 testfile3.pgm >testfile3.pnm
>> $ pnmtotiff -g4 <testfile3.pnm >testfile3.tif
>> 
>> Is there something wrong with my pgmtopbm command?
>
> Not that I see from the above example, other than the result file 
> should be named ".pbm" as it is a Portable Bit Map (monochrome) file.  
> But so long as you use the same name to feed into pnmtotiff it won't 
> matter a bit what you name it.
>
>> If I remove the "-threshold -value 0.82" parameters
>> the output (testfile3.pnm) is exactly the same.
>
> Weird.  I would expect some change, as it is supposed to be outputting 
> pbm, and you should be sending in greyscale, so the two files should 
> differ.

It's frustrating that I got it to work once.  I tried purging and
re-installing the netpbm package in case something got corrupted,
but it made no difference.  If I give a bogus threshold value
(e.g. 2) pgmtopbm issues an error message.  I also tried moving
the -threshold -value parameter ahead of the input file name,
but that made no difference.  I tried arranging the command-line
parameters in many different orders, e.g.

$ pgmtopbm >testfile3.pbm testfile3.pgm -value 0.82 -threshold

The result still came out the same.  However, leaving out "-threshold":

$ pgmtopbm testfile3.pgm -value 0.82 >testfile3.pbm

gave a page with a light gray backround rather than a white one.
That's the only way I've managed to get the output to change.

Curiouser and curiouser...

-- 
/~\  Charlie Gibbs                  |  In this world there are
\ /  <cgibbs@kltpzyxm.invalid>      |  two kinds of people:
 X   I'm really at ac.dekanfrus     |  1. Those who can extrapolate
/ \  if you read it the right way.  |  from incomplete data.
Technical Details
Message-ID: <ozOKS.8897$453.6830@fx23.iad>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx23.iad.POSTED!not-for-mail
References: <Qq7KS.9052$s53.4981@fx10.iad> <%FfKS.6730$5s3.683@usenetxs.com> <NhrKS.21511$li3.13390@fx46.iad> <11degfs$3d3uk$2@dont-email.me> <vGGKS.129464$aI4.75531@fx15.iad> <11dfjun$3qfni$4@dont-email.me> <oIIKS.56667$033.46236@fx03.iad> <11dfum7$3uejh$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx23.iad.POSTED!not-for-mail
Newsgroups: comp.os.linux.misc
From: Charlie Gibbs <cgibbs@kltpzyxm.invalid>
Subject: Re: Shrinking huge PDF files
References: <Qq7KS.9052$s53.4981@fx10.iad> <%FfKS.6730$5s3.683@usenetxs.com>
 <NhrKS.21511$li3.13390@fx46.iad> <11degfs$3d3uk$2@dont-email.me>
 <vGGKS.129464$aI4.75531@fx15.iad> <11dfjun$3qfni$4@dont-email.me>
 <oIIKS.56667$033.46236@fx03.iad> <11dfum7$3uejh$1@dont-email.me>
User-Agent: slrn/1.0.3 (Linux)
Lines: 50
Message-ID: <ozOKS.8897$453.6830@fx23.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Tue, 17 Nov 2026 02:00:52 UTC
Date: Tue, 17 Nov 2026 02:00:52 GMT
X-Received-Bytes: 2857