Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get number of pages from specific spl files PCL5 1

Status
Not open for further replies.

artemcarabash

Programmer
Nov 3, 2015
2
DE
Hi! Now I'm working on tool which will provide me number of pages and copies from windows spool files. I'm trying to understand how to do that with known tools like pkpgcounter and pclparaphernalia - it's really not so easy. So I'm using pkpgcounter tool to check how many pages has the printjob and pclparaphernalia to get all needed sequences. Now I faced with a problem with simple pcl5 drivers from Konica Minolta and HP. I downloaded this drivers from official web site, there was info that this are PCL5 Universal Print Drivers. So I stuck with it. Here is attached spool files that was generated with those drivers.

00015.SPL - KONICA MINOLTA Universal Print Driver Ver.2 Maintenance Release 8 (PCL/Version 2.80.0.0, PCL5/Version 2.80.0.0)

00014.SPL - upd-pcl5-x64-5.9.0.18326 - Name of HP driver

I found sequence that matches number of pages and copies in spool file generated with Canon PCL5 UP, and its - <Esc>*p723x - Cursor Position Horizotal. Not sure if it's correct. But for other PCL5 drivers it doesn't works.
Who knows how to get number of pages and copies From PCL5 spool files? What tags? pclparaphernalia - give error when I'm trying to decompile these attached files. Pkpgcounter gives me - "unsupported file format"

Any Ideas?

For the moment I already can count pages and copies from PCLXL (aka PCL6) spool files. By counting EndPage Tags.

Thank You in advance !

SPL Files:
 
Your spool files do not contain raw PCL data, so it is not surprising that the PRN File Analyse tool in PCL Paraphernalia reports errors.

I don't know what the format of the data in these files is (perhaps EMF ?).
.spl files can contain raw printer-ready data (in whatever Page Description Language (e.g. PCL5, PCL XL, PostScript, JetReady, Esc/P, etc.) is in use), but will (I think) contain EMF (an intermediate encoding used within the Windows spooler) if certain options are set in the driver.


... and as for your statement "... I found sequence that matches number of pages and copies in spool file generated with Canon PCL5 UP, and its - <Esc>*p723x - Cursor Position Horizotal. Not sure if it's correct ...": the "Cursor Position Horizontal" escape sequence is just that - positioning the cursor horizontally - and has absolutely nothing to do with delineating pages.

As you have found, obtaining page counts from PCL XL print streams is fairly straightforward - just look for all of the EndPage operators.

But obtaining page counts from PCL5 print streams is not so easy, since there are numerous 'new page' triggers: the simplest is a FormFeed control-code character, but new pages can also be triggered in a number of other ways (e.g. by changes of page size, page orientation, vertical cursor overflowing text area, etc.).
 
Thank You DansDadUK!

Yes, there is no problems with PCL6, and I am glad that the structure of this document is clear.
Otherwise what to do with the PCL5 drivers, yes this tag <Esc>*p723x was suitable only for canon devices. and "has absolutely nothing to do with delineating pages."

Is it possible to get data about printjob from EMF file? Or is better to set driver properly..

Thanks!
 
>> ... tag <Esc>*p723x was suitable only for canon devices ...

This 'tag' (more accurately, a PCL parameterised escape sequence) is supported, and in common use, on all PCL5 printers, not just those manufactured by Canon.


>> ... Is it possible to get data about printjob from EMF file? ...

The CodeProject web site offers an EMF spool file viewer; you'd need to register with the site, and login, in order to download the code.

I've no idea how useful this would be.
 
... and I suspect that what influences whether the spool file contains Enhanced Meta File data, or raw Page Description Language data, is choosing (when setting up the printer driver instance) whether to 'spool' the data, or print 'directly' to the printer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top