Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HPGL File on HP LaserJet Pro MFP M176n 2

Status
Not open for further replies.

Mak2310

Technical User
Apr 9, 2018
8
IN
I was using HPGL earlier...I have HP LaserJet printer (MOdel: M176n). Current Driver is based on PCL6...
Have tried these VBA scripts without Luck.

Sub plt_PCL()
FNo = FreeFile
fName = "C:\Users\MMM\TestPCL.prn"
Open fName For Binary Lock Read Write As #FNo
Put #FNo, , Chr$(27) & "%-12345X@PJL" & vbCrLf
Put #FNo, , "@PJL COMMENT ** Begin JOB**" & vbCrLf
Put #FNo, , "@PJL ENTER LANGUAGE = PCL" & vbCrLf
Put #FNo, , Chr$(27) & "E" & Chr$(27) & "%0B"
Put #FNo, , "IN;DF;"
Put #FNo, , "SP1;PA10,10;PD2500,10,10,1500,10,10;"
Put #FNo, , "DT*;SS;LBThis is first text a:*"
Put #FNo, , Chr(27) & "%0A"
Put #FNo, , Chr(27) & "E"
Put #FNo, , Chr$(27) & "%-12345X@PJL" & vbCrLf
Close #FNo
End Sub

Even Tried Text File Like....

Sub plt()
Set TxtF = fsO.CreateTextFile("C:\Users\115264\Documents\HPGL_Reference\Test.prn", True, False)
TxtF.Write Chr$(27) & "E"
TxtF.Write Chr$(27) & "%0B"
TxtF.Write "IN;DF;"
TxtF.Write "SP1;PA10,10;PD2500,10,10,1500,10,10;"
TxtF.Write "DT#,1;LBThis is first text"
TxtF.Write Chr(27) & "%0A"
TxtF.Write Chr(27) & "E"
TxtF.Close
fsO.CopyFile "C:\Users\115264\Documents\HPGL_Reference\Test.prn", "\\RNWIT-42-2\hpgl2"
Set fsO = Nothing
End Sub
Request Guidance....Files to be TEXT file or BINARY??

 
Thanks for the clue...[thumbsup2]
Actually 176n is new wave and it has PCL6 driver...Am unable to load PCL5 driver for Win10-64 Bit PC.
I located another HP plotter (DesignJet 500) in my company andsent following HPGL2 output to printer and it works correctly.
E%0BIN;DF;SP1;PA10,10;PD2500,10,10,1500,10,10;DT#,1;LBThis is first text%0AE

Thanks for your help..Any idea, why opening prn file using notepad and printing does not work (It works with Send PRN to printer of PCL paraphernalia Utility)....Has it to do with Text and Binary file???
 
I would assume that Notepad swallows the ESC characters, thus reducing your PCL code to text. Hopefully, dansdaduk, the author of the PCL paraphernalia Utility, can comment on that.

Typically, if you want to print a PCL file directly to the printer, and you would use the copy command to send the file to the printer port. For a network connected shared printer, something like...
copy /b pclfile \\computername\printersharename

Note the /b flag to indicate a binary file.

Jim Asman
 
Jim is spot on with his diagnosis of why 'print' via NotePad (etc.) doesn't work - it will try to treat it as text, and add its own printer control sequences.

According to the datasheet, the only Page Description Language supported by the LaserJet Pro MFP M176n is PCLm - this is based on a subset of the PDF structure (you can open a 'captured' PCLm print job with a PDF viewer), with job-ticketing features.
 
Thanks a ton Jim and DansDadUK....Appreciate your prompt help...
I am now able to print as desired...
Its a pity, HP has chosen to implement PCL6 (and done away with HPGL2 compatibility).
Any clue about installing PCL5 drivers on PCLm ?? I tried without Luck...
 
The LaserJet Pro MFP M176n does not support PCL5 or PCL6 (PCL XL), so I'm somewhat confused by your reference to a PCL6 driver.

The printer only understands PCLm (which is not related to PCL5 or PCL XL at all).

Here is the beginning of a 'captured' PCLm print job, as displayed by NotePad:

Capture_uri30w.png


If you capture a sample print job (e.g. via the 'print to file' option) using the PCLm driver, you should be able to open the resultant .prn file in a PDF viewer, and it will show you what the printer would have printed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top