Bug 691587 - custom paper size
Summary: custom paper size
Status: RESOLVED FIXED
Alias: None
Product: GhostPCL
Classification: Unclassified
Component: PCL interpreter (show other bugs)
Version: unspecified
Hardware: All All
: P4 enhancement
Assignee: Henry Stiles
URL:
Keywords: bountiable
Depends on:
Blocks:
 
Reported: 2010-09-02 12:35 UTC by Joe
Modified: 2011-04-25 20:43 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
Custom papersize - patch(diff) adds PJL and PCL command (1.67 KB, application/x-zip-compressed)
2011-01-07 12:44 UTC, Joe
Details
testcase: custom papersize fanfold 8.5" x 12" via PJL and via PCL (109.39 KB, application/x-zip-compressed)
2011-01-07 13:05 UTC, Joe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe 2010-09-02 12:35:11 UTC
We need to specify custom paper size using @PJL SET PAPERWIDTH / PAPERLENGTH and/or command line switch for ghostpdl. I am going to implement the PJL command soon. 
By the way, Visual and RedTitan are offering custom paper size options. 
http://www.visual.co.uk/pcl2pdfwhatsnew.asp
http://www.redtitan.us/escapee/20031942.htm
Comment 1 Henry Stiles 2010-09-10 16:56:18 UTC
The project also requires the associated pcl/pxl language commands, see bug/enhancement #690417
Comment 2 Joe 2010-09-29 09:03:40 UTC
I'd rather implement an undocumented PCL command which I have digged out from HP Universal Printing PCL 5 Windows driver.
Search for 101A (part of set paper size custom) in the gpd files and/or create a printjob with custom paper size fanfold (8.5" x 12"). Successfully tested on HP LJ P4015 with firmware 20090925. Printer displays a message -  insert 8.5" x 12" paper and prints as expected.

<ESC>&f6120i    ***** set paper width 6120 decipoints  *****
       8640J    ***** set paper length 8640 decipoints *****
<ESC>*p0x       Move CAP horizontal : 0 dots (absolute)
       0Y       Move CAP vertical : 0 dots (absolute)
<ESC>*c0t       Location of picture frame anchor point : 0
       5760x    Horizontal size of HPGL/2 plot : 5760 decipoints
       8400Y    Vertical size of HPGL/2 plot : 8400 decipoints
<ESC>&l101A     Set paper size : 101
Comment 3 Joe 2011-01-07 12:44:40 UTC
Created attachment 7099 [details]
Custom papersize - patch(diff) adds PJL and PCL command

modification of ghostpdl-8.70/pcl/pcpage.c and ghostpdl-8.70/pl/pjparse.c
implementing PJL-command set PAPERWIDTH and PAPERLENGTH in decipoints
and corresponding PCL-commands  ESC & f ### I (paper width), ESC & f ### J (paper length).
Comment 4 Joe 2011-01-07 13:05:18 UTC
Created attachment 7101 [details]
testcase: custom papersize fanfold 8.5" x 12" via PJL and via PCL

fanfold-pjl.prn uses PJL to define fanfold as default paper size
(decipoints: 6120/720 = 8.5, 8640/720 = 12)
@PJL SET PAPERWIDTH=6120
@PJL SET PAPERLENGTH=8640

fanfold-pcl.prn does the same using PCL commands to define width and length of custom paper size (ESC & l 101 A) 
Description found in http://www.office.xerox.com/support/dctips/dc10cc0471.pdf as well as in Windows driver "HP Universal Printing PCL 5", text file hpcu0915.gpd
Comment 5 Joe 2011-03-16 08:49:05 UTC
Hi Henry, could you have a look at my patch? As described, I have successfully sent the PCL commands to our HP LJ P4015. The PJL commands SET PAPERWIDTH PAPERLENGTH are documented in this PJL Technical Reference Manual:
http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13208/bpl13208.pdf
I have not tested the PJL commands on a real printer, our HP LJ P4015 ignores them. 
Here somebody complains about PJL SET PAPERWIDTH not working.
http://www.ghostscript.com/pipermail/bug-pcl/2005-March/000307.html
Comment 6 Henry Stiles 2011-03-16 22:31:43 UTC
(In reply to comment #5)
> Hi Henry, could you have a look at my patch? As described, I have successfully
> sent the PCL commands to our HP LJ P4015. The PJL commands SET PAPERWIDTH
> PAPERLENGTH are documented in this PJL Technical Reference Manual:
> http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13208/bpl13208.pdf
> I have not tested the PJL commands on a real printer, our HP LJ P4015 ignores
> them. 
> Here somebody complains about PJL SET PAPERWIDTH not working.
> http://www.ghostscript.com/pipermail/bug-pcl/2005-March/000307.html

We aren't okay with writing into the global the page size table, the custom page size could be maintained in pcl the state (pcstate.h).  Also, It does make it a bit easier for me to integrate if you use the current code instead of 8.70.  But that is not a major issue.

Thanks

Henry
Comment 7 Henry Stiles 2011-04-21 05:57:40 UTC
code added with:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=43a53627ebce420f30f9aecdbefff37ca0527913;hp=8a203b909d59f8aa649492c23fa570afe3a61565

I will fix the global variable issue shortly, there was one minor issue I found, the default custom paper size was not letter, but legal.  The comment said letter but the dimensions used were legal, I changed that to letter dimensions.

Thanks for the work.
Comment 8 Henry Stiles 2011-04-25 20:43:28 UTC
Last known issue with this change was fixed with:

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=3b66709cafd05910f2442250e12d1918f239c34b


I am closing it now.