Operating System - Microsoft
1748038 Members
4949 Online
108757 Solutions
New Discussion юеВ

Re: How do I insert PCL codes into an RTF document?

 
Peter Tirrell
New Member

How do I insert PCL codes into an RTF document?

I need to be able to insert PCL commands into an RTF document in order to do duplex printing for a document. When the printer reaches a certain point, I need it to see the duplex code and proceed to print the rest of the document on the other side. Does someone know of how to do it, or even have an example or something? Any help would be greatly appreciated!
6 REPLIES 6
Roger Faucher
Honored Contributor

Re: How do I insert PCL codes into an RTF document?

I guess I would open the RTF file in Word, insert a page break at the appropriate point and tell it to print in Duplex mode. It's not clear to me why it has to be more complicated than that.
Make a great day!

Roger
Peter Tirrell
New Member

Re: How do I insert PCL codes into an RTF document?

Ok, I made a new document in MSWord, added the command '{PRINT 27"&l2S"} ' at the top of the page, wrote a line, inserted a page break, and wrote another line. Then I saved it as a .rtf file. I opened that in Notepad, and along with LOTS of extra junk, but also the print command {\PRINT 27"&l2S"\} was inserted as well. However, I opened the file in Wordpad and that print command still showed up in the text. I want something that isn't displayed but read instead by the printer when it comes to it. Maybe I'm misunderstanding something here and just need some clarification on how this works. ANy more info?
Roger Faucher
Honored Contributor

Re: How do I insert PCL codes into an RTF document?

Peter:

I am sorry. My reply wasn't very clear. The page break I referred to is indeed inserted into the document but telling it to print Duplex happens either in the driver or within the application. Click on File/Print and search the dialog box that opens up for a Duplex setting. Of course, the printer you're using must have duplexing hardware, otherwise duplexing has to be done manually. If this doesn't solve your problem, when you re-post here, tell me what model printer you're using. Good luck!
Make a great day!

Roger
Peter Tirrell
New Member

Re: How do I insert PCL codes into an RTF document?

Thanks for the added info...mostly I'm going off of what my boss has told me, which is what this "assignment" is for. He says that back in the day, I'm assuming DOS programming, you could insert printer commands into RTF files that would tell compatible printers various formatting info, like color, size, etc., and if the printer wasn't compatible, then it would just ignore the commands. Alas, these examples he talks of have been lost to the ages. He maintains that it should be possible to do now though. What we have I guess is a document, an RTF file, that is supposed to have these embedded codes in them. Its supposed to print along, and if and when it sees one of these particular codes, it will realize that its a duplex mode then and proceed to print the rest of the document on the other side. If the printer doesn't support that, then I assume it simply ignores the command and proceeds on its merry way. From what I hear, its supposed to all be contained within the RTF file itself, and the printer will recognize it if its compatible or not. I think the printer we would be testing it on is like an 1800 model or something...I can't remember right now, but its supposed to work on any HP printer that can print in duplex mode. Maybe there isn't a way to do what we're trying to do, without actually making a standalone application or something.....but it would sure be nice if I could figure this beast out. Hope this clarifies somewhat what I'm trying to do!
Roger Faucher
Honored Contributor

Re: How do I insert PCL codes into an RTF document?

Peter, to do what you're talking about (inserting or interpreting previously inserted PCL commands in a document), you'll need some kind of PCL reference documentation. Old HP printers came with a lot of this info but the newer ones have only limited amounts. Try the following:
http://software.oit.pdx.edu/print/lprng/pcl/

http://www.hp.com/cposupport/printers/support_doc/bpl06465.html

Especially, http://www.hp.com/cposupport/printers/support_doc/bpl03718.html and select Job Control Commands.

Hope this helps. Good luck!
Make a great day!

Roger
Peter Tirrell
New Member

Re: How do I insert PCL codes into an RTF document?

Arrrgghh its seems like I'm so close to getting this! That last bit helped a lot, maybe you could clarify something for me. I do have the PCL printer commands to print in duplex mode, they are pretty readily available. I seem to be stuck on the escape command, and getting that part to work. I think it was the first link you gave that had escape commands for a number of DOS programs, so I ran a command prompt and went into Edit and tried inserting one of the commands. The thing is, everything I find says that RTF files have the escape command of '\', but in Edit it placed a '->' (well, it was sort of an arrow..., only all one character). When I opened the RTF file in Wordpad, that escape character showed up as a sort of rectangle and it printed the command rather than interpreting it. I'm wondering if theres some sort of RTF command (like '\xxxxx' ) that I need to put first in order for it to recognize the printer command that will come later. I can't seem to find any references to escape commands in Windows environments, like Notepad, Wordpad, etc. It seems like I have all the parts, ie how to make the printer to what I want it to do, and how to place a command in the file, its just a matter of getting the two to recognize each other since they appear to be two incompatible formats or something. Any more ideas on this, and thanks again for all your help.