SAP NetWeaver 7.0

SAP Interactive Forms by Adobe

Customizing Printing Workflows (SAP NetWeaver 7.0 SPS13 or higher)

Document Version 2.0 – August 2007

© Copyright 2007 SAP AG. All rights reserved. Adobe, the Adobe logo, Acrobat, LiveCycle, PostScript, and Reader are either registered trademarks or trademarks of Adobe Systems No part of this publication may be reproduced or transmitted in any Incorporated in the United States and/or other countries. form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and notice. other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG Some software products marketed by SAP AG and its distributors in Germany and in several other countries all over the world. All other contain proprietary software components of other software vendors. product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves Microsoft, Windows, Outlook, and PowerPoint are registered informational purposes only. National product specifications may trademarks of Microsoft Corporation. vary.

IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, These materials are subject to change without notice. These materials MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, are provided by SAP AG and its affiliated companies ("SAP Group") xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, for informational purposes only, without representation or warranty of Tivoli, and Informix are trademarks or registered trademarks of IBM any kind, and SAP Group shall not be liable for errors or Corporation in the United States and/or other countries. omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express Oracle is a registered trademark of Oracle Corporation. warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional UNIX, X/Open, OSF/1, and Motif are registered trademarks of the warranty. Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, Disclaimer VideoFrame, and MultiWin are trademarks or registered trademarks of Some components of this product are based on Java™. Any code Citrix Systems, Inc. change in these components may cause unpredictable and severe malfunctions and is therefore expressively prohibited, as is any HTML, XML, XHTML and W3C are trademarks or registered decompilation of these components. trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Any Java™ Source Code delivered with this product is only to be used by SAP’s Support Services and may not be modified or altered in any Java is a registered trademark of Sun Microsystems, Inc. way.

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. Documentation in the SAP Service Marketplace You can find this documentation at the following Internet address: MaxDB is a trademark of MySQL AB, Sweden. service.sap.com/adobe → Media Library → Documentation

1 INTRODUCTION...... 4 1.1 Prerequisites ...... 4 1.2 Available XDC files ...... 4 1.3 Available job profiles...... 5 1.4 Documented workflows ...... 5 1.5 Audience...... 6 1.6 Related documentation...... 6 2 WORKING WITH XDC FILES...... 6 2.1 The section...... 6 2.1.1 The

August 2007 3 1 Introduction This document provides instructions for modifying the XML Forms Architecture (XFA) Device Configuration (XDC) files and job profiles that control your printer workflows. By modifying the XDC files and job profiles, you can customize the way you print documents. XDC files contain data (in the form of sequences, variables, and printer device language strings) that instructs a device driver to create the final representation of a form so that it can be printed or displayed in Adobe Reader. The data consists of sequenced variables and printer device language (PDL) strings. Because different printers support different PDLs (for example, PDF, PostScript, or PCL), a variety of XDC files are shipped with SAP Interactive Forms by Adobe, to ensure that specific printers are supported. However, you may have additional device or printing workflow requirements that the shipped XDC files do not support. In this case, you can modify the appropriate shipped XDC file according to your needs. This document provides some background information about the structure of XDC files, as well as some examples of how to modify various XDC files to support some typical customized workflows. Job profiles contain job-specific configuration settings in XML format. When your application calls Adobe document services, you can optionally specify a job profile. If you do, the profile is found and used to modify the way Adobe document services process that job. A variety of sample job profiles are shipped with SAP Interactive Forms, to assist you in creating job profiles for your particular requirements. This document provides examples of how to customize job profiles for particular scenarios. 1.1 Prerequisites To perform the XDC and job profile scenarios listed in this document, you require SAP NetWeaver 7.0 SP Stack 13 or higher. The XDC files and job profiles listed below are delivered as of this release. 1.2 Available XDC files The following XDC files are shipped with Adobe document services: • acrobat6.xdc – Supports data for rendering output in PDF 1.5 • acrobat7.xdc – Supports data for rendering output in PDF 1.6 • adobepdf.xdc – Supports data for rendering output in PDF 1.6 and 1.7 • hp4350pcl5e.xdc – For generating PCL output on an HP 4350 printer • hp4350ps.xdc – For generating PostScript output on an HP 4350 printer • hppcl5c.xdc – For use with PCL printers that support the HP PCL 5c printer language • hppcl5e.xdc – For use with PCL printers that support the HP PCL 5e printer language • lmt644pcl5e.xdc – For generating PCL output on a Lexmark T644 printer • lmt644ps.xdc – For generating PostScript output on a Lexmark T644 printer • ps_plain.xdc – For use with printers that support the PostScript printer language • ps_plain_mt.xdc – For use with printers that support the PostScript printer language and use MT (Monotype) font names • zpl203.xdc – For use with 203 dpi (8 dots/mm) Zebra label printers • zpl300.xdc – For use with 300 dpi (12 dots/mm) Zebra label printers

