PDF transformation (-PDF) command

The -PDF command allows the map to transform map data in XML format to PDF data using the GET map rule. PUT receives map data in XML format and transforms it to formatted PDF data. This command allows the same with GET, so that it can return PDF data back to the map, by performing in-memory transformation. The XML format data must conform to the PDF importer generated, native XML schema for the corresponding PDF document

This command is useful in environments where file system access is restricted to the users, and PDF transformations must be performed in memory and then the transformed output to be returned to the map for further processing. A stream of PDF data is passed to the map with GET:

=GET("PDF","-PDF -NAMES memory://<names-document-id> -TEMPLATE memory://<template-document-id>",<xml-map-data>)

A template must be added to memory, if it is not a remote file, using the -ADOC command when performing in-memory transformation of XML formatted data to PDF formatted data. The -ADOC command returns a user specified document ID, or system ID for the template.
Note: The document in memory is referenced as: memory://
This three step process is shown here:
  • template-document-id=GET("PDF","-ADOC",<template-file-data-as-stream>) or =GET("PDF","-ADOC <my-template-documentid>",<template-file-data-as-stream>)
  • names-document-id=GET("PDF","-ADOC",<names-file-data-as-stream>) or =GET("PDF","-ADOC <my-names-documentid>",<names-file-data-as-stream>)
  • pdf-data-out=GET("PDF,"-PDF -NAMES memory://<names-document-id> -TEMPLATE memory://<template-document-id>",<xml-map-data>)

If you have to specify -SCHEMA (or -S), then you can do the same for the schema files.

Store output document in memory

With out the -PDF command, instead of streaming to a map, output operation can keep the output document in memory until it is fetched with -GDOC option. This is a two step process:
  • =PUT("PDF","-URL memory://<my-output-doc-id> -NAMES memory://<names-document-id> -TEMPLATE memory://<template-document-id>",<xml-map-data>) or the adapter command line can be used with the output card.
  • pdf-data-out=GET("PDF","-GDOC <my-output-doc-id>")

Default File URL

It is required to specify memory:// for memory documents, http:// for remote documents, or file:/// for local file system documents using the -URL (-U), -NAMES (-N), -SCHEMA (-S) and -TEMPLATE (-P) commands.

Reference XML data

-URL memory://<xml-data-document-id> can be specified. XML data is in memory and can be referenced instead of passing map data as a third parameter of GET. The third parameter has precedence over the -URL option.