Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

HPGL File on HP LaserJet Pro MFP M176n

HPGL File on HP LaserJet Pro MFP M176n

HPGL File on HP LaserJet Pro MFP M176n

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"
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??

RE: HPGL File on HP LaserJet Pro MFP M176n

It looks as though the M176n is a PCL3gui printer and does NOT support HP-GL/2. HP-GL/2 usage requires a PCL5 supported printer.

Jim Asman

RE: HPGL File on HP LaserJet Pro MFP M176n

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???

RE: HPGL File on HP LaserJet Pro MFP M176n

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

RE: HPGL File on HP LaserJet Pro MFP M176n

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.

RE: HPGL File on HP LaserJet Pro MFP M176n

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...

RE: HPGL File on HP LaserJet Pro MFP M176n

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:

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.

RE: HPGL File on HP LaserJet Pro MFP M176n


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close