Topic: Printer Setup/Troubleshooting

When setting up an LPD printer it would be great to have a "Print Test Page" button to help with troubleshooting/testing.  When printing fails elsewhere in the application and a failure message appears FA doesn't say which printer failed to print.  This makes setting troubleshooting more difficult.

Thanks!

Craig.

Re: Printer Setup/Troubleshooting

It would also be great if there were a selection to send PS vs. PDF to the printer.  I'm using a Brother printer and unlike an HP it won't accept a PDF (prints 50 pages of the text in the PDF file)

Re: Printer Setup/Troubleshooting

Lastly below is a little example code to FTP a PDF to a printer (works with most HP printers) as an additional option:

//Close and output PDF document
$pdf->Output('test.pdf', 'F');


$file = 'test.pdf';
$remote_file = 'print_invoice.pdf';

$ftp_server = '192.168.X.Y';  // Printer IP Address
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, 'test', '');
if (ftp_put($conn_id, $remote_file, $file, FTP_BINARY)) {
    echo "successfully uploaded $file to $ftp_server at ".date('l jS \of F Y h:i:s A')."\n";
} else {
    echo "There was a problem while uploading $file to $ftp_server at ".date('l jS \of F Y h:i:s A')."\n";
}
ftp_close($conn_id);

Re: Printer Setup/Troubleshooting

I think you will find the reason why HP accepts PDF and Brother does not is that most HP printers support Postscript and PCL while the Brother may just print PCL.

Postscript Level3 (which has been around for a few years now) natively supports printing a PDF file. If your Brother is actually a Postscript printer, it may only support Level 2 and hence have no PDF support.

You may be able to use Ghostscript to emulate  postscript printer on a non postscript device but it is a long time since I played with it at all.

I am not up with Unix, but also have a look at the XPDF suite  (also available for Windows). It includes a command line tool that converts PDF to PS. Perhaps you could modify your script to convert the PDF file to PS then send the PS to a Postscript Level 2 printer.

Good luck!

[b]RodW[/b]
Brisbane, QLD, Australia

Re: Printer Setup/Troubleshooting

Thanks RodW.

I checked and my printer is an MFC-7840W:
http://www.brother-usa.com/mfc/modeldetail.aspx?PRODUCTID=MFC7840W

Supports "BR-Script 3" which they say is PS3 compatible.

I always thought that inside the PDF wrapper was postscript and that was why it was easy to convert.

You make an excellent point, an additional selection for the printer postscript level would also be helpful.

Re: Printer Setup/Troubleshooting

TCPDF class used in FA does not support PostScript, but just PDF, so we cannot select the PS output format. This coversion is normally done on printer server side which is normally connected to local network with LPD protocol. I haven't know that HP net printers support FTP protocol form the box, do they?

Janusz

Re: Printer Setup/Troubleshooting

Yes, all HP JetDirect cards support FTP and it is enabled by default (Can be disabled, but most don't)  Brother printers support FTP as well, but only of PS documents.

Would it be possible to allow a command to be run to post-process the PDF output?  Most Linux distributions include ghostscript by default which includes PDF2PS (lowercase) which is easily called as pdf2ps input.pdf output.ps to output a file or pdf2ps input.pdf and the output is returned to standard out.

Thanks,

Craig.

Re: Printer Setup/Troubleshooting

CraigP wrote:

Yes, all HP JetDirect cards support FTP and it is enabled by default (Can be disabled, but most don't)  Brother printers support FTP as well, but only of PS documents.

Would it be possible to allow a command to be run to post-process the PDF output?  Most Linux distributions include ghostscript by default which includes PDF2PS (lowercase) which is easily called as pdf2ps input.pdf output.ps to output a file or pdf2ps input.pdf and the output is returned to standard out.

Thanks,

Craig.

Craig, You are on to me! You have found the tool I spoke of that is part of XPDF which lives here:
http://www.foolabs.com/xpdf/
The syntax of this command can be found here:
http://linux.about.com/library/cmd/blcmdl1_pdftops.htm

I have seen the open source XPDF tool bundled into high end graphics conversion software so it is pretty robust.

I think your Brother is running a buggy third party emulation of Postscript which does not support native PDF rasterising so it is failing. Best postscript support comes from the genuine Adobe PS3 Raster Image Processor (RIP), but RIP offerings from Harlequin and Jaws are also excellent. Look to see if PCL can be disabled on the Brother as it is possible the Auto sensing gets it wrong and trys using PCL incorrectly.

I would recommend output is created using the -level2 switch which will generate Postscript Level 2 code that is more likley to be parsed on a wider variety of output devices.

I can't see why pdf could not be spooled to disk by FA using the and then the resulting PS file sent to a printer.

I would suggest that the PDF to PS conversion  and PS job submission be separated from FA and be activated by a separate monitored "hot folder" processing system. That way, all that  FA needs to do is to write a PDF file to a folder and not display it on screen and this external system takes over. If you have a dig on some of the PDF communities like PlanetPDF, you will probably find a tool that does this for you.

POSTSCRIPT smile
Postscript was the precursor of PDF but was an interpreted language so it needed to run the whole program before you could see the output. Adobe saw the need for robust portable document format and responded by developing the object oriented PDF specification. The great advantage of this is that everything in the document is treated as an object and the tail of the PDF includes an index to the page objects which in turn have pointers to the objects on the page. This allows post processing of and navigating through PDF files very efficiently. I would not call PDF a wrapper around Postscript but because of the common heritage, Postscript can be converted to PDF very efficiently. Acrobat Distiller is basically a POstscript RIP that outputs PDF files rather than raster images for printing.

[b]RodW[/b]
Brisbane, QLD, Australia