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
The project also requires the associated pcl/pxl language commands, see bug/enhancement #690417
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
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).
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
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
(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
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.
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.