How to print pdf file directly to printer

  • Thread starter =?iso-8859-1?q?Ricardo_R=EDos?=
  • Start date
?

=?iso-8859-1?q?Ricardo_R=EDos?=

Hi wizards, I need an advice, I have a report in Ireport , How can I
print this report directly to printer. it is possible ?
Thanks in advance.
 
R

Roedy Green

Hi wizards, I need an advice, I have a report in Ireport , How can I
print this report directly to printer. it is possible ?
Thanks in advance.

Since printers don't understand PDF, only PostScript, the strict
answer to your question is, it is impossible. You will need something
that understands PDF and can print, e.g. acrobat or clone.

See http://mindprod.com/jgloss/pdf.html
 
G

Gordon Beaton

Since printers don't understand PDF, only PostScript, the strict
answer to your question is, it is impossible. You will need
something that understands PDF and can print, e.g. acrobat or clone.

Or spool through a filter like ghostscript.

/gordon

--
 
J

JohnT

Since printers don't understand PDF, only PostScript, the strict
answer to your question is, it is impossible. You will need
something that understands PDF and can print, e.g. acrobat or
clone.

See http://mindprod.com/jgloss/pdf.html

Actually, that's not entirely true. HP printers understand PCL (PCL
is an HP invention) as well as PS. They *can* understand PDF as
well (printing natively) if they have the correct patches (firmware)
applied.


--
** Filtering out Google Groups since 2007-08-02 RLU 451587
** Nothing will ever be attempted if all possible objections
** must first be overcome. Samuel Johnson
** The Usenet Improvement Project:
http://blinkynet.net/comp/uip5.html
 
L

Lew

JohnT said:
Actually, that's not entirely true. HP printers understand PCL (PCL
is an HP invention) as well as PS. They *can* understand PDF as
well (printing natively) if they have the correct patches (firmware)
applied.

At one time, no printer spoke Postscript. They all had proprietary control
codes. Now there are two kinds of printer out there - those that speak
Postscript natively and those that speak a proprietary control code.
Sometimes the same printer is both, that is, bilingual.

Either way, Roedy's point holds. Whether it's Postscript or some other
printer command code, something must transform the output from the computer's
format to the printer's.
 
L

Lew

Roedy Green expounded upon us in
Either way, Roedy's point holds. Whether it's Postscript or some other
printer command code, something must transform the output from the
computer's format to the printer's.

Though now that I think of it, PDF is Postscript so it really should print
natively on PS printers, shouldn't it?
 
J

JohnT

Roedy Green expounded upon us in


Though now that I think of it, PDF is Postscript so it really
should print natively on PS printers, shouldn't it?

PS and PDF are two different schemas. If you ever get a chance,
open a PS file in a text editor and then try to do the same thing
with a PDF. You can actually edit the PS file if you need to, but
you can't do this with PDFs.

I know for a fact, having done this myself, that without the proper
drivers, non-HP printers (i.e Lexmark) cannot render the PCL
properly. But, and I should add, any printer can print PCL with
the proper drivers. It's the drivers that act as the interperter.

Furthermore, it is possible to stream PS files together and create
one large file, but you can't do that with PDF files. You have to
disassemble them to PS and then stream the PS together. It's
something ghostscript can do, but I haven't had a reason to try it.
I was able to take PDF files and convert them to PS so that they
would print as passthrough (no conversion required... take it and
print it). This is, as opposed to having to RIP the PDF to MOD:CA
first.

Yeah.. I know.. too much information.. but this is what I do for a
living, that's why I know a bit about how printers work. Or at
least how they do in the infrastructure I designed.



--
** Filtering out Google Groups since 2007-08-02 RLU 451587
** Nothing will ever be attempted if all possible objections
** must first be overcome. Samuel Johnson
** The Usenet Improvement Project:
http://blinkynet.net/comp/uip5.html
 
J

Joshua Cranmer

