Products Downloads


French version


 


This function is provided when using Adelia Print Engine.


It is an extended version of VaToolBxAPETransformDoc. It performs the same processing plus an additional input-output parameter to retrieve information about the document produced. 


NB: this function is the Adelia counterpart to the APE "transformxslfo" Web service.


Remember: The VaToolBx dll must already be loaded (LOAD_DLL  instruction) when this function is called and must remain loaded when the VaToolBxAPEClearDataModel, VaToolBxAPEMergeDoc, VaToolBxAPEAddInDataModel or VaToolBxAPEMergeAndTransformDoc functions are called. 


Application area

  • Java client,

  • Java server,

  • Adelia Web client,

  • Adelia Cloud client,

  • Event Adelia client.


Parameters

IMAGE

XslfoDoc

Document au format XSL-FO.

ALPHA(n)

MimeType

Result document output format.

The string must be in the format defined by RFC 6838 (click here for more details ).

ALPHA(n) or IMAGE

Options

Definition of options to apply during document processing.

IMAGE

TransformDoc

Result document from executing the Apache FOP engine on the XslfoDoc document.

ALPHA(n) or IMAGE ExtraParams

Input-output parameter in JSON object format. Each attribute of this object must have a name among the following elements:

    • Ape-Total-Number-Pages: when this attribute is present (with any value), it is updated by the function return, and the value it takes is the total number of pages of the document produced.

NUM_BIN_2

ReturnCode

Operation return code:

0: Operation completed successfully. 

-1: The "Options" parameter must be ALPHA or IMAGE type.

-2: Error during syntax analysis in JSON format of "Options" processing options.

-3: Error during value analysis of "Options" processing options.

-4: Input/output error during analysis of "Options" processing options.

-5: Error when closing the TransformDoc result document.

-6 : The type of the "ExtraParams" parameter must be ALPHA or IMAGE.

-7 : Error analyzing JSON format syntax of the "ExtraParams" parameter

-8 : Error analyzing values of "ExtraParams" parameter

-9 : Input/output error analyzing "ExtraParams" parameter

-10?: Error updating the "ExtraParams" parameter.


The errors described below relate to the processing of the XslfoDoc document by the Apache FOP engine:

31: Apache FOP engine creation error. 

32: Document transformer creation error. 

33: Error when transforming the XslfoDoc document.

34: Input/output error when processing the result document.

35: Internal error when processing the XslfoDoc document produced by the engine. 



Apache FOP engine output formats

This engine supports several output formats.


XSL-FO document processing options

The "Options" parameter is used to define additional characteristics when producing the result document.
The format of options must be JSON: all the options are described in an object with each member describing an option, namely:

    • docDescription: option to define metadata stored in the result document (JSON Object-type value).
      This option can only be used with certain output formats which allow metadata storage.
      The Apache FOP engine currently only implements metadata support for the "application/pdf" format.
    • pdfDocPolicy: option to define the document permissions policy in "application/pdf" format (JSON array of Object-type value). This groups the protection functions by password, print authorizations, etc.


For example

ALPHA(20) MimeType
ALPHA(256) Options
IMAGE XslfoDoc
IMAGE TransformDoc
NUM_BIN_2 returnCode
ALPHA(256) extraParams
ALPHA(256) xmlDoc
xml_idf idfXmlDoc
NUM_BIN_2 totalNbPages

MimeType = 'application/pdf'
Options = '{"pdfDocPolicy": {"userPassword": "user"}}}'

* Preparation of the additional parameter requesting the total number of pages of the constructed document


extraParams = '{"Ape-Total-Number-Pages": null}'

CALL_DLL 'VaToolbx.dll' ' VaToolBxAPETransformDocEx' XslfoDoc MimeType Options TransformDoc extraParams returnCode

* Retrieve the total number of pages from the JSON extraParams parameter


conv_data extraParams 'JSON' xmlDoc 'XML'


xml_open idfXmlDoc *read *doc_var (xmlDoc)


xml_select idfXmlDoc //Ape-Total-Number-Pages


XML_GET_VAL idfXmlDoc totalNbPages


xml_close idfXmlDoc

↑ Top of page