When you deploy Adobe document services to SAP NetWeaver AS, the XDC files are located in the /AdobeDocumentServices/lib directory. Before modifying any XDC file that you will use for production, you should save it with a new file name in order to preserve the original file. You can then modify your new file so that it is accessible when you want to change your printing workflow.

August 2007 4 PDF documents can be printed only on printers whose SAP device type has a corresponding XDC file in the system. SAP defines the following base device types: • POST2 – Postscript device type • HPLJ4 – PCL device type, black and white • HP9500 – PCL device type, color • PDF1 – PDF device type • AZPL203 and AZPL300 – Device types for Zebra label printers XDC assignments are stored in the table TSP0B. If an XDC file you want to use is not in the table TSP0B, do the following step: Copy a SAP device type (for example, copy POST2 to Z) and assign a new XDC file to it via report RSPO0022. For more information, see these documents in the SAP Printing Guide (BC-CCM-PRN): • Device Types for SAP Output Devices (Detail Information) → Defining a New Device Type → Copying Device Types • Print Architecture and Printing Methods → Printing PDF-Based Forms → Administering XDC Files for SAP Device Types (Report RSPO0022) 1.3 Available job profiles The following job profiles are shipped with Adobe document services: • MediaLetterToLetterhead. – Maps the letter medium to letterhead • MediaA4ToA4Letterhead.xml – Maps the A4 medium to A4 letterhead • DuplexLongEdge.xml – Prints the document double-sided on the long edge • DuplexShortEdge.xml – Prints the document double-sided on the short edge • ZPLSettings.xml – Specifies label flipping, print mode, print speed, and media darkness (head temperature)

When you deploy Adobe document services to SAP NetWeaver AS, the job profiles are located in the \AdobeDocumentServices\lib\JobProfiles\Adobe\Print directory. Before modifying any job profile that you will use for production, you should save it with a new file name in order to preserve the original file. You can then modify your new file so that it is accessible when you want to change your printing workflow. 1.4 Documented workflows This document provides examples to help you modify the XDC files and job profiles to perform the following tasks: PostScript and PCL printers: • Configuring device options on new printers • Feeding a document from a non-default paper tray (containing preprinted or custom- sized paper) • Stapling each copy of a multipage document • Printing documents using both sides of the page, on a duplex printer Zebra printers: • Printing a label rotated by 180 degrees • Specifying the action that the printer takes after a label or group of labels has printed • Changing the print speed setting

August 2007 5 • Changing the media darkness setting • Adding a custom label size 1.5 Audience The reader of this guide is responsible for printer administration and is familiar with XML, XML Forms Architecture, forms created in Adobe LiveCycle Designer (XDP files), the use of XCI files, and at least one output device language, such as PCL or PostScript. 1.6 Related documentation In addition to the procedures outlined in this document, you should also have access to the following resources: • Printer language reference documents specific to the language supported by your printer, such as the PostScript Language Reference. • Technical documentation for your specific printer. You may need to obtain this documentation from the printer manufacturer’s website. • Administering XDC Files for SAP Device Types (Report RSPO0022) in the SAP print Guide (BC-CCM-PRN) → Print Architecture and Print Methods → Printing PDF-Based Forms, for information on how to specify XDC files for printers.

2 Working with XDC files A basic XFA Device Configuration (XDC) file follows this structure:

The main sections of the XDC file are the section and the section. 2.1 The section This section of the XDC file provides information about the output device (the printer you are using). Its five subsections enable you to provide greater detail about the device that will use the instructions provided by the XDC file: The

August 2007 6 2.1.1 The You can also specify the language type and level:

The Resolution options can also be modified to specify the required X and Y resolutions as well as the default resolution. For example: The value of 0 for the X and Y resolution indicates that these options are unsupported. The defaultRasterResolution option is the default resolution used by the device. You can change this dpi setting according to the functionality of your specific printer. Other supported options and elements typically have values of either 0 (unsupported) or 1 (supported). For example, the option indicates that the device draws text natively. 2.1.2 The element The element describes a paper size that the device can support. The syntax and properties of the element are as follows: Children: [0..n] The following example shows a typical set of medium elements:

