Maker Pro
Maker Pro

OT: printing PostScript files

  • Thread starter William Sommerwerck
  • Start date
B

Bob Larter

Jan 1, 1970
0
William said:
But I've been using the printer ever since it was introduced without
problems. (I had the LJ II and LJ III prior to that.) And I've been printing
pages with complex graphics all that time, including my own documents, and
the manuals for the Olympus E-500 and Canon 5D2. The Canon 1V manual is the
first document that has ever caused this problem.

I finally gave up and printed the Self Test page. Total RAM is 6144KB. The
PS Configuration page reports Global memory as 2308796 bytes and Local as
1530752 bytes.

Considering how cheap 16MB of RAM is ($8), perhaps I should add some.

Maybe so. 6MB is enough for the basics, but it'll drop your jobs if you
hit it with anything very complex. On the bright side, if you can find
compatible RAM for it (Kingston would be a good place to start), it'll
be cheap.
 
W

William Sommerwerck

Jan 1, 1970
0
Incidentally, I've found the type and quality of the toner to have
huge effect on print quality.

No surprise. The HP cartridges cost "too much", but the refills aren't
particularly reliable.

It's been a problem with every HP LJ4 I've ever played with. It usually
starts with occasional wrinkled pages, and turns into a paper crumpler.
New rear rollers solve the problem for the next 60K or more> pages.

Ah, well... My printer has gone through less than 22,200 pages. And I've got
the spare rollers.

What's my commission for the sale?

A laurel, and hearty handshake.

http://www.shopping.hp.com/product/printer/LaserJet/1/storefronts/CE459A%23ABA


$350 to $400. I was recommending a $120 (used) printer. I don't have
a problem with buying a better printer, but I assumed that you wanted
something cheap based on your attachment to the ancient HP LJ4M.

Yes, but $120 would buy me a new cartridge.

Speed, resolution, speed, reliability, speed, power consumption,
speed, paper handling, etc. Oh yeah, speed.

I don't use the printer heavily. So, as with the car ads, I'll imagine it
blowing nickels into my face...
 
W

William Sommerwerck

Jan 1, 1970
0
Ah, well... My printer has gone through less than 22,200 pages.
Only 22K? That's a fairly new printer. At the rate you're using it,
I would expect it to last forever if you keep it clean.

That's my expectation.

A laurel, and hearty handshake.

What's the point in making jokes if no one gets them?

My usual sales method is to loan the customer a better,
but used printer. I make sure they only have enough toner
for about a month of printing. When they run out of toner,
I usually get a phone call, which invariably results in a sale
of either a new equivalent, or the used printer.

When I first saw that commercial, I figured their vehicle was burning
dollar bills for fuel. I rarely buy current technology for my own use.
Mostly, I get previous-generation products. My customers get the
latest, while I often inherit older technology from the upgrade. The
cost savings of buying used is substantial, but one has to be willing
and able to fix and maintain things. While you're saving nickels, I'm
saving dollars.

But I've owned the printer for nigh-on to 17 years, young'un.

At the rate I'm currently printing, my toner cartridge (purchased in early
2008) will probably last another couple of years (assuming the toner doesn't
start deteriorating). At that point I can think about a new printer. "Well
done, thou good and faithful servant."
 
W

William Sommerwerck

Jan 1, 1970
0
GhostScript is your friend.
I'd be interested to know why GhostScript's output isn't "real".

I'd be interested to know why I'm supposed to switch to GhostScript.
 
W

William Sommerwerck

Jan 1, 1970
0
Ok, let's do the math. It took you 17 years to print 22,000 pages,
your consumption is approximately 1,300 pages per year. The HP LJ4M
98A carts are good for about 8000 pages (at 5% coverage). At your
present rate of toner consumption, I get a predicted life of about 6
years, of which you've already consumed 2 years. I would expect
you to be shopping for a new printer in late 2013. Please mark your
calendar. I'll remind you as I'm still expecting a commission on the
sale.

I tend to greater than 5% coverage, so it'll likely be sooner. All I know is
that I'll be in the market for a new toner cartridge.
 
B

bz

Jan 1, 1970
0
But I've been using the printer ever since it was introduced without
problems. ....
The
Canon 1V manual is the first document that has ever caused this probl
.....

SUGGESTION:
download a program like cutePDF (a free program that acts like a printer
and creates a pdf file instead of actually printing it).

THEN print the PDF.

This gets you away from the postscript expansion problem that is choking
your printer.
 
B

Bob Larter

Jan 1, 1970
0
William said:
No, it's not.

Yes it is: said:
It's a way of describing what will be printed. This requires
interpretation -- which is not the same as running a program.

