Output in PDF Format


Adobe® Portable Document Format (PDF) is a universal file format that contains all fonts, formats, and graphics. PDF files are widely used in the Internet, not least because the content of a PDF file cannot be changed, in contrast to Word. You can view PDF files using the Adobe® Acrobat Reader - a tool that is provided free of charge with Adobe.


Smart Forms does not support direct output in PDF format. Instead, the OTF output has to be converted to PDF. Fonts and code pages used (particularly with Asian languages) have to be correct in the OTF output and are dependent on the language in which the form is printed. Depending on the language, a different device type that supports the corresponding fonts has to be used for printing.

A device type for printing PDF or for creating a PDF file is therefore not adequate for a Smart Form that is used as a template for printing forms in a number of languages. The device type has to be set dynamically before the Smart Forms function module is called.


To print a Smart Form in PDF, the Smart Forms OTF output has to be converted to PDF.

The restrictions in Note 323736 apply to all the options listed below for PDF conversion.

You can print a Smart Form in PDF as follows:

  • As of Basis Release 4.6D, you can use the device type PDF1 to print documents in PDF. This device type does not, however, contain all possible fonts and has to be extended for customer-specific fonts. See Note 317851 for PDF output in older releases.
  • You can return OTF as a table in the application program and convert this output to PDF. You can dynamically assign a device type for multi-lingual forms, using a function module (see Activities).
  • You can activate a PDF conversion when printing a Smart Form using SAPconnect. See also: Sending Forms via E-Mail or Telefax


Another option is for Smart Forms to return OTF and for you to convert it to PDF yourself:

  1. Get the name of the generated function module using the function module SSF_FUNCTION_MODULE_NAME (see also: Integrating the Smart Form into the Application).
  2. To get a device type suitable for the current language, call the function module SSF_GET_DEVICE_TYPE.
  3. Set the device type using the parameter TDPRINTER of the standard parameter OUTPUT_OPTIONS (see also: Output Options). Transfer this parameter, together with the parameters for the OTF output, to the generated Smart Forms function module, as described under Returning a Form as a Table to the Application Program.
  4. Get the OTF output from table OTFDATA of the standard parameter JOB_OUTPUT_INFO (see also: Querying the Output Result).
  5. To convert the OTF output to PDF, transfer the OTF table to the function module CONVERT_OTF. To do this, set the parameter FORMAT to 'PDF'. The output can be returned either as a binary string (parameter BIN_FILE) or as a character table (parameter LINES). SAP recommends the first variant.

You can then store the PDF output using the function module GUI_DOWNLOAD, for example, as a local file on your PC.

It is also possible to send the PDF output in a BSP application to the Web browser for display (as of Internet Explorer 5.5 with Support Package 2). You can display a Smart Form in the BSP application SF_WEBFORM_04 as a PDF in the browser or in a separate window. OTF is converted to PDF (as described above) in the event handler OnInitialization of the BSP page pdfform.pdf.