August 2007 7 The stock names must match the names of the stock specified by the element that is in the XDP file. When you create a form in LiveCycle Designer, you specify this stock information in the XDP file. 2.2 The section The section of the XDC file defines how events will be performed by the device driver. An event is an instance within a form that requires actions from the device driver, such as starting a print job, starting a new document within a print job, or simply drawing a line. In the XDC file, events are formed with collections of (sequence) elements. Sequence elements contain the device language string fragments that are assembled by the device driver to construct an output stream. Sequences are made up of (variable) elements, which contain information that specifies how each object will be drawn. The procedures in this document modify document, record, and page events. These event groups are defined in the “Output Sequences” section in PCL-based XDC files and as “Job/doc/page/subform event sequences” section in the PostScript-based XDC files. Document A document is an entire output run. For example, a day’s worth of phone bills in one data file is a document, and the individual phone bills are subsets of the entire document. The job level events are preDoc and postDoc. Each event may output a sequence to mark that point in the rendering of the form. Record A record is a subset of a job, and represents one data record. For example, one phone bill forms a record within the document that is made up of an entire day’s set of phone bills. The record level events are preRecord and postRecord.

August 2007 8 Page A page is a subset of a record, representing when printing begins on a new piece of paper. For example, one phone bill (a record) may consist of several pages of records of calls. Page level events are prePage and postPage. Depending on which printer language you are working with and what functionality you want to invoke, many items can be set in either the preDoc, preRecord, or prePage sequences. For example, the commands to staple a document may need to go in the preDoc section. 2.3 Using sequences and variables A sequence is a string, enclosed in tags. The sequence holds device language commands, and it may also reference elements. Sequences may be prototyped, and therefore have an ID attribute. By designating a sequence as a prototype (using the tag) you can reference the information defined by that sequence in another element, without having to repeat all of the data contained in the prototype. For information about using prototypes and references, see Using prototypes and references [below]. Internal variables are declared and set within the driver code. The XDC file can reference these variables from within a sequence. Internal variables for a selection of driver events are documented in the section “Event variables and output sequences” [on page 10]. Referencing an undeclared var in a sequence is an error. 2.4 Using prototypes and references A prototype specifies an object that can be used repeatedly throughout a form. The elements within the tag define the attributes of the object. Prototypes are invoked when referenced by another element. An element refers to a prototype through its use attribute, which takes a fragment identifier as a reference to the prototype element. For example, the ps_plain.xdc file defines within its section a prototyped sequence called PSHeader: % simple drawing functions … The prototype defines a series of attributes for pa_preamble; these attributes are used whenever another element, such as a sequence, refers to pa_preamble. For example, this prototype is referenced in the section of ps_plain.xdc that defines the event sequences: Here, the node references another node for its actual content. It uses the attributes that are defined within the pa_preamble prototype.

August 2007 9 2.5 Event variables and output sequences

This section lists the sequences and variables that occur within the relevant driver events. For variables, the variable name is given. For sequences, the ID is given, along with comments to indicate any other relevant information. Typically, these sequences are output in the order listed below.

PCL, PostScript, and ZPL: preDoc Sequence ID Vars set preDoc none postDoc Sequence ID Vars set postDoc none preRecord Sequence ID Vars set preRecord none postRecord Sequence ID Vars set postRecord none prePage Sequence ID Vars set prePage none postPage Sequence ID Vars set postPage none

August 2007 10 PostScript only: startDoc Sequence ID Vars set startDoc none endDoc Sequence ID Vars set endDoc none startRecord Sequence ID Vars set startRecord none endRecord Sequence ID Vars set endRecord none startPage Sequence ID Vars set startPage none endPage Sequence ID Vars set endPage none 3 Customizing workflows for PostScript and PCL printers This section describes workflows that you can create specifically for PostScript and PCL printers. By customizing the PostScript- or PCL-based XDC files, you can perform the following printing tasks: • Configuring device options on new printers • Printing a document on a specific type of paper • Stapling each copy of a multipage document • Printing duplex documents on a duplex printer 3.1 Configuring device options on new printers The section of the XDC file defines the details of your production printer. Ensure that the device information options in the XDC file correspond with the printer on which you execute your workflows. To configure device options for a new printer: 1. In the XDC file that corresponds to your printer, locate the section. 2. Modify the contents of any of the following options in correspondence with the production printer:

