API browser of generalFormRequest450 COM module


/images/arrow_right.png IGeneralFormRequestManager::GetPDF method space
The GetPDF method returns the final PDF form.

The generalFormRequest system does not endorse a paradigm of "completeness" or "100% preset capability". Therefore, the PDF form can only be finalized by a user-driven review process whereas the visualization is done by free Acrobat Reader (in fact it is the first installed and available browser, capable of handling .xdp files) using a PDF form with the merged-in programmatically preset data.

After that review and modification process the PDF is per definition in final state. However, the review process is suppressed if and only if neither an empty PDF form template was loaded nor any data was altered between the initial load of the PDF and request of the PDF.

In Restful Webservice environment: the data visualization step can obviously not be performed on the Restful Webservice. Therefore the result of GetPDF() method is a PDF form which includes all programmatically set data. This PDF form must be shown and validated on the end-user side in an Acrobat Reader with enabled Javascript engine. User-specific changes and modifications can then be made and the form can be sent via a posible DirectSend functionality.

The merge process of the programmatically defined data into the PDF form is performed on the web server side with a full version of Adobe Acrobat, i.e. the availability of this license-requiring browser is a system requirement.

It should be noted that after the successful merge process, any prior attached documents (IGeneralFormRequest::AddDocument method) will be sent to the medForms portal ahead of time, bearing in mind that the form data itself will be sent later by the user. On the medForms portal, these documents are cached for a maximum of 3h awaiting to be migrate with the main form data. If the latter are not delivered, the documents are deleted after the cache time is due.

If an XML is to be generated, then the PDF form saved after the visualization step must be loaded on the rest server with LoadPDF, any required XML-specific data must be set and then GetXML must be called.

space
/images/arrow_right.png Restful webservice calling syntax
[POST] /baseURL/IGeneralFormRequestManager/GetPDF
[JSON input data] pIGeneralFormRequestManager:
lGenerationAttributes:
longValue,    //interface address
longValue
[JSON result data] pbstrPDFFile:
plDirectSendTimestamp:
pbstrDirectSendLog:
pbStatus:
"utf8StringValue",
longValue,
"utf8StringValue",
booleanValue
 
[HTTP result status] 200 Return status 200 signals a successful method call
204 Return status 204 (noContent) signals that the end of an iteration is reached
>= 400 Return status >= 400 signals an unsuccessful function call. The returned JSON{errorCode: code, errorText:"text"} supplies the error message the same as GetAbortInfo() would do.
space
/images/arrow_right.png C/C++ calling syntax
HRESULT GetPDF( long
BSTR
long
BSTR
VARIANT_BOOL
lGenerationAttributes,
*pbstrPDFFile,
*plDirectSendTimestamp,
*pbstrDirectSendLog,
*pbStatus);
[C/C++ return value] S_OK This value is returned if the function call was successful.
S_FALSE This value is returned if the end of an iteration is reached
E_name This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
space
/images/arrow_right.png Calling argument description
[in] long lGenerationAttributes This variable overrules the default behavior of the PDF generation process even if the appropriate data have been defined.

lGenerationAttributes is a 32-bit integer where the possible "commands" are values from the generationAttributes data type ORed together to form the overall command.

This feature is necessary to generate different "flavors" of XML infosets without re-setting input data. For instance, an encrypted XML infoset for the "to" entity can be produced and in a second call the XML infoset without encryption (lGenerationAttributes=enGenerateXMLWithoutEncryption) is requested for a local archive (that can be loaded back later!).

Moreover, the downgrade to the lower version is defined by setting the enGenerateDowngradeToV430 bit.

[out] BSTR *pbstrPDFFile The full file name (path + name) where the final PDF form is stored.

The PDF form file must be saved to a different location as all temporary files in the working directory are deleted before the COM module shuts down!

In Restful Webservice output: pbstrOutputFile is a releative URL which must be downloaded in a subsequent GET process.

[out] long *plDirectSendTimestamp The timestamp as epoch time (seconds elapsed since 1.1.1970) when the "direct data send" feature on the PDF form was successfully used. The timestamp is set 0 under all other conditions.

This is basically an information for the documentation of the form process management thus allowing to build an quality of service for the form lifetime.

[out] BSTR *pbstrDirectSendLog This is a log excerpt of the "direct send" process.

The log consists of crlf-separated lines with the format:
     date time: text [ERR=n]
where the error is given in an error situation only.

[out,retval] VARIANT_BOOL *pbStatus Return status of the method. If pbStatus is VARIANT_FALSE then an error occurred and GetAbortInfo should be called to retrieve the error string.
space