Part III: Print
 

This third part will show how to send the marked-up invoice to a printer.

In this example we use a PCL5 HP LaserJet 4000 printer that is shared on our network as “HPLaserjet4000”.   To do this we must pass ICS commands that define the printer we are sending the file to, and pass a plot command when we want to print.

1) Define a Printer

When defining a printer we must keep in mind that we are adding markup to the file.  Because of this we can not use DIRECT as the output method, this would pass the file to the printer without the added markup.

To define a printer we will use the “printer number” command on page 21 of the ICS Reference Manual:

printer number 12 type HPLJ3_ORIGINAL command none alias HPLaserjet4000

This command defines printer number 12 to output PCL5 to the Windows Printer “HPLaserjet4000”.  If the printer name has any spaces then it will need to be in quotes.

2) Pass a Plot command

Once we are ready to print we will need to pass the command to send the file to our defined printer:

plot 12 all

This will send all of the file to the printer defined as 12.  If we only wanted to print a portion of the document we could use a page range such as 1-4 or 1,4,6,10 instead of all.

3) Combine Markup and Print commands

Now let’s pass all of the markup commands and the print commands at once on the command line, and send the file to the printer:

sview –c”printer number 12 type HPLJ3_ORIGINAL command none alias HPLaserjet4000| ldoc c:\invoice.pcl| onpage 1,4,6,10 markup load filename c:\logo.jpg rxloc 3.5 ryloc .25| plot 12 all”

The final result is the file being sent to the printer with the added logo on the first page of each document.

It is important at this time to realize there are a number of ways to pass ICS commands other than via the command line.  For this example I would actually suggest creating a file the contains multiple ICS commands, called an ICS file.   Create a file markup.ics and have it contain:

ICS
printer number 12 type HPLJ3_ORIGINAL command none alias HPLaserjet4000
ldoc c:\invoice.pcl
onpage 1,4,6,10 markup load filename c:\logo.jpg rxloc 3.5 ryloc .25| plot 12 all

This file contains all of the commands we passed on the command line a moment ago.  To have this file run, simply open the file with SwiftConvert:

sview –c”ldoc markup.ics”

The result should be the same as when all the commands were passed on the command line.  This type of functionality allows you to write out all of the necessary commands before you create your command line string.

If you have any questions on any of these example please contact tech@swiftview.com.
 

SwiftView®, SwiftConvert, SwiftStamp, SwiftExtract, SwiftReprint, SwiftPublish, and LoanDocs®, are trademarks of eLynx, Ltd.
SwiftView, a division of eLynx, 15605 SW 72nd Ave Portland, OR 97224 USA
800-304-5941 or 971-223-2600
  ©2008 eLynx, Ltd.