Transcription of Batch Printing to PDF Using GhostScript
1 Batch Printing to PDF Using GhostScript Release Uniface R112. Please direct questions about {Compuware Product} or comments on this document to: Technology Customer Support Compuware Corporation Customer Support Hotline 1-800-538-7822. FrontLine Support Web Site: For telephone numbers in other geographies, see the list of worldwide offices at Access is limited to authorized users. Use of this product is subject to the terms and conditions of the user's License Agreement with Compuware Corporation. Documentation may be reproduced by Licensee for internal use only. All copies are subject to the terms of this License Agreement. Licensee agrees to provide technical or procedural methods to prevent use of the Software and its documentation by anyone other than Licensee. Copyright 2011 Compuware Corporation. All rights reserved. Unpublished rights reserved under the Copyright Laws of the United States. GOVERNMENT RIGHTS Use, duplication, or disclosure by the Government is subject to restrictions as set forth in Compuware Corporation license agreement and as provided in DFARS (a) and (a) (1995), DFARS.
2 (c)(1)(ii) (OCT 1988), FAR (a) (1995), FAR , or FAR (ALT III), as applicable. Compuware Corporation. This product contains confidential information and trade secrets of Compuware Corporation. Use, disclosure, or reproduction is prohibited without the prior express written permission of Compuware Corporation. Access is limited to authorized users. Use of this product is subject to the terms and conditions of the user's License Agreement with Compuware Corporation. Adobe Reader is a registered trademark of Adobe Systems Incorporated in the United States and/or other countries. All other company and product names are trademarks or registered trademarks of their respective owners. Local Build: May 3, 2011, 16:29. Contents Chapter 1 Uniface Batch Printing to PDF Using GhostScript .. 5. Configuring Uniface to Print to PDF Using GhostScript .. 5. Batch Printing to PDF Using GhostScript 3. Contents 4 Batch Printing to PDF Using GhostScript CHAPTER 1.
3 Uniface Batch Printing to PDF Using GhostScript Uniface supports Printing to PostScript , but it does not support Printing directly to PDF. By creating a print model that directs PostScript files to a third-party utility called GhostScript , PostScript files can be converted to PDF in Batch mode. This document describes how to configure Uniface to generate PostScript output and convert it to PDF Using GhostScript . For information on Uniface's PostScript support, see PostScript Support in the Uniface Library. Configuring Uniface to Print to PDF Using GhostScript Uniface supports Printing to PDF from form or report components by creating PostScript files and then directing them to a third-party utility. One utility commonly used for this purpose is GNU GhostScript (copyright GNU organization). To create PostScript files and direct them to GhostScript : 1. Download the GhostScript executables from one of the available Web sites.
4 For example: GhostScript from GSView (a user interface for GhostScript ) from University of Wisconsin 2. Create a Batch file to contain the GhostScript commands. The GhostScript switches and options are case-sensitive. Refer to the GhostScript documentation for details. The GhostScript command and options must be on a single command line. (For readablity, this is split over multiple lines in the examples). For example: a. For Windows, create containing the following command line: "C:\Program Files\gs\bin\ " -dBATCH -dNOPAUSE -dNOOUTERSAVE. -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile="D:\PDF\% " "C:\ProgramData\Uniface\project\%1". Batch Printing to PDF Using GhostScript 5. Chapter 1 Uniface Batch Printing to PDF Using GhostScript b. For Unix, create , containing the following command line: gs -dBATCH -dNOPAUSE -dNOOUTERSAVE -sDEVICE=pdfwrite -sPAPERSIZE=a4. -sOutputFile=$ $1. 3. Define a new Print Job Model, setting the properties as follows: Property Value Description Name: Name Eenter a meaningful name, such as PDF.
5 Device Type: P_X11 P_X11 is a Uniface device translation table that enables extended PostScript output. The P_POSTSCRIPT translation table is also available for limited (text only) PostScript output. You may modify these translation tables, if you wish. For more information, see Device Translation Tables for Printing in the Uniface Library. Print Queue: BatchFile Path and name of the Batch file, for example on Windows, c:\unif\ If you leave this field blank, the print output is saved as a PostScript file with the standard Uniface print file name You can view this file Using GSView or produce a PDF file Using GhostScript . Device Mode Mode Specify the device mode that corresponds to the paper size (if it is other than A4). For example, in the P_X11 device translation table, mode 4 defines letter size, portrati orientation. NOTE. GhostScript is configured to use Letter as the default paper size, whereas Uniface's default paper size is A4.
6 To produce consistent output, ensure that the GhostScript command line and Uniface are in agreement with each other. Margins: Lines Value for margins to position the output properly. A Top Margin of at least 4 (lines) is recommended. (optional). 6 Batch Printing to PDF Using GhostScript Chapter 1 Uniface Batch Printing to PDF Using GhostScript Figure 1. Example Print Model 4. When you print your Uniface output, specify the PDF Print Job Model. Print Preview in Acrobat Reader The following Batch file script gives a print preview in Acrobat Reader. You can change the path depending on your installation and Windows version. @echo off rem Calling GhostScript to create the PDF document "C:\Program Files\gs\bin\ " -dBATCH -dNOPAUSE -dNOOUTERSAVE -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile="D:\PDF\% " "C:\ProgramData\Uniface\project\%1". rem Opening document with Acrobat Reader start "C:\Program Files\Adobe\Reader \Reader\ " "D:\PDF\% ".
7 Batch Printing to PDF Using GhostScript 7. Chapter 1 Uniface Batch Printing to PDF Using GhostScript 8 Batch Printing to PDF Using GhostScript