Send OMR form source code for generation
To generate a printable OMR form from a source code, send a POST request to the https://api.aspose.cloud/v5.0/omr/GenerateTemplate/PostGenerateTemplate
Aspose.OMR Cloud REST API endpoint. To authorize the request, pass the access token in Authorization header (Bearer authentication).
The source code and rendering parameters are provided in JSON format in the request body.
{
"MarkupFile": "Source code as Base64 string",
"Images": {
"image1.png": "Base64 encoded image file",
"image2.png": "Base64 encoded image file"
},
"settings": {
"FontFamily": "Arial",
"FontStyle": "Regular",
"FontSize": 15,
"PaperSize": "A4",
"BubbleColor": "Red",
"PageMarginLeft": 50,
"Orientation": "Vertical",
"BubbleSize": "Normal"
}
}
Providing source code
The form’s source code is provided in a value of MarkupFile
property as a Base64 encoded string.
Providing images
If the OMR form contains images, they must be provided as Images
property entries, where the image filename referenced in the source code is the key and the Base64-encoded content of the image file is the value.
getconf ARG_MAX
command to check the maximum length of the command arguments (in bytes).
Rendering parameters
The paper size, orientation, font, and other global layout settings are configured through Settings
property.
Setting | Type | Values | Description |
---|---|---|---|
PaperSize |
string |
|
Physical page size. |
Orientation |
string |
|
Page orientation. |
PageMarginLeft |
number | Number of pixels. | The width of the left page margin in pixels. |
FontFamily |
string | Font name. Check the list of supported fonts. | Font family for all texts, except for those directly overridden in the source code. For example, Courier New .You can only use fonts that are supported in the cloud! |
FontSize |
number | Font size in pixels. | Font size for all texts, except for those directly overridden in the source code. |
FontStyle |
string |
|
Font style for all texts, except for those directly overridden in the source code. |
BubbleColor |
string | One of the supported color codes. | Color of all answer bubbles in the form. |
BubbleSize |
string |
|
Size of answer bubbles, except for those directly overridden in the source code. |
Return value
If successful, this method returns a string with a unique identifier (GUID) of the form generation request in the queue.
Otherwise, it returns a HTTP status code corresponding to the error.
What’s next
Form generation will take a few seconds, depending on the complexity of the form, number of images, and the current Aspose.Cloud load. See the article Fetch printable form for information on how to get a machine-readable form image and a recognition pattern from the server.