| Special File Handling |
|
| Formats | 1.
Open PDF File: OPEN (chan[,fileopt])"*PDF*[;option][;option]
[...]" 2. PDF via WindX: OPEN [INPUT] (chan[,fileopt])"[WDX]*PDF*[;option][;option] [...]"
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | Use
*PDF* for directing output to a PDF
(Postscript Document Format) compatible file. The
interface to the PDF output is fundamentally the same as
the interface to the Window print spooler an
application opens the logical file *PDF*
instead of *WINPRT*.
The OPEN pathname may specify a number of semi-colon separated options for the PDF file. A number of semi-colon separated options for the PDF file may be included as part of the pathname, or as part of the OPT= clause:
The following options can be used to define PDF output.
¹ These options require the use of the HARU PDF library thus requires the 'HP' system parameter be set In order to create a PDF/A compliant output file you MUST declare that all fonts be embedded (EMBED=ALL). The PDF file must also not be encrypted or have a password as these would violate the ISO standards for PDF/A. Values for margin settings are typically given in 1000ths of an inch; however, the following also applies. If the value contains the letter I, it is considered inches. If the value contains the letter M, it is considered millimetres. If the value contains a decimal point, or the value is less than 25, then it is considered not as 1/1000 but as either inches or millimetres. Examples:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| General Information | If
neither the FORM= or PAPERSIZE= is
given, or the value for either of these two parameters
cannot be found in the Forms Library, then the
default LETTER size (8.5" x 11") size is assumed. If both FORM=
and PAPERSIZE= are given, the FORM=
option has priority. For further details, see Forms Handling. If the ASIS or DISPLAY options are not specified and no FILE= is given, then the system prompts the user for the file. If ASIS is specified, but no FILE= has been defined by a prior open to *PDF*, then ProvideX will generate an Error #12: File does not exist (or already exists). The filename specified by FILE= cannot have a [WDX] prefix. If the user wants output to go to a remote file they should issue the open as follows:
In order to simplify the logic behind this process and allow for developer customization, whenever *PDF* is opened, the input pathname is forwarded for processing to the user-defined program *ext/pdf (if it exists) or the ProvideX-supplied program *ext/system/pdf. It determines if the selection window should be presented and validates the FORM= and PAPERSIZE= options. These options passed may be retrieved via PTH( ) and OPT( ).
The 'FONT' mnemonic only supports the following basic 14 PDF fonts: "Courier",
"Courier-Bold",
"Courier-BoldOblique", In order to simplify the mapping of common windows fonts to the standard PDF fonts, the system automatically performs the following font translation:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mnemonics and Functions
The following mnemonics are supported with *PDF*:
*PDF* also supports language functions such as:
*PDF* accepts character mode text:
The following are known limitations that control options under the ProvideX PDF interface:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Forms Handling | The
ProvideX-supplied utility program *ext/system/pdf
is embedded with a forms handling mechanism that
validates and displays dialogues to the end user. To
provide consistency with Windows forms handling, the PDF
output paper size is determined via form name
rather than by the physical dimensions of
the paper. For the purposes of the PDF handler, the FORM= option provides a form name followed by a colon, and include the paper size in terms of width and height. The paper size values are assumed to be in thousandths of an inch unless followed by the letter I (for inches) or the letter M (for millimetres). The PDF processor within ProvideX will only utilize the width and height portions of the FORM= option. The form name is provided strictly as a reference for the display. The Form Library is a keyed file. The PDF utility program will search for *ext/forms.xx then for *ext/system/forms.xx, where xx is a language code. The properties for this file are:
The *ext/system/forms.en file is pre-loaded with standard form sizes. The PDF selector window allows for additional forms to be added to the file. When the first form is added to this file by the end user, a copy of the file *ext/system/forms.xx is made in *ext/forms.xx, which is then used. To simplify installation
of applications with custom forms, when the selection
window is presented and a FORM= is
specified, the form name will be automatically added if
it does not already exist in the Forms
Library. This allows applications to be
created with hard-coded FORM= clauses in
their OPEN commandthe system
automatically creates the required form entry. Should the OPEN include a PAPERSIZE= option but no FORM= specification, the system will look up the form using the PAPERSIZE= value to determine what the proper form is. If there is neither a FORM= specification nor a valid PAPERSIZE= value, LETTER (8.5x11 inch) will be assumed. The PAPERSIZE= is ignored when a FORM= option is present. The priority field is used to determine the load sequence for lists used to display the available forms in the system. By default, Letter, Legal, A4, A5, and a number of other standard form sizes are priority "0". All other forms have a priority of "5". User forms are added with a priority of "1" and appear near the top of the list when displayedust below the standard form sizes. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Utility for Processing PDF Options | ProvideX
includes PDF utility programs for processing options on
an OPEN:
ENTER NewParameters$, OldParameters$, ERR=*next The utility will handle most PDF option string validation and forms processing internally. It ensures that the string that it gets passed to process has a valid FORM= option before it is returned to the actual PDF interface. It is basically a pre-processor for the PDF string. Once the PDF string is accepted, the utility program returns it to ProvideX, which saves it as the default setting. In order to allow for application designers to access this default setting, the OPEN logic for *PDF* files allows the programmer to issue OPEN INPUT (chan) "*PDF*;ASIS" then query the PTH( ) and OPT( ) of the PDF file in order to obtain the settings. The INPUT clause prevents the system from erasing the output file. Optionally, to set default settings, the developer can issue:
PDF Message Selection Box (Graphical) The user will be presented with a dialogue box to allow for selection of the output file, form, and orientation. When a file pathname has been given, the system checks to see if the file existsf so, the user is asked if they wish to overwrite the output file. The Form drop box contains the list of all the known form size in the system with the currently selected form name highlighted/selected (the default being Letter). The dialogue also has a New button for adding a new form description. Pressing the ACCEPT button in the message box results in the form description being saved/added to the form library and the identified form being set as the output form type. PDF Message Selection Box (Text Mode) The user will be presented with a character-mode window. When a file pathname has been given, the system checks to see if the file existsif so, the user is asked if they wish to overwrite the output file. Once the file has been given, a drop list of the potential forms is displayed. The currently selected item is highlighted. After selecting the form, the user must select the orientation from a drop list with choices Portrait or Landscape. Once all the selections are made, the user can select OK or Cancel to confirm the input. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Capturing Output to *WINPRT* as PDF Output | Output
to *WINPRT* can be automatically
intercepted for PDF using the 'AP' system
parameter. When 'AP' is set, if the user
selects Output To File and includes a filename ending
in.PDF, ProvideX looks at the options selected during the
*WINPRT* Printer Selection dialogue and
processes the output through *PDF*
instead of *WINPRT*. 'AP' may be set on in one of 3 ways:
By setting the AutoEnablePDF= -1 in the [Config] section of your INI file, you can remove the entry from the dialogue system drop down menu. However, you are still be able to turn the parameter 'AP' on and off programmatically. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Default PDF settings | The
global variable %PDF_DEFAULT$ can be set
to contain any default PDF options such as default paper
size, margins, etc. As in the *PDF* pathname, options
hsould be seperated by semi-colons. In addition %PDF_DEFAULT$ can contain the option VIEWER which will make the PDF driver the default report viewer in the system and will be used whenever the application opens *VIEWER*.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| See Also | 'AP' System Parameter 'FONT' Mnemonic *WINPRT* Windows Printing |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||