Vanilla.PDF  2.1.0
Cross-platform toolkit for creating and modifying PDF documents
Set license file
error_type process_license_info(string_type license_file) {
BufferHandle* license_buffer = NULL;
InputStreamHandle* input_stream = NULL;
// License is enabled by default since we are running the opensource configuration.
// The API is available to keep the backwards compatibility and will be removed on the next major release.
RETURN_ERROR_IF_NOT_SUCCESS(InputStream_CreateFromFile(license_file, &input_stream));
RETURN_ERROR_IF_NOT_SUCCESS(InputStream_ToBuffer(input_stream, &license_buffer));
RETURN_ERROR_IF_NOT_SUCCESS(LicenseInfo_SetLicenseBuffer(license_buffer));
RETURN_ERROR_IF_NOT_SUCCESS(LicenseInfo_IsValid(&is_valid));
if (is_valid != VANILLAPDF_RV_TRUE) {
print_text("Could not enable license\n");
return VANILLAPDF_TEST_ERROR_FAILURE;
}
RETURN_ERROR_IF_NOT_SUCCESS(InputStream_Release(input_stream));
RETURN_ERROR_IF_NOT_SUCCESS(Buffer_Release(license_buffer));
return VANILLAPDF_TEST_ERROR_SUCCESS;
}
Represents memory stored data.
Input stream can read and interpret input from sequences of characters.
const boolean_type VANILLAPDF_RV_TRUE
Represents the boolean true value.
const boolean_type VANILLAPDF_RV_FALSE
Represents the boolean false value.
uint32_t error_type
This is return value type of all API functions.
Definition c_types.h:25
int8_t boolean_type
Boolean type supported in C.
Definition c_types.h:31
const char * string_type
C-Style string.
Definition c_types.h:82