The problem is that there isn't a reliable way to easily determine where the page breaks are located, particularly from a DOS or UNIX command prompt. There may simply be a FormFeed embedded, or the printer pages, based on margin settings. But this could be different from page to page.
You best bet would probably to have a look at a PCL viewer and print from it. Presumably the viewer would go through the same steps as the printer to page the document.
if you create the pcl pages and are not using raster graphics, you could do it by looking for formfeeds
(assuming all pages end with chr$(12))
thereby parsing the file and print the pages wanted.
I do this all the time (or the user has the choice) in my
accounting program and although I don't use pcl (because
of the specific print engine i use) the idea is the same.
If raster graphics exist in the pcl, then you would have
to check for that and ignore any chr$(12) within the data
postion of course.
In order to print a page range from a complex PCL file, you need a commercial quality HP PCL emulation product. There are only 3-4 that fit that description. You not only have to determine the beginning of each page, you need to index them, store the environment variables for the printer state just prior to the next page and be able to extract the pages and NORMALIZE them. That includes whatever state the download bitmap fonts may be in at that given point within the print stream.
Try PCLTool SDK Demo and use PCLTool.exe to View PCL, then print a range of pages from the print dialog.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.