JohnT said:
PS and PDF are two different schemas. If you ever get a chance,
open a PS file in a text editor and then try to do the same thing
with a PDF. You can actually edit the PS file if you need to, but
you can't do this with PDFs.

You can also edit the PDF if your editor is nice about handling binary
formats as well. The only binary stuff is streams, and that is generally
only a problem if the PDF uses any sort of filters (or contains a
picture)... which happens to be true for all but maybe two PDF's out there.

That said, modifying PDF's is really dangerous, and it is not a good
idea to do so by hand.
 
R

Roedy Green

Though now that I think of it, PDF is Postscript so it really should print
natively on PS printers, shouldn't it?

PostScript is human-readable. PDF is not. Perhaps PDF is PostScript
plus extra junk (e.g. indexes), then compressed.

PDF is gradually becoming an interchange format like HTML, where you
want precise control of the layout.

Adobe pulled off a near miracle, persuading the major font companies
to allow their fonts to be embedded in PDF files, without royalties.
There is no way to do this with standard HTML, CSS or Java. If you
include the fonts, everyone will see the document with the proper
fonts. If you don't, people without the fonts installed will see the
document with a rough approximation to the correct font using Adobe's
morphing master font technology. The document will be rendered with
whatever fonts the end user has available. They may look absolutely
nothing like the ones you used to compose the document. Only the
glyphs you actually use in the document are included. If you don't
want the bulk, the distiller will save some information about the font
metrics instead, then the viewer's reader software can warp one of the
installed fonts to create a substitute that will at least have the
same spacing even if it looks nothing like the original font.
 
P

Pseudo Silk Kimono

Since printers don't understand PDF, only PostScript, the strict
answer to your question is, it is impossible. You will need something
that understands PDF and can print, e.g. acrobat or clone.

See http://mindprod.com/jgloss/pdf.html

Mr. Green:

You seem to have an abundance of knowledge about various document formats.
If I may, I would like to ask you a question. Is there a way to imbed
what could be considered versioning (i.e. Subversion or CVS) tags within a
PDF document without disassembling the PDF and then rebuilding?

Thank you.
 
R

Roedy Green

You seem to have an abundance of knowledge about various document formats.
If I may, I would like to ask you a question. Is there a way to imbed
what could be considered versioning (i.e. Subversion or CVS) tags within a
PDF document without disassembling the PDF and then rebuilding?

see http://mindprod.com/jgloss/pdf.html

There are all manner of tools for creating and editing PDF documents.
Perhaps if you check the list out you will find something. I doubt
Subversion or CVS will be smart enough to embed tags, unless they have
now implemented pluggable inserter. I have only seen it plop raw text
in as comments. You might prod the creators of Subversion and CVS
with an "innocent" question on how you go about embedding version info
in PDF. Likely, PDFs will have to be treated like binaries without
any embedding.
 
I

Ian Wilson

Roedy said:
Perhaps PDF is PostScript plus extra junk (e.g. indexes), then compressed.

No, Postscript is a programming language with flow-control,
conditionals, loops, subroutines, recursion, etc.
AFAIK PDF isn't.

Consider loop.ps

%!PS
/Helvetica 12 selectfont
/y 780 def
1 1 600 {
72 y moveto
(Postscript is a proper programming language) show
/y y 12 sub def
y 70 lt {
showpage
/y 780 def
} if
} for
showpage

As Postscript that is a file with size 211 bytes. Converted to PDF using
Ghostscript I get a PDF file with size 1536 bytes. That's because the
conversion to PDF has to (effectively) unroll the loop.

If you change 600 to a much larger number, the Postscript file size only
goes up by a one or two bytes. The PDF file size will go up by hundreds
of thousands of bytes.

The 895 byte Postscript program at
http://www.acm.org/tog/resources/RTNews/html/rtnv6n2.html#art11
expands to a 1,321,462 byte PDF!
(The PS is well worth copying to a file and running in GS!)

