-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Printers
- LaserJet Printing
- What are the commands to set the Paper Type in PCL 5?

Create an account on the HP Community to personalize your profile and ask a question
09-12-2019 01:57 PM
We send many print jobs using an old DOS application. ( please no comments about the old ancient (DOS) technology - we are well aware ). So we embed the appropriate PCL 5 codes in the document through various means. We are starting a process needing card stock (90 LB) media. But I cannot find any documentation for PCL 5 codes to set the Paper Type. In my googling endeavors, I found one snip-it but it doesn't work. Please point me in the right direction. Thanks
Solved! Go to Solution.
Accepted Solutions
09-17-2019 10:42 AM
This message is mostly an FYI and a thank you.
After doing a little more research, found a document that lists all the versions of PCL.
http://www.undocprint.org/formats/page_description_languages/pcl#pcl_5c
As an aside, I did not know that there was a PCL version 5e and 5j and 5c and 5ce.
Anyway there are also several links to HP documents. Out of curiosity I opened a few and perused them. And unexpectedly found what I was looking for. Who would ever guess to find this in a comparison guide.
http://www.undocprint.org/_media/formats/page_description_languages/pcl5_comparison_guide.pdf
Bottom line we found the escape sequences I've been hunting for. (See page 1-26)
So now with what I learned from you about finding the "Media Types" supported by a targeted printer in its .PPG/.GDP, we can now set the Media Type with an escape sequence.
Thanks Again
09-12-2019 02:30 PM
The first step is to pull apart the driver you are using to figure out what the name of the .ppd or .gpd file is:
1. Open the Printer Properties window for your printer
2. Click on the About tab
3. Scroll through the Driver Files list for the .PPD/.GPD, they are usually at the top
Next, find that file on your PC and open it with a text editor:
4. Navigate to your PCs Spool folder such as C:\windows\system32\spool
5. Search for the .PPD/.GPD that you discovered in step 3, it should be under \drivers\something\something
6. Open the file with your preferred text editor such as Notepad.exe
Next, parse through the information for the content you are looking for:
7. I suggest searching for "Paper", "Type", "Cardstock" or anything similar
8. Chances are there will be a "Media Type" area with all the predefined paper types
9. Keep hunting for clues
For example I found something with my PCL5 driver that listed Cardstock176 as 176-200g. You may need to convert the paper metrics from lb to g. Hopefully you can find whatever "code" you are looking for from there. You might want to search for a known code and see if what you are looking for is in the same area.
Experts are not HP Employees. Experts are advanced users, administrators, technicians, engineers or business partners who volunteer their time to answer community questions.
Please mark anything that is helpful with a Kudo.
When you are done troubleshooting, please mark one of the responses as the Solution.
This feedback enhances the community by helping future readers choose between multiple similar responses.
09-12-2019 04:00 PM
Thank you for the quick response.
I found the .GDP file and found a section about cardstock see below:
*Option: CARDSTOCK *%"Cardstock 164-220 g/m2"
{
*rcNameID: =IDS_CARDSTOCK_164 *% "Cardstock >164 g/m2
*Command: CmdSelect
{
*Order: PAGE_SETUP.20
*Cmd: =ubyte_array =uint16 "<0a00>" =eCardstock =attr_ubyte =MediaType
}
}
BUT I do not understand how this relates to what I have been using for years. Maybe I’m characterizing it wrong. I use escape sequences such as:
Esc(10UEsc(s1p100v0s3b4101T // CG Times Bold
or
Esc*v0T // Select Current Pattern
I’m trying to find an escape sequence the enables us to set the printer to a Paper or Media Type of 90 LB or > 200 g/m2.
Thanks again.
09-13-2019 06:38 AM
Here is a technical manual for PCL5 from HP:
http://www.hp.com/ctg/Manual/bpl13210.pdf
I see on page 1-6 what you mean by an escape sequence. This matches what you provided as an example.
While the manual may not have a specific code for 200g paper it does have many codes for selecting the paper tray. If you force your job to print from a specific tray and then load your heavy paper into the tray it should work. See page 5-4 for more information on selecting paper tray. I believe this is how we work around adjusting our legacy print jobs for legal and letterhead. The printer will print whatever media is loaded in the tray at the time rather than asking the printer to find a matching media tray based on paper type.
Part II of the manual has some more info :
http://www.hp.com/ctg/Manual/bpl13211.pdf
But all it says is:
Paper Source
The primary use for the paper source command is to allow access to
“locked out” (secured) paper trays.
Perhaps you can use the paper tray information from the manual with the paper tray information you dug up from the .GPD to make a match in your DOS application.
Experts are not HP Employees. Experts are advanced users, administrators, technicians, engineers or business partners who volunteer their time to answer community questions.
Please mark anything that is helpful with a Kudo.
When you are done troubleshooting, please mark one of the responses as the Solution.
This feedback enhances the community by helping future readers choose between multiple similar responses.
09-17-2019 10:42 AM
This message is mostly an FYI and a thank you.
After doing a little more research, found a document that lists all the versions of PCL.
http://www.undocprint.org/formats/page_description_languages/pcl#pcl_5c
As an aside, I did not know that there was a PCL version 5e and 5j and 5c and 5ce.
Anyway there are also several links to HP documents. Out of curiosity I opened a few and perused them. And unexpectedly found what I was looking for. Who would ever guess to find this in a comparison guide.
http://www.undocprint.org/_media/formats/page_description_languages/pcl5_comparison_guide.pdf
Bottom line we found the escape sequences I've been hunting for. (See page 1-26)
So now with what I learned from you about finding the "Media Types" supported by a targeted printer in its .PPG/.GDP, we can now set the Media Type with an escape sequence.
Thanks Again