AFP2web Server


Supported Services

Service URL Method
Usage http://server[:port]/services GET
version http://server[:port]/services/version POST
usid http://server[:port]/services/usid GET
transform http://server[:port]/services/transform POST
asyncTransform http://server[:port]/services/asyncTransform POST
getStatus http://server[:port]/services/getStatus?JobId=<JobId> GET

Common service parameters

Parameter Value Description
server_log_level OFF, INFO (default), WARN, ERROR, DEBUG Set server log level
ResponseFormat HTML | JSON Requested response format.
IMPORTANT NOTE: JSON is NOT used when buffer is returned

Usage parameters

None


Version parameters

Parameter Value Description
version On (default) | Off Version of server
version_all On | Off (default) Version of server and all it's modules
h2x On | Off (default) Version of htmltox module
h2x_all On | Off (default) Version of htmltox module and all it's components
a2w On | Off (default) Version of AFP2web module
a2w_all On | Off (default) Version of AFP2web module and all it's components

USID parameters

None


Transform parameters

Parameter Value Description
InputBuffer Input file buffer Content of file to be transformed
InputURLs Comma separated list of absolute input file names or URLs One or more input file name(s) or URL(s) to be transformed
IMPORTANT NOTE:
- When file name is given, the file must be accessible by AFP2web Server.
- Only http:// URL protocol is supported
OutputMode File | Buffer (default) Buffer means transformed output document sent back as binary data with proper mime type on response
File means transformed output document(s) will be written to output file path (specified by parameter "OutputFilePath"). This path must be accessible/writable from AFP2web Server.
OutputFormat Output format Expected output file format. Optional parameter and Default is PDF.
OutputFilePath Absolute path for output Expected path where transformed output document(s) should be written. This path must be writable from AFP2web Server
AFP2web.
Parameters of AFP2web must be passed in with following syntax:
a2w_<section name>_<parameter>=<value>
where
- Possible section is settings
- Possible settings parameters are described in AFP2web User Guide under chapter "AFP2web Reference->INI Parameter Reference->Section [Settings]"
a2w_settings_QuietMode On | Off (default) Turn on/off console messages
a2w_settings_Color On | Off (default) Turn on/off color output
html2x.
Parameters of html2x module must be passed in with following syntax:
h2x_<section name>_<parameter>=<value>
where
- Possible sections are global and object
- Possible global parameters are listed here
- Possible object parameters are listed here
h2x_global_colorMode Color | Grayscale (default) Generate color or gray scale output
h2x_object_web.enableIntelligentShrinking true (default) | false Enable intelligent shrinking to fit more content on one page

Asynchronous Transform parameters

Parameter Value Description
JobId Unique job identifier string Unique job identifier used to distinguish multiple asynchronous transformation calls and to get status of particular asynchronous transformation later.
InputURLs Comma separated list of absolute input file names or URLs One or more input file name(s) or URL(s) to be transformed
IMPORTANT NOTE:
- When file name is given, the file must be accessible by AFP2web Server.
- Only http:// URL protocol is supported
OutputMode File File means transformed output document(s) will be written to output file path (specified by parameter "OutputFilePath"). This path must be accessible/writable from AFP2web Server.
OutputFormat Output format Expected output file format. Optional parameter and Default is PDF.
OutputFilePath Absolute path for output Expected path where transformed output document(s) should be written. This path must be writable from AFP2web Server
StatusCallback POST URL which will be invoked with transformation status after completion. Optional, POST parameters passed in to callback are:
Parameter Description
JobId Unique Job Identifier
JobPID Process id of Server application processing transformation request
Filename List of input files passed in to asynchronous request
Status Status of transformation
Possible values are:
Done, means transformation successfully completed.
Error, ErrorMsg: , means transformation failed due to given reason
AFP2web.
Parameters of AFP2web module must be passed in with following syntax:
a2w_<section name>_<parameter>=<value>
where
- Possible section is settings
- Possible settings parameters are described in AFP2web User Guide under chapter "AFP2web Reference->INI Parameter Reference->Section [Settings]"
a2w_settings_QuietMode On | Off (default) Turn on/off console messages
a2w_settings_Color On | Off (default) Turn on/off color output
html2x.
Parameters of html2x module must be passed in with following syntax:
h2x_<section name>_<parameter>=<value>
where
- Possible sections are global and object
- Possible global parameters are listed here
- Possible object parameters are listed here
h2x_global_colorMode Color | Grayscale (default) Generate color or gray scale output
h2x_object_web.enableIntelligentShrinking true (default) | false Enable intelligent shrinking to fit more content on one page

GetStatus parameters

Parameter Value Description
JobId Unique job identifier string Unique job identifier to get status of particular asynchronous transformation.

Testing the services

In order to test the Services with out any coding, we added few web forms that is available at the following URLs:

http://server[:port]/services/transform.html
http://server[:port]/services/getstatus.html
http://server[:port]/services/version.html


Use Cases

Most common use case examples


Buffer In, PDF Buffer Out Transformation

Parameter Value Description
URL http://server[:port]/services/transform Synchronous transformation API
InputBuffer Input file buffer Input buffer to be transformed
OutputMode Buffer Buffer means output must be returned as binary data on response
OutputFormat PDF Expected output format
server_log_level off Turn off logging

File In, PDF File Out Transformation

Parameter Value Description
URL http://server[:port]/services/transform Synchronous transformation API
InputURLs /var/lib/apache2/fcgid/a2wserver/samples/insure.afp Input file to be transformed
OutputMode File File means output must generated as file on disk
OutputFilePath /var/lib/apache2/fcgid/a2wserver/pdf Absolute path to write output files. This path must be writable from AFP2web Server running machine
OutputFormat PDF Expected output format
server_log_level off Turn off logging