cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform - Printing Graphic store in Printer Harddisk via PCL

Former Member
0 Kudos

Dear Folks,

I have a logo stored as a Macro (prn file) in my HP Laser Jet 4350 printer's hard disk.

When printing any smart forms from that printer, the logo is suppose to be printed together from the printer harddisk. I am not to import the graphic into the smart form itself.

I read that there may be a need to write PCL commands in the Smartform to trigger the printing. Is this correct?

If so, can anybody direct me to useful references to learn how to do this?

Thank you.

Best Regards,

Junwen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sridhar,

I created a print control named ZSG01 for device type HPLJ4 (representing HP laserjet 4 series ).

However, I was unable to find my print control when using the drop down selection in the smartform command node for a new window, under the output options -> print control.

If i just enter the print control ZSG01 in the field directly and saved changes in the form, i get an error during printing.

Where did I go wrong? Pardon me if the questions seems novice as I had no prior experience using print controls.

Thanks & Regards,

Junwen

sridhar_k1
Active Contributor
0 Kudos

ZSG01 not showing in SF print control because it's created as device type specific and not added to standard print controls.

To add it to standard print cotrol, go to SPAD, click on device types tab, click on Print control button and create ZSG01, then it'll show up in smartforms.

You should not get any error when you use device type specific print controls in SF, what error are you getting?

If u've copied HPLJ4 to ZHPLJ4, make sure it's used in output device definition.

Regards

Sridhar

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Ragu,

I created a new window in the Smartform and created a text object with the following codes:

/: HEX TYPE PCL

/= 1B22266631303179335822

/: ENDHEX

However, SAP kept returning the message 'Do you want to delete all invalid formats %Text in the text node'.

Where did I go wrong? It works perfectly in sapscripts.

Best Regards,

Junwen

sridhar_k1
Active Contributor
0 Kudos

Smartforms does not support Sapscript command HEX.

You can send the PCL escapes equence using print control in command node.

1. Copy the devicetype in SPAD

2. Create a print control with value 1B22266631303179335822 and hex radio checked

3. Add a command node in smartform and populate print control field.

Regards

Sridhar

raguraman_c
Active Contributor
0 Kudos

Hi,

This is how it is handled

<b>Hexadecimal Data: </b>HEX, ENDHEX Use this command to send printer commands in a printer language directly to a printer that supports that language. <b>SAPscript does not interpret the data enclosed by the HEX and ENDHEX command pair</b>, but <b>inserts it unchanged into the output stream. </b>

This technique allows objects with a pixel-oriented format (for example, graphics) to be printed as part of a SAPscript text. The HEX and ENDHEX command pair enclose the printer commands and data as hexadecimal text, so that the printer formatting routines interpret each successive pair of characters as a single hexadecimal value in the range of 0 to 255. The characters 0 to 9 and A to F for representing the values 10 to 15 are valid hexadecimal characters. The text may also include comment lines (these begin with /* in the format column), which will not be interpreted as hexadecimal data but are simply passed over by the formatting routines.

<b>Syntax: /: HEX [TYPE printer_language] </b>The HEX command denotes the start of the hexadecimal data. Subsequent text lines are interpreted as described above. If the TYPE parameter is present, the data will be sent to the printer only if the printer understands the specified printer language.

The following printer languages are <b>currently supported: POST (Postscript), PRES (Kyocera Prescribe) and PCL (HP Printer Control Language)</b>. /: HEX [TYPE printer_language] [XPOS x_position] [YPOS y_position]

Here is the answer for your second question,

<b>The output cursor is set to the absolute position indicated by the specified X and Y position parameters before the hexadecimal data is printed.</b> If either the X or the Y position is not specified, then 0 will be assumed for this parameter. /: HEX [TYPE printer_language] [HEIGHT height] [LEFT left_indentation] The HEIGHT parameter determines the amount of space to be reserved on the page for the output of the hexadecimal data. Any text following the ENDHEX command will be printed below this point. If the LEFT parameter is also specified, then the output of the hexadecimal data will is indented from the left margin by the specified amount.

/: HEX TYPE PCL HEIGHT '7.5' CM LEFT '2.25' CM /* Creator: report ZQVNTE30 date 19940705 time 125129 user SAPSCRIPT /= 1B2A7230461B2A743735521B2A7231411B2A62304D1B2A62343057FFFFFFFFFFFF /= FF1B2A62343057FFFFFFFFFFFFC0007D00DFC0F7D0000000000000000000000017 /: ENDHEX This data is printed only by an HP PCL printer (fro example, HP LaserJet). 7.5 cm of space is allocated on the page for the output of the data and the output cursor is indented 2.25 cm to the right of the form window edge.

You said its useful, now this will solve your problem

Feel free to revert back.

--Ragu

Former Member
0 Kudos

Hi Raguraman, thanks for the useful information.

However, does anybody can help advice how to make use of these information in Smartforms? How do I issue a PCL command in smartform?

Must I use commands like /: HEX TYPE PCL /:ENDHEX as mentioned in another post:

If so, in which area of the smartform must this command be called? The Main Window?

Thanks & Regards,

Junwen

raguraman_c
Active Contributor
0 Kudos

Hi,

You can give commands to printers using PCL commands. But I am not sure whether you will be able to access your HP Harddisk.

These are really good links.

this is intro

http://www.digitalissues.co.uk/html/software/utils/pcl_page.html

Here is history

http://www.csgnetwork.com/hppclhist.html

These for HP

http://pcl.webs.com.ua/pcl/pcls/bpl.html

http://www.randomc.com/~bpage/References/BasicPCL.htm

Here is a complete reference i could say

http://h30266.www3.hp.com/odl/i64os/sysman/dcpsv25/relnotes/dcps025_release_notes_contents.html

Feel free to revert back.

--Ragu