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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Printer Control Codes to Laserjet Printer

Status
Not open for further replies.

62chev

IS-IT--Management
Mar 4, 2004
56
US
I am trying to send PCL control commands to my laserjet printer using escape sequences in form designer. I am not having much success, I just get the escape sequence string printed on the form.

If anyone has done this, I would appreciate the assistance.

Thanks!

Jim
 
I am afraid it doesn't work that way. What are you trying to accomplish?

You can print in a different font if you click the 'use font dialog' when the print job is submitted. This font will apply to the entire report, you cannot print different parts of the report in different fonts as you could with crystal, for example.

If you want to get creative with your Macola forms and have different fonts on the same form, you can do that with Reform. Reform also allows you to fax, email and archive .pdf copies of invoices, POs, quotes, etc. Its a great package.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
I assume you mean Macola doesn't support sending an escape sequence (PCL) to the printer when you say it doesn't work that way? i.e. most programs allow some method to embed a string as an escape sequence. Some use special brackets surrounding the characters which tells the printer to interpret them as commands rather than data to be printed.

I have seen <Esc> {esc} and other similar conventions used. I am trying to control the line spacing on a pre-printed form since it does not line up correctly. Font control etc within the form would be nice also but I am more concerned about line spacing at this point.

Thank you for the information regarding reform, I will look into it.

Jim
 
I have never seen anyone use printer control characters. If Macola supports that, it is news to me.

What you need to do is go into System Manager, Maintain, Form Maintenance, Form Designer and pull up the form in question and change it so that it lines up.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
The problem is the pre-printed form is not a whole line off. So the only way to line it up would be to change the line spacing. Most programs support some method to allow these escape sequences to be sent. This method is also used to do form overlays if you want to print your data onto a template that you print at the same time.

I was hoping it was one of those undocumented 'features' that existed. This would also allow font changes etc inside the document itself etc.

I did check into the Fabsoft solution you suggested - thank you. I did find an interesting article on the web that gave examples of how different software packages handle the escape sequences, quite interesting - everything from Control-P Control-[ to ALT 27 to CHR(27) to \27

That is the problem, the actual representation of the ASCII escape character is up to the whim of the programmer (if they include the capability at all) so it is pretty tough to try all combinations. It would surprise me if they didn't have this mechanism in place but then again very little surprises me about Macola anymore.....

Thanks again.
 
It sounds like you are using a dot matrix printer with the pre-printed forms. Why not adjust where the form lines up when you start the print job?

Kevin Scheeler
 
Hi,

Sorry if I didn't make it clear. I am printing to a Laserjet 4100 and using pre-printed forms (in this case invoices) and the form is off about 1/2" line spacing.

I also had an issue at year end where our W-2's did not line up properly and I had no options to adjust them.

Thanks,

Jim
 
In that case, I would change the print driver you're using for that printer. Regardless if it's the "correct" driver for the printer, I've seen where an HP LaserJet 4 print drive works great on newer HP models. In that case, the user changed from Windows98 to WindowsXP. You may find that doing that alone will change where things line up.

Kevin Scheeler
 
Thanks for the responses, it appears Macola does not provide the ability to send PCL commands through the report designer. I think the best option (2nd best, best would be to replace Macola) is to utilize a print capture type program (like Reform) and reformat the page before printing it.

This will give the option of including graphics, different fonts within the page etc, i.e. eliminating pre-printed forms, which probably explains part of the reason Macola does not support this (since they also sell forms).

Thanks again to all for the good feedback.
 
If you are using Macola forms, they will work with you until the layout is correct, since they guarantee the preprinted forms will work with their software. You can also use the ICR version of forms to print more graphic versions, but with the stipulation that the file updates are not performed. The last time I had to use escape codes to print was in the late 80's in lotus 123. Macola version 6 DOS also used escape codes for printing. Now, everything is handled by the windows print manager, which is not crazy about getting text based formatting.
 
No, I am using the windows version of Macola. Yes, I agree about the last time needing to use control codes was in the 80's. Unfortunately Macola's form designer still lives in the 80's! It is pretty pathetic. And as you pointed out, the ICR forms do not update files so they are pretty much useless in this case.

Thanks again for the feedback.
 
You didn't say if you had macola forms. If so, they should either help you fix it or replace the forms with one that works. If its your local forms vendor, they may need to adjust your job to print the text in the correct place. From what Don has previously indicated about Reform, it didn't sound expensive or difficult to implement.

One last trick that I have found to work most times is this:

get the latest frm, fld & rst files from the default.zip (the most up to date electronics company if you install demo data when applying updates). Find the laser version of the file that most closely resembles yours & rebuild from the ground up after copying the generic form number to a new one of your choice > form # 20 (modify this one, not the vanilla macola form). This is not a complicated task usually, which will maybe take 30 minutes. You could also try to print the form for alignment purposes in the electronics company provided you have installed the latest version of the form files in question. Print to plain paper & overlay your preprinted form. The reason I do this rather than fight with the existing customized forms is the fact that macola has made many changes to base form design and printing form issues reported over time, issues reported with various OS, etc. In particular, going from 76100 to 200+ had many printing issues. Also, the introduction of xp machines created printing problems. In addition, you can initialize the print default files, deferred report file, remove all user*tmp and scr*tmp files. Verify the printer driver used, then try to use the reset button when you get the print dialog window. This will reset to your default printer. you can then change if needed. For some reason, this trick works particularly well with a change from another OS to XP, even if the user gets a new workstation.
 
We have battled the same issues and found the same solutions as mentioned above -all good advice by the way. The LaserJet's use either HP4 driver or the 4000 driver for laser forms. We built the form from the ground up and then had the pre-printed invoice formed from that with a little fudge room. Works great. The other solution is to use Reform. While we have an issue with it in our Terminal Server environment, I can see it would solve a lot of other printing problems and look forward to getting it to work for us.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top