PDF is not a superset of Postscript. Each has features and capabilities
the other doesn't.
 
P

Pseudo Silk Kimono

Some printers *do* understand PDF.
e.g. HP Color LaserJet 4650 series printer

Print languages, std.
HP PCL 6, HP PCL 5c (Web download),
HP postscript level 3 emulation,
native PDF printing

<http://h10010.www1.hp.com/wwpc/us/en/sm/WF06a/18972-236251-23626
8-15077-f58-375773.html>

NO Freaking way. Did you happen to notice if they mention whether
or not these printers can handle batch printed PDFs, or do you
still have to open them up with Acrobat or something like that. HP
told me a while ago that their new HP9050's could print PDF's
natively and I was happy as a clam. But, alas, what they told me
did not help me with the problem of printing them in a batch
format. Oh well.. this is extremly Off-Topic so perhaps we should
move it to a more appropriate forum?
 
R

Roedy Green

NO Freaking way. Did you happen to notice if they mention whether
or not these printers can handle batch printed PDFs, or do you
still have to open them up with Acrobat or something like that. HP
told me a while ago that their new HP9050's could print PDF's
natively and I was happy as a clam. But, alas, what they told me
did not help me with the problem of printing them in a batch
format. Oh well.. this is extremly Off-Topic so perhaps we should
move it to a more appropriate forum?

How would Windows set that up. Perhaps you have two logical printers
attached to the same physical printer, one speaking PS or PCL and the
other PDF. Then you need some way of passing a PDF through unmodified
and also to create a PDF from meta print calls.

Sounds like something quite tricky to pull off without help from
Windows.
 
P

Pseudo Silk Kimono

How would Windows set that up. Perhaps you have two logical printers
attached to the same physical printer, one speaking PS or PCL and the
other PDF. Then you need some way of passing a PDF through unmodified
and also to create a PDF from meta print calls.

Sounds like something quite tricky to pull off without help from
Windows.

Alas, I do not believe Windows is capable of pulling that off. We use a
software package which converts the PDF to printable PCL using MOD:CA as
its PSF mechanism.
 
P

Pseudo Silk Kimono

PDF is not a superset of Postscript. Each has features and capabilities
the other doesn't.

Ghostscript, with the correct options, does a great job of converting PDF
to Postscript which can then be printed on pretty much any printer. I had
to create something like that to eliminate an unnecessary load on a print
server. It works like a charm.
 
I

Ian Wilson

Roedy said:
How would Windows set that up. Perhaps you have two logical printers
attached to the same physical printer, one speaking PS or PCL and the
other PDF. Then you need some way of passing a PDF through unmodified
and also to create a PDF from meta print calls.

Sounds like something quite tricky to pull off without help from
Windows.

There are 3rd party utilities like "Printfile"[1] but I use what comes
with Windows XP pro ...


1) Windows XP pro "command prompt" :

C:\>lpr /?

Sends a print job to a network printer

Usage: lpr -S server -P printer [-C class] [-J job] [-o option] [-x]
[-d] filename

Options:
-S server Name or ipaddress of the host providing lpd service
-P printer Name of the print queue
-C class Job classification for use on the burst page
-J job Job name to print on the burst page
-o option Indicates type of the file
(by default assumes a text file)
Use "-o l" for binary (e.g. postscript) files
-x Compatibility with SunOS 4.1.x and prior
-d Send data file first

C:\>lpr -S jetdirect -P auto loop.ps


2) A printer icon on my Windows XP pro desktop to which I drag and drop
text, PCL or PS files from "Windows Explorer".

To create the icon:
Right click on the desktop, select "new", "shortcut"
enter the target as
%windir%\System32\lpr.exe -S jetdirect -P auto %1%


For local printers and for printers that dont know the LPD protocol, I
expect you can use the "copy /b" command with a target like LPT1: or
//computername/printername.

There seems to no Java content in this posting, my apologies for that!


[1] http://www.lerup.com/printfile/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top