August 2007 11 Example The following example shows the device info details for a specific printer. For more information about the tag, see The section [on page 6]. 3.1.1 Setting the PostScript level The ps_plain.xdc file is a PostScript Level II driver; therefore, the languageLevel value in this file is set to 2 by default. If you are using this driver, and all the printers that you are targeting are PostScript Level III printers, you should change the languageLevel setting to 3. To set the PostScript level: 1. Open the ps_plain.xdc file, and find the languageLevel option in the Device options section. 2. Change the value of the languageLevel option to 3, as shown in the example: : 3.2 Printing a document on a specific type of paper You can print a particular document on a specific type of paper residing in a non-default paper tray. To do this, you modify your XDC file and job profile so that the printer feeds from this paper tray. You would follow this scenario if you want to change the type of paper specified in your form (XDP file) or if your form does not have a type of paper specified. 3.2.1 Mapping printer trays In your XDC file, create a tray mapping table. The element contains the available input paper trays for a particular device, and the type of paper that each tray contains. tray_name describes the paper tray stock_name associates a particular tray with its corresponding element with the same value. For information about the element, see The section [on page 6].

To create a tray mapping table: 1. Open your XDC file and save it with a new name.

August 2007 12 2. Create a tray mapping table in the XDC file. For example: 3. Ensure that the XDC file also defines the media you have specified as stock names: 4. Save the XDC file. 3.2.2 Mapping media Once the input trays are defined, you specify the type of paper you want to print on in a job profile. Adobe document services use the tray mapping table to determine which input tray contains that type of paper. The MediaLetterToLetterhead.xml and MediaA4ToA4Letterhead.xml job profiles demonstrate how to change the paper to a new type of paper. To create a job profile that specifies the medium for printing: 1. Open one of the sample job profiles (MediaLetterToLetterhead.xml or MediaA4ToA4Letterhead.xml) and save it with a new name. 2. Change the values in the element to reflect the media you want to map. 3. Save the job profile. Example This section of the MediaLetterToLetterhead.xml file shows the syntax for the element: The element specifies the existing medium contained in the form (from="letter") and a new medium to replace it with when printing (to="Letterhead"). The element indicates what happens when the source medium is not present in the tray mapping table in the XDC file. These are the possible values: 0 is the default value. This value indicates that no mapping takes place if the from medium is not found in the tray mapping table. 1 indicates that the mapping applies at all times, regardless of whether the from medium is found in the tray mapping table.

August 2007 13 3.3 Printing duplex documents on a duplex printer Forms created as duplex forms with LiveCycle Designer 8.0 or later do not need any further customization. However, forms created with LiveCycle Designer 7.1 or earlier, or forms created as single-sided forms require a job profile to print in duplex mode. If the printer supports duplex printing, you can create a job profile so that the document prints on both sides of the paper. The DuplexLongEdge.xml and DuplexShortEdge.xml job profiles demonstrate how to specify duplexing. To create a job profile that duplexes documents: 1. Open one of the sample job profiles (DuplexLongEdge.xml or DuplexShortEdge.xml) and save it with a new name. 2. Change the values in the element to reflect the type of duplexing you want: Simplex – Simplex printing (single-sided printing, no duplex) duplexLongEdge – Duplex printing, with binding on the long edge of the page duplexShortEdge – Duplex printing, with binding on the short edge of the page 3. Save the job profile. This section of the DuplexLongEdge.xml job profile shows the syntax for the element: Print double-sided, flipping along the long edge. duplexLongEdge

Example This example shows the jobLevelDuplex option set to print on both sides of a page, with long- edge binding:

August 2007 14 3.4 Stapling multipage documents If the printer supports stapling, you can customize the PostScript or PCL XDC file so that the printer staples each multipage document instance. To set up this functionality, you must place the appropriate PostScript command into the or a PCL job ticket into the in the XDC file. The XDC files are found in the AdobeDocumentServices/lib directory of the SAP WebAS installation. Note: Stapling commands are typically printer-specific. The /Staple command and the PJL job ticket used in this example are supported by the Xerox Document Center line of printers. Other printers may have different syntax. Your printer documentation can provide the correct command for your printer. To customize the PostScript XDC file: 1. Locate the setupPageMedia sequence in the ps_plain.xdc file. 2. Add the /Staple command to the sequence before the >> command, as shown in the example below. /Staple 3 Example The following example shows the event sequence section of a PostScript XDC file for a specific printer with a staple command added: <</DeferredMediaSelection true /PageSize[ ] /ImagingBBox null /Staple 3 >> setpagedevice To customize the PCL XDC file: 1. In the section of a PLC XDC file, locate the startDoc sequence ( %-12345X@PJL RDYMSG DISPLAY="" @PJL ENTER LANGUAGE = PCL @PJL COMMENT XRXbegin @PJL COMMENT OID_ATT_FINISHING OID_VAL_FINISHING_STAPLE; @PJL COMMENT XRXSTAPLE = PORTRAIT; @PJL COMMENT XRXend &l1T*t600R&u600D& l1X&l0S

August 2007 15 4 Customizing workflows for Zebra printers This section describes workflows that you can create specifically for Zebra printers. By customizing the Zebra-based XDC files (zpl203.xdc and zpl300.xdc) and the Zebra job profile (ZPLSettings.xml), you can perform the following printing tasks: • Print a label rotated by 180 degrees • Specify the action that the printer takes after a label or group of labels has printed • Change the print rate setting • Change the printer media darkness (head temperature) • Define a new label size for printing on specialized paper 4.1 Printing a label rotated by 180 degrees To print a label rotated by 180 degrees, you specify the element. To specify label rotation: 1. Open the ZPLSettings.xml job profile and save it with a new name. 2. Locate the element in the job profile. 3. Modify the value to the setting you want: usePrinterSetting is the default value. If you specify this value, the printer setting is used. on – The printer rotates the content of the label by 180 degrees. off – The label prints without any rotation. 4. Save the job profile. 4.2 Specifying the action that the printer takes after label printing You can specify the action that a printer takes after label printing by using the element. To specify the action after label printing: 1. Open the ZPLSettings.xml job profile and save it with a new name. 2. Locate the element in the job profile. 3. Modify the property to the setting you want: usePrinterSetting is the default value. If you specify this value, the printer setting is used. on – After a label is manually removed, the printer feeds the next label forward to pre- peel a small portion of the label away from the liner material. off – The printer does not perform the pre-peel action. 4. Modify the value to the setting you want: usePrinterSetting is the default value. If you specify this value, the printer setting is used. tearOff – The printer advances after printing the label so the web is over the tear bar. The label, with liner attached, can be torn off manually. peelOff – The printer moves forward after printing the label and activates a Label Available sensor. Printing stops until the label is manually removed from the printer. rewind – This option ensures that the label and backing are rewound on an external rewind device. The next label is positioned under the print head (no back-feed motion). cutter – The label feeds forward after printing the media and is automatically cut into predetermined lengths.

August 2007 16 applicator – When the printer is used with an application device, this option ensures that the label moves far enough forward to be removed by the applicator and applied to an item. 5. Save the job profile. 4.3 Changing the print speed setting To change the print speed setting, you specify the property for the element in a job profile. This setting determines the media speed in inches per second during printing. For information about the values available to set the printing speed, refer to the command reference for Print Rate (^PR) in your ZPL Programming Guide. To set the printer speed: 1. Open the ZPLSettings.xml job profile and save it with a new name. 2. Locate the element in the job profile. 3. Modify the printSpeed property to the printer speed setting you prefer, as in the example shown below. 4. Save the job profile. Example This example shows the property that has been modified to change the speed from 2 inches/second to 6 inches/second: 4.4 Changing the media darkness setting To change the darkness of printing, you specify the element in a job profile. This setting adjusts the darkness relative to the current darkness setting. For information about the values available to set the media darkness setting, refer to the command reference for Media Darkness (^MD) in your ZPL Programming Guide. To set media darkness: 1. Open the ZPLSettings.xml job profile and save it with a new name. 2. Locate the element in the job profile. 3. Modify the value to indicate the level of darkness you want, as in the example show below. 4. Save the job profile Example This example shows the head temperature set to a value of 10: 10 4.5 Adding a custom label size You can define a custom label size for your Zebra printer by adding an entry to the Medium section of the appropriate Zebra-based XDC file. The entry defines the dimensions of the label, the number of points of the long and short edges, and the dimensions of the imaging box. To add a custom label size: 1. Locate the Medium section in the zpl203.xdc or zpl300.xdc file. 2. Add a medium stock entry to the list of entries, as shown in the example below. Example This example shows a new label size in the Medium section of the XDC file that has dimensions of 5x7 inches.

August 2007 17

August 2007 18