-
×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
- Archived Topics
- Printers Archive
- PCL symbol set on P2035

Create an account on the HP Community to personalize your profile and ask a question

03-10-2016 01:25 PM
>> ... the "print to file" from the Windows printer dialog box, but the file just contained test text ...
This doesn't seem to tie in with your other symptoms; perhaps (for some unknown reason) you haven't properly captured the output from your Dbase application?
Does the file contain just plain ASCII text?
Does it not include any PCL escape sequences?
A quick test would be to issue the following command from a Windows command-prompt session:
copy /b test01.prn LPT1:
where I'm assuming that:
- Your captured file is named test01.prn, and is located within the current directory assumed within the command prompt session.
- Your target printer is connected to the LPT1: port.
Does this print the same garbled text that you claim normally prints?
Or what?
>> ... believe the fault lies in the HP PCL 5 driver ...
I don't think that there is a fault with the driver - I still think that your escape sequence insertions are interacting in an undesirable way with the enveloping PCL of the print job as generated by the driver.
03-10-2016 01:59 PM
Attached (within a .zip file) is a very small PCL test file which contains roughly what I think you are saying your captured file contains; the zip file also contains an analysis of the test file.
The pertinent parts of the analysis are:
Offset: dec Type Sequence Description ----------- --------------------- ---------------- ---------------------------------------------------- 0000000000 PCL Control Code 0x0d <CR>: Carriage Return 0000000001 PCL Control Code 0x0a <LF>: Line Feed 0000000002 PCL Control Code 0x0d <CR>: Carriage Return 0000000003 PCL Control Code 0x0a <LF>: Line Feed 0000000004 PCL Control Code 0x0d <CR>: Carriage Return 0000000005 PCL Control Code 0x0a <LF>: Line Feed 0000000006 PCL Parameterised <Esc>(0U Primary Font: Symbol Set (0U = ISO 6: ASCII) 0000000010 PCL Parameterised <Esc>(s1p Primary Font: Spacing: Proportional 0000000015 14.25v Primary Font: Height (14.25 points) 0000000021 0s Primary Font: Style (Upright, solid) 0000000023 3b Primary Font: Stroke Weight: Bold 0000000025 4101T Primary Font: Typeface (4101 = CG Times) 0000000030 Data now is the time 1234
Is the content of this file more or less the same as that of your captured file?
What happens if you send (as described above) the content of this file to your printer port (it should print your text in CG Times 14.25 point Bold)?
03-10-2016 04:05 PM
In an earlier post, I wondered why (if my supposition about font obfuscation is correct) your inserted PCL escape sequences were not also being obfuscated.
I think that I've found the answer to that - the "???" command causes what follows to be sent directly, not via the printer driver.
I got this information from the "dBL Language Reference dBASE Plus release 2.70.3 for Windows XP, Vista and Windows7" manual:
03-11-2016 06:18 AM - edited 03-11-2016 06:20 AM
>> ... the "print to file" ... but the file just contained test text ...
Perhaps the reason for this is that I was assuming you would invoke the 'print to file'option in the Print dialogue of a standard Windows printer driver (in order to capture the driver output to a .prn file); for example:
or (if the ChoosePrinter() function in your DBase application does not expose that dialogue), by (temporarily) changing the port associated with the target printer, to FILE:, as described in an earlier response; for example:
But perhaps what you have done instead is to just use the DBase command "SET PRINTER TO <file>" command to send Dbase output to the nominated (.prt) file.
As far as I can make out, this captured output will just be the "text streaming" data which you have used within your application, but it will not include the encapsulating PJL / PCL generated by the Windows printer driver associated with your target printer, which is what we need to analyse in order to confirm what is going on.
... and as an aside - perhaps all you need to do in your application is to include some sort of setting for "Font,Size,Style" (using the features available within DBase Plus) instead of attempting to select the font directly using raw PCL escape sequences, as you are currently doing?
03-11-2016 07:24 AM
I did capture a .prn file of the streamed output with:
set printer to pcl_test3.prn
set printer on
??? chr(27)+"(8U" + chr(27)+"(s1P" + chr(27)+"(s10V" + chr(27)+"(s0S" + chr(27)+"(s0B" + chr(27)+"(s4101T"
?"now is the time 1234"
set printer off
close printer
I don't know if this is the file you're looking for - probably not. I was going to send it along, but can't figure out how to attach it...?
But I think you're right about relying on dBase commands rather than PCL - they are not nearly as complete, but also not as termpermental as PCL.
03-11-2016 08:36 AM
>> ... I don't know if this is the file you're looking for - probably not ...
No.
The file pcl_test3.prn is created by DBase, and (as far as I can make out) will only contain your text streaming data, not the encapsulating sequences (generated by the printer driver) which we're interested in seeing.
You need to use one or the other of the techniques I referred to earlier to obtain a Windows printer driver 'print to file' capture.
>> ... can't figure out how to attach it ...
I don't think that ordinary users have the authority to attach files to posts in these forums.
If you manage to create the required type of capture file, email it me via the Support mailbox at pclparaphernalia.eu
03-11-2016 09:50 AM - edited 03-11-2016 09:51 AM
As an example of what I've been banging on about (obfuscated fonts, etc.):
- I created a NotePad document, containing just the text "abcde".
- The application was set up (via the "Format | Font" menu item) to use the Consolas Regular font (size 11 point).
- This document was then printed (to file), using a PCL5 printer driver (associated with a local LaserJet 1320 printer).
- I modified this file, to remove lots of standard PJL commands, and some PCL sequences (e.g. those to set the HP-GL/2 picture frame, and those which delete all patterns at end of job) which are just superfluous for the purposes of this exercise; this file is abcde_x01.prn.
- 'Sent' the content of this file to the port of my LaserJet printer; it prints the characters abcde, using what I can only assume is the Consolas font.
Analysis (see abcde_x01.prn_analysis.txt) of the file shows that (because Consolas is not one of the printer-resident fonts on the Laserjet printer):
- A soft font has been downloaded - in this case it is a resolution-specified bitmap font.
- The font defines five characters, associated with character codes 32 (hexadecimal 20) to 36 (0x24).
- In the ASCII coded-character set, these character codes are normally associated with the characters space, exclamation-mark, quotation-mark, number-sign, dollar-sign.
- The 5 characters of data to be printed have been obfuscated (as space followed by !"#$, instead of abcde) to match this font.
I then:
- Created a copy of the abcde_x01.prn file, as abcde_x02.prn.
- Modified this file, by inserting the PCL escape sequences to select the printer-resident CG Times Regular 15-point font, using the Roman-8 symbol set; these sequences were inserted just in front of the (obfuscated) text character data.
- 'Sent' the content of this file to the port of my LaserJet printer; it prints the characters !"#$, using what appears to be the CG Times 15-point font.
The attached .zip file contains the two .prn files and their associated analysis files.
03-14-2016 07:10 AM
The dBase chooseprinter() command allows a parameter to use the Windows Printer Dialog box, but the "Print to File" checkbox doesn't function.
But - I used Printfile to copy your snip03.prn to the printer ("copy /b..." doesn't seem to be supported by my Win 10x64), and the printout was completely correct - suggesting the the problem is not with the printer or PCL 5 driver, but rather with the Win 10x64/dBase environment. With that info, I've decided to use the dBase "? 'abcde' STYLE arial,12" for font selection, and use PCL for what is working, ie, source tray selection, etc.
I appreciate very much the effort you've put into identifying the problem area, otherwise I'd still be running endless tests.
03-15-2016 06:01 AM
>> ... With that info, I've decided to use the dBase "? 'abcde' STYLE arial,12" for font selection, and use PCL for what is working, ie, source tray selection, etc. ...
Good that you've now got some sort of circumvention / resolution.
>> ... use the Windows Printer Dialog box, but the "Print to File" checkbox doesn't function ...
I've no idea why that should be.
>> ... the problem is not with the printer or PCL 5 driver, but rather with the Win 10x64/dBase environment ...
If my diagnosis was correct (I'm at least 99% confident) the problem is that:
- The printer driver is assuming, or being told, that the default font is not printer-resident.
- So it downloads a soft font, which is 'obfuscated' and it expects to obfuscate the text data to suit.
- You were then trying to inject PCL escape sequences to select a printer-resident font - but you are not cancelling the 'obfuscating' of the following text data (the only way to do this would be via the DBase ??? command).
The only thing I'm not sure about is why the printer driver is setting the initial default font to be a downloaded soft font, rather than one of the standard printer-resident ones; I don't know whether this is some sort of driver default, or that the DBase system is selecting this font as the default?
- « Previous
-
- 1
- 2
- Next »