When you send a print job to a PostScript printer, you're downloading a
PostScript program which is interpreted, & as a side effect generates a
bitmap which is dumped to the engine.
Read what you wrote: "PostScript" itself takes up memory in the printer." It
takes up no memory.

Yes, it does take up memory. This can be easily shown by running a PS
test print on your PS printer. It will usually list how it's allocated
the RAM.
 
B

Bob Larter

Jan 1, 1970
0
William said:
How much [RAM] memory does the 4M printer have?

I don't know (and don't care at the moment to print a test page). I assume
it's around 64MB.

IIRC, a 4M with PostScript maxes out at about 24MB of RAM. The printer
has 4 SIMM slots, one of which is taken up with the PostScript ROM. I
don't recall the default config for those printers, but I'd guess at
6-8MB. BTW, the symptom you get when you don't have enough memory is
that when you send the file, the busy light/LCD will flash as though
it's processing, then it'll go back online without actually printing
anything.
 
B

Bob Larter

Jan 1, 1970
0
William said:
At the rate I'm currently printing, my toner cartridge (purchased in early
2008) will probably last another couple of years (assuming the toner doesn't
start deteriorating).

What tends to happen to toner carts that're rarely used is that the
toner 'cakes up'. The symptom is that the prints look weak & streaky,
not unlike a nearly empty cart. You can usually fix it by taking out the
cart & giving it a thorough shake to loosen up the toner.
 
W

William Sommerwerck

Jan 1, 1970
0
Read what you wrote: "PostScript" itself takes up memory
I never wrote that! It consumes some of the address, but that's not the same
thing as consuming RAM.

PostScript is a "programming language" only in the sense that it describes
how to do something (ie, print a page). Try using it to write a compiler or
an embedded application.
 
D

D Yuniskis

Jan 1, 1970
0
William said:
I never wrote that! It consumes some of the address, but that's not the same
thing as consuming RAM.

The PostScript SIMM takes up address space. But, PostScript
*itself* uses RAM to keep track of what it is doing. Just
like a BASIC interpreter can reside in ROM (on the early
IBM XT, for example) yet still require RAM to run the programs
it is fed.
PostScript is a "programming language" only in the sense that it describes
how to do something (ie, print a page). Try using it to write a compiler or
an embedded application.

I posted a PostScript PROGRAM that computes pi. To thousands of
decimal places. You *could* write a compiler in PostScript.

From wikipedia (*first* sentence of each topic):

POSTSCRIPT:
"PostScript (PS) is a dynamically typed concatenative programming
language created by John Warnock and Charles Geschke in 1982."

BASIC:
"In computer programming, BASIC (an acronym for Beginner's All-purpose
Symbolic Instruction Code[1]) is a family of high-level programming
languages."

COBOL:
"COBOL (pronounced /ˈkoʊbɒl/) is one of the oldest programming
languages."

PL/1:
"PL/I is an imperative computer programming language designed for
scientific, engineering, and business applications."

FORTRAN:
"Fortran (previously FORTRAN) is a general-purpose, procedural,
imperative programming language that is especially suited to numeric
computation and scientific computing."

ALGOL:
"ALGOL (short for ALGOrithmic Language) is a family of imperative
computer programming languages originally developed in the mid 1950s
which greatly influenced many other languages and became the de facto
way algorithms were described in textbooks and academic works for
almost the next 30 years."

C:
"C is a general-purpose computer programming language developed in
1972 by Dennis Ritchie at the Bell Telephone Laboratories for use
with the Unix operating system."

C++:
"C++ (pronounced "See plus plus") is a statically typed, free-form,
multi-paradigm, compiled, general-purpose programming language."

ML:
"ML is a general-purpose functional programming language developed
by Robin Milner and others in the late 1970s at the University of
Edinburgh, whose syntax is inspired by ISWIM."

Python:
"Python is a general-purpose high-level programming language."

Perl:
"Perl is a high-level, general-purpose, interpreted, dynamic
programming language."

SNOBOL:
"SNOBOL (String Oriented Symbolic Language) is a computer programming
language developed between 1962 and 1967 at AT&T Bell Laboratories by
David J. Farber, Ralph E. Griswold and Ivan P. Polonsky."

Lua:
"In computing, Lua is a lightweight, reflective, imperative and
functional programming language, designed as a scripting language
with extensible semantics as a primary goal."

(ad nauseum)

Do you claim that none of these other PROGRAMMING LANGUAGES are
*not* programming languages? Then why do you claim PostScript
isn't?

Spend some time *reading* a PostScript *program* and you will
see that it's much different than PCL5 output. It actually
*computes*. Download a copy of GhostScript and "talk to it".
Once you have tried this, it should be fairly obvious that
you could write a PostScript program and *interact* with it
under GhostScript.

Here's more examples (clip and send to your PS printer).
I previously posted a program to *compute* pi.
The first *computes* the date on which Easter Sunday will fall.
The second generates the verses to "99 bottles of beer on the wall".
The third one is a WEB SERVER written in PostScript!
[Credits to each of their individual authors]

Gee, they *claim* its a programming language and it sure
*behaves* like one! :>
----------8<----------------8<----------------8<-----------
%!
%%Creator: (c)2003 Oskar Schirmer, [email protected]
%%Pages: 1

-70 100 translate -14 rotate
/Helvetica findfont 42 scalefont setfont
0 680 moveto (Easter day) show
/Helvetica findfont 7 scalefont setfont
/ZS 4 string def

-2 1 9 { dup dup 0 lt exch 2 gt or {-50} {0} ifelse
1 119 { 1 index 70 mul 660 2 index 6.6 mul sub moveto
1600 add 1 index 100 mul add /Year exch def
Year ZS cvs show :) ) show
/Easter % n-th march is easter sunday (algorithm by knuth)
/Eag Year 19 mod 1 add def
/Eac Year 100 idiv 1 add def
/Eax 3 Eac mul 4 idiv 12 sub def
/Eaz 8 Eac mul 5 add 25 idiv 5 sub def
/Ead 5 Year mul 4 idiv Eax sub 10 sub def
/Eae 11 Eag mul 20 add Eaz add Eax sub 480 add 30 mod def
Eae 25 eq Eag 11 gt and Eae 24 eq or {/Eae Eae 1 add def} if
/Ean 44 Eae sub def
Ean 21 lt {/Ean Ean 30 add def} if
Ean 7 add Ead Ean add 7 mod sub
def
Easter dup 31 le {(march )} {31 sub (april )}
ifelse show dup ZS cvs show
dup dup 1 eq exch dup 21 eq exch 31 eq or or {pop (st)} {
dup dup 2 eq exch 22 eq or {pop (nd)} {
dup 3 eq exch 23 eq or {(rd)} {(th)} ifelse
} ifelse} ifelse show
} for pop
} for

showpage
----------8<----------------8<----------------8<-----------
%!PS-Adobe-0.0
%
% ``99 Bottles of Beer'' in PostScript. Demonstrates use of procedures,
% arrays, and stack manipulation. Multi-page printout (A4 and letter).
% Tadziu Hoffmann (hoffmann\100usm\56lmu\56de)

/Helvetica findfont 15 scalefont setfont
/lineskip -18 def /leftmargin 70 def /pagetop 720 def /pagebottom 50 def
/newline
{ lineskip mul currentpoint exch pop add dup pagebottom lt
{ pop showpage leftmargin pagetop moveto }
{ leftmargin exch moveto }
ifelse }
def
/min { 2 copy gt { exch } if pop } def
/buffer 8 string def
/bottles { dup 2 min vocabulary exch get exec } def
/vocabulary
[ { pop (Hello world!) ( bottles) (no more) (No more) }
{ pop (it) ( bottle) (one) (One) }
{ (one) ( bottles) 3 2 roll buffer cvs dup } ]
def
/stanza
{ dup bottles show 1 index show ( of beer on the wall, ) show
show show ( of beer.) show 1 newline
( Take ) show show ( down and pass it around, ) show
1 sub bottles pop show show pop ( of beer on the wall.) show 1.2
newline }
def
/buymore
{ (No more bottles of beer on the wall, ) show
(no more bottles of beer.) show 1 newline
( Go to the store and buy some more, ) show
bottles pop show show pop ( of beer on the wall.) show 1.2 newline }
def
/beersong { dup -1 1 { stanza } for buymore showpage } def
leftmargin pagetop moveto 99 beersong
----------8<----------------8<----------------8<-----------
%!

%===================================================
% PS-HTTPD V1.4
% Copyright 2000-2003 Anders Karlsson, [email protected]
% License: GNU General Public License
%===================================================

% This dictionary maps between extensions and mime-types
% Observe that "html" isn't part of this dict, that's because
% it's default in print_header.

/extensiondict 29 dict def
extensiondict begin
/jpg (Content-type: image/jpeg\n) def
/jpeg (Content-type: image/jpeg\n) def
/gif (Content-type: image/gif\n) def
/png (Content-type: image/png\n) def
/tif (Content-type: image/tiff\n) def
/tiff (Content-type: image/tiff\n) def
/txt (Content-type: text/plain\n) def
/css (Content-type: text/css\n) def
/ps (Content-type: application/postscript\n) def
/pdf (Content-type: application/pdf\n) def
/eps (Content-type: application/postscript\n) def
/tar (Content-type: application/x-tar\n) def
/gz (Content-type: application/x-tar\n) def
/tgz (Content-type: application/x-tar\n) def
/rpm (Content-type: application/x-rpm\n) def
/zip (Content-type: application/zip\n) def
/mp3 (Content-type: audio/mpeg\n) def
/mp2 (Content-type: audio/mpeg\n) def
/mid (Content-type: audio/midi\n) def
/midi (Content-type: audio/midi\n) def
/wav (Content-type: audio/x-wav\n) def
/au (Content-type: audio/basic\n) def
/ram (Content-type: audio/x-pn-realaudio\n) def
/ra (Content-type: audio/x-realaudio\n) def
/mpg (Content-type: video/mpeg\n) def
/mpeg (Content-type: video/mpeg\n) def
/qt (Content-type: video/quicktime\n) def
/mov (Content-type: video/quicktime\n) def
/avi (Content-type: video/x-msvideo\n) def
end


/get_file % read file /infile and send it to %stdout
{
{ % loop
infile inbuff readstring
{ stdout exch writestring }
{ stdout exch writestring infile closefile exit } ifelse
} bind loop
flush
} bind def


/concatstr % A better string-concat
{
exch dup length 2 index length add string
dup dup 4 2 roll copy length 4 -1 roll putinterval
} bind def



/hitcount % Add 1 to the hitcount-file
{
(/home/pugo/psweb/hits) (r+) file
dup dup
dup 16 string readline pop
1 index 0 setfileposition
cvi 1 add 16 string cvs
writestring (\n) writestring
closefile
} bind def


% Return extension of file on stack
/get_extension % (filepath.ext) -- (bool) (ext)
{
dup
{ % loop
(.) search
{ pop pop }
{ exit } ifelse
} loop
exch 1 index ne
} bind def


% Print a HTTP-header
/print_header % (filename) (size) --
{
stdout persistent {(HTTP/1.1 200 OK\n)} {(HTTP/1.0 200 OK\n)} ifelse
writestring
stdout (MIME-Version: 1.0\n) writestring
stdout (Server: PS-HTTPD/1.4\n) writestring
stdout (Content-Length: ) writestring
stdout exch 16 string cvs writestring
stdout (\n) writestring

get_extension
{
% If the extension exists in dictionary, then use it,
% otherwise hope that text/html is good enough.
dup extensiondict exch known
{ extensiondict exch get stdout exch writestring }
{ pop stdout (Content-type: text/html\n) writestring } ifelse
}
{ % Couldn't get extension, guess it's text/html
pop stdout (Content-type: text/plain\n) writestring
} ifelse

stdout (\n) writestring flush
} bind def


/read_command % read command from stdin and define it to /command
{
/stdin (%stdin) (r) file def
1024 string
{
% read lines until empty line
stdin 256 string readline pop
dup () eq { pop exit } { concatstr } ifelse
} loop

/command exch def
} bind def


% Parse the HTTP-command read from user
/parse_result
{
% Check if we should do HTTP 1.1 persistent connections
command (HTTP/1.1) search
{
pop pop pop
command (Connection: close) search % Check for Connection: close
{ pop pop pop /persistent false def }
{ pop /persistent true def } ifelse
}
{ pop /persistent false def } ifelse


command token
{
(GET) eq
{
( ) search
{
root exch concatstr % build path
/filename exch def pop pop % define filename and clean stack
filename filename length 1 sub 1 getinterval (/) eq
{ filename (index.html) concatstr
/filename exch def } if % add index.html

filename (..) search % Check if user tries to use ".."
{ stdout (4711 Stupid user error!\n\n) writestring quit } if pop

/infile filename (r) file def % open file

filename infile bytesavailable print_header
get_file
} if
} if
} if
} bind def


% Redefine handleerror in errordict to quit on all errors.
% Otherwise it will be possible to telnet and get a postscript-prompt
errordict begin
/handleerror { stdout (\n\nPS-HTTPD ERROR: Probably wrong URL\n\n)
writestring quit } def
end

% Buffer used to read data from file. Around 2048 bytes should be good.
/inbuff 2048 string def

% Init environment
/stdout (%stdout) (w) file def
/command () def

% Root-path (root of WWW-pages)
/root (/home/pugo/psweb/www) def


%hitcount % add one to the hitcount

% Read a command from the server and parse result
{
read_command
parse_result
persistent not { exit } if % exit if not persistent, otherwise loop
again
} loop % Loop until persistent close

quit
 
Top