|
Scanbot SDK
|
Typedefs | |
| typedef struct scanbotsdk_pdf_attributes_t | scanbotsdk_pdf_attributes_t |
| scanbotsdk_pdf_attributes_t class | |
| typedef enum scanbotsdk_page_size_t | scanbotsdk_page_size_t |
| scanbotsdk_page_size_t enum | |
| typedef enum scanbotsdk_page_direction_t | scanbotsdk_page_direction_t |
| scanbotsdk_page_direction_t enum | |
| typedef enum scanbotsdk_page_fit_t | scanbotsdk_page_fit_t |
| scanbotsdk_page_fit_t enum | |
| typedef enum scanbotsdk_resampling_method_t | scanbotsdk_resampling_method_t |
| scanbotsdk_resampling_method_t enum | |
| typedef struct scanbotsdk_pdf_configuration_t | scanbotsdk_pdf_configuration_t |
| scanbotsdk_pdf_configuration_t class | |
Functions | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_create (const char *author, const char *creator, const char *title, const char *subject, const char *keywords, scanbotsdk_pdf_attributes_t **result) |
| Creates a new instance of scanbotsdk_pdf_attributes with given params and stores it in the location specified by the last argument. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_create_with_defaults (scanbotsdk_pdf_attributes_t **result) |
| Creates a new instance of scanbotsdk_pdf_attributes_t with given required params and stores it in the location specified by the last argument. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_free (scanbotsdk_pdf_attributes_t *object) |
| Frees the memory allocated for the instance of scanbotsdk_pdf_attributes_t. If null is passed, the function does nothing. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_get_author (scanbotsdk_pdf_attributes_t *self, const char **author) |
| Returns value of author field of the given object. The returned pointers do NOT own the underlying object, caller must not free them. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_set_author (scanbotsdk_pdf_attributes_t *self, const char *author) |
| Sets value of author field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_get_creator (scanbotsdk_pdf_attributes_t *self, const char **creator) |
| Returns value of creator field of the given object. The returned pointers do NOT own the underlying object, caller must not free them. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_set_creator (scanbotsdk_pdf_attributes_t *self, const char *creator) |
| Sets value of creator field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_get_title (scanbotsdk_pdf_attributes_t *self, const char **title) |
| Returns value of title field of the given object. The returned pointers do NOT own the underlying object, caller must not free them. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_set_title (scanbotsdk_pdf_attributes_t *self, const char *title) |
| Sets value of title field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_get_subject (scanbotsdk_pdf_attributes_t *self, const char **subject) |
| Returns value of subject field of the given object. The returned pointers do NOT own the underlying object, caller must not free them. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_set_subject (scanbotsdk_pdf_attributes_t *self, const char *subject) |
| Sets value of subject field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_get_keywords (scanbotsdk_pdf_attributes_t *self, const char **keywords) |
| Returns value of keywords field of the given object. The returned pointers do NOT own the underlying object, caller must not free them. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_attributes_set_keywords (scanbotsdk_pdf_attributes_t *self, const char *keywords) |
| Sets value of keywords field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_page_size_t_to_string (scanbotsdk_page_size_t value, const char **result) |
| Returns the string representation of the given scanbotsdk_page_size_t value. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_page_direction_t_to_string (scanbotsdk_page_direction_t value, const char **result) |
| Returns the string representation of the given scanbotsdk_page_direction_t value. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_page_fit_t_to_string (scanbotsdk_page_fit_t value, const char **result) |
| Returns the string representation of the given scanbotsdk_page_fit_t value. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_resampling_method_t_to_string (scanbotsdk_resampling_method_t value, const char **result) |
| Returns the string representation of the given scanbotsdk_resampling_method_t value. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_create (scanbotsdk_pdf_attributes_t *attributes, scanbotsdk_page_size_t page_size, scanbotsdk_page_direction_t page_direction, scanbotsdk_page_fit_t page_fit, int dpi, int jpeg_quality, scanbotsdk_resampling_method_t resampling_method, scanbotsdk_parametric_filter_t *binarization_filter, scanbotsdk_pdf_configuration_t **result) |
| Creates a new instance of scanbotsdk_pdf_configuration with given params and stores it in the location specified by the last argument. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_create_with_defaults (scanbotsdk_pdf_configuration_t **result) |
| Creates a new instance of scanbotsdk_pdf_configuration_t with given required params and stores it in the location specified by the last argument. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_free (scanbotsdk_pdf_configuration_t *object) |
| Frees the memory allocated for the instance of scanbotsdk_pdf_configuration_t. If null is passed, the function does nothing. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_get_attributes (scanbotsdk_pdf_configuration_t *self, scanbotsdk_pdf_attributes_t **attributes) |
| Returns value of attributes field of the given object. The returned pointers do NOT own the underlying object, caller must not free them. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_set_attributes (scanbotsdk_pdf_configuration_t *self, scanbotsdk_pdf_attributes_t *attributes) |
| Sets value of attributes field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_get_page_size (scanbotsdk_pdf_configuration_t *self, scanbotsdk_page_size_t *page_size) |
| Returns value of page_size field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_set_page_size (scanbotsdk_pdf_configuration_t *self, scanbotsdk_page_size_t page_size) |
| Sets value of page_size field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_get_page_direction (scanbotsdk_pdf_configuration_t *self, scanbotsdk_page_direction_t *page_direction) |
| Returns value of page_direction field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_set_page_direction (scanbotsdk_pdf_configuration_t *self, scanbotsdk_page_direction_t page_direction) |
| Sets value of page_direction field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_get_page_fit (scanbotsdk_pdf_configuration_t *self, scanbotsdk_page_fit_t *page_fit) |
| Returns value of page_fit field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_set_page_fit (scanbotsdk_pdf_configuration_t *self, scanbotsdk_page_fit_t page_fit) |
| Sets value of page_fit field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_get_dpi (scanbotsdk_pdf_configuration_t *self, int *dpi) |
| Returns value of dpi field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_set_dpi (scanbotsdk_pdf_configuration_t *self, int dpi) |
| Sets value of dpi field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_get_jpeg_quality (scanbotsdk_pdf_configuration_t *self, int *jpeg_quality) |
| Returns value of jpeg_quality field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_set_jpeg_quality (scanbotsdk_pdf_configuration_t *self, int jpeg_quality) |
| Sets value of jpeg_quality field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_get_resampling_method (scanbotsdk_pdf_configuration_t *self, scanbotsdk_resampling_method_t *resampling_method) |
| Returns value of resampling_method field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_set_resampling_method (scanbotsdk_pdf_configuration_t *self, scanbotsdk_resampling_method_t resampling_method) |
| Sets value of resampling_method field of the given object. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_get_binarization_filter (scanbotsdk_pdf_configuration_t *self, scanbotsdk_parametric_filter_t **binarization_filter) |
| Returns value of binarization_filter field of the given object. The returned pointers do NOT own the underlying object, caller must not free them. | |
| SBSDK_API scanbotsdk_error_code_t | scanbotsdk_pdf_configuration_set_binarization_filter (scanbotsdk_pdf_configuration_t *self, scanbotsdk_parametric_filter_t *binarization_filter) |
| Sets value of binarization_filter field of the given object. | |
| typedef enum scanbotsdk_page_direction_t scanbotsdk_page_direction_t |
scanbotsdk_page_direction_t enum
Page direction.
| typedef enum scanbotsdk_page_fit_t scanbotsdk_page_fit_t |
Page fit.
| typedef enum scanbotsdk_page_size_t scanbotsdk_page_size_t |
Page size.
| typedef struct scanbotsdk_pdf_attributes_t scanbotsdk_pdf_attributes_t |
scanbotsdk_pdf_attributes_t class
PDF attributes.
| typedef struct scanbotsdk_pdf_configuration_t scanbotsdk_pdf_configuration_t |
scanbotsdk_pdf_configuration_t class
The parameters pageSize, pageFit, dpi and resamplingMethod interact in a complex way when adding bitmap images (JPEG, PNG, or raw) to the PDF. There are three cases to consider:
pageSize is CUSTOM: in this case dpi is used as the conversion ratio to calculate both the physical page and image sizes in inches from the bitmap dimensions. resamplingMethod is ignored.pageSize is not CUSTOM AND pageFit is NONE: in this case dpi is used as the conversion ratio to calculate only the physical image size in inches from the bitmap dimensions. The image is centered onto the page. resamplingMethod is ignored.pageSize is not CUSTOM AND pageFit is not NONE: in this case the page has a pre-determined physical size and we want to stretch the image to fit the page in one of the ways described by pageFit. The image DPI is automatically calculated for each image from the given physical page size, page fit setting and image dimensions. There are two sub-cases to consider: a. resamplingMethod is NONE OR the calculated DPI is less than or equal to dpi: in this case the image is added to the PDF without resampling, which means that the image rectangle is simply rescaled to fit into the page as specified by pageFit and pageSize. b. resamplingMethod is not NONE AND the calculated DPI is greater than dpi: in this case the bitmap of the image is resampled to match dpi using the selected method before adding it to the PDF. This will result in a bitmap that is smaller than the original image and hence, the resulting PDF will be smaller in size. scanbotsdk_resampling_method_t enum
Resampling method.
scanbotsdk_page_direction_t enum
Page direction.
| Enumerator | |
|---|---|
| SCANBOTSDK_PAGE_DIRECTION_PORTRAIT | Portrait. |
| SCANBOTSDK_PAGE_DIRECTION_LANDSCAPE | Landscape. |
| SCANBOTSDK_PAGE_DIRECTION_AUTO | Decides based on image aspect ratio. |
Page fit.
Page size.
scanbotsdk_resampling_method_t enum
Resampling method.
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_direction_t_to_string | ( | scanbotsdk_page_direction_t | value, |
| const char ** | result ) |
Returns the string representation of the given scanbotsdk_page_direction_t value.
The returned string doesn't need to be freed.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_fit_t_to_string | ( | scanbotsdk_page_fit_t | value, |
| const char ** | result ) |
Returns the string representation of the given scanbotsdk_page_fit_t value.
The returned string doesn't need to be freed.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_size_t_to_string | ( | scanbotsdk_page_size_t | value, |
| const char ** | result ) |
Returns the string representation of the given scanbotsdk_page_size_t value.
The returned string doesn't need to be freed.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_create | ( | const char * | author, |
| const char * | creator, | ||
| const char * | title, | ||
| const char * | subject, | ||
| const char * | keywords, | ||
| scanbotsdk_pdf_attributes_t ** | result ) |
Creates a new instance of scanbotsdk_pdf_attributes with given params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| author | Author. |
Default is "Created with Scanbot SDK" The value must not be null.
| creator | Creator. |
Default is "" The value must not be null.
| title | Title. |
Default is "" The value must not be null.
| subject | Subject. |
Default is "" The value must not be null.
| keywords | Keywords. |
Default is "" The value must not be null.
| result | Pointer to a variable that will store the created instance of scanbotsdk_pdf_attributes_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_create_with_defaults | ( | scanbotsdk_pdf_attributes_t ** | result | ) |
Creates a new instance of scanbotsdk_pdf_attributes_t with given required params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| result | Pointer to a variable that will store the created instance of scanbotsdk_pdf_attributes_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_free | ( | scanbotsdk_pdf_attributes_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_pdf_attributes_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_pdf_attributes_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_get_author | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char ** | author ) |
Returns value of author field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Author.
Default is "Created with Scanbot SDK"
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t |
| author | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_get_creator | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char ** | creator ) |
Returns value of creator field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Creator.
Default is ""
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t |
| creator | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_get_keywords | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char ** | keywords ) |
Returns value of keywords field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Keywords.
Default is ""
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t |
| keywords | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_get_subject | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char ** | subject ) |
Returns value of subject field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Subject.
Default is ""
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t |
| subject | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_get_title | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char ** | title ) |
Returns value of title field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Title.
Default is ""
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t |
| title | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_set_author | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char * | author ) |
Sets value of author field of the given object.
Author.
Default is "Created with Scanbot SDK"
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set |
| author | The value to be set. Must not be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_set_creator | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char * | creator ) |
Sets value of creator field of the given object.
Creator.
Default is ""
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set |
| creator | The value to be set. Must not be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_set_keywords | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char * | keywords ) |
Sets value of keywords field of the given object.
Keywords.
Default is ""
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set |
| keywords | The value to be set. Must not be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_set_subject | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char * | subject ) |
Sets value of subject field of the given object.
Subject.
Default is ""
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set |
| subject | The value to be set. Must not be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_attributes_set_title | ( | scanbotsdk_pdf_attributes_t * | self, |
| const char * | title ) |
Sets value of title field of the given object.
Title.
Default is ""
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set |
| title | The value to be set. Must not be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_create | ( | scanbotsdk_pdf_attributes_t * | attributes, |
| scanbotsdk_page_size_t | page_size, | ||
| scanbotsdk_page_direction_t | page_direction, | ||
| scanbotsdk_page_fit_t | page_fit, | ||
| int | dpi, | ||
| int | jpeg_quality, | ||
| scanbotsdk_resampling_method_t | resampling_method, | ||
| scanbotsdk_parametric_filter_t * | binarization_filter, | ||
| scanbotsdk_pdf_configuration_t ** | result ) |
Creates a new instance of scanbotsdk_pdf_configuration with given params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| attributes | Attributes. The value must not be null. |
| page_size | Physical size of the page. If CUSTOM, the page size will be set as the image size at given dpi. |
Default is A4
| page_direction | Page direction. |
Default is PORTRAIT
| page_fit | How to fit the image into the page. Only used if pageSize is not CUSTOM. The image can either be stretched to fill the page, in one of three ways, or centered on the page without stretching. |
Default is FIT_IN
| dpi | The dpi parameter has two different meanings depending on the value of pageSize and pageFit. If pageSize is CUSTOM or pageFit is NONE, then dpi is the conversion ratio used to convert from units of pixels to physical inches when adding bitmap images (JPEG, PNG, or raw) to the PDF. Otherwise, if resamplingMethod is not NONE, then the image is downscaled if necessary (if the image after being fit to the page has a higher calculated DPI than dpi) to match dpi before adding it to the PDF. Otherwise, the setting is ignored and the calculated image DPI is used instead. |
Default is 72
| jpeg_quality | JPEG quality for images. Applies if an image is added as a cv::Mat and therefore needs to be encoded. Also applies if resamplingMethod not NONE and the image being added needs to be downscaled. Otherwise, when adding JPEG files to the PDF, the files are copied directly into the PDF and not re-encoded, which is many times faster and also preserves the quality of the original. |
Default is 80
| resampling_method | Resampling method. |
Default is NONE
| binarization_filter | Filter to apply to the input image when adding pages with binarization. The value can be null. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_pdf_configuration_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_create_with_defaults | ( | scanbotsdk_pdf_configuration_t ** | result | ) |
Creates a new instance of scanbotsdk_pdf_configuration_t with given required params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| result | Pointer to a variable that will store the created instance of scanbotsdk_pdf_configuration_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_free | ( | scanbotsdk_pdf_configuration_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_pdf_configuration_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_pdf_configuration_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_get_attributes | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_pdf_attributes_t ** | attributes ) |
Returns value of attributes field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Attributes.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t |
| attributes | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_get_binarization_filter | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_parametric_filter_t ** | binarization_filter ) |
Returns value of binarization_filter field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Filter to apply to the input image when adding pages with binarization.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t |
| binarization_filter | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_get_dpi | ( | scanbotsdk_pdf_configuration_t * | self, |
| int * | dpi ) |
Returns value of dpi field of the given object.
The dpi parameter has two different meanings depending on the value of pageSize and pageFit. If pageSize is CUSTOM or pageFit is NONE, then dpi is the conversion ratio used to convert from units of pixels to physical inches when adding bitmap images (JPEG, PNG, or raw) to the PDF. Otherwise, if resamplingMethod is not NONE, then the image is downscaled if necessary (if the image after being fit to the page has a higher calculated DPI than dpi) to match dpi before adding it to the PDF. Otherwise, the setting is ignored and the calculated image DPI is used instead.
Default is 72
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t |
| dpi | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_get_jpeg_quality | ( | scanbotsdk_pdf_configuration_t * | self, |
| int * | jpeg_quality ) |
Returns value of jpeg_quality field of the given object.
JPEG quality for images. Applies if an image is added as a cv::Mat and therefore needs to be encoded. Also applies if resamplingMethod not NONE and the image being added needs to be downscaled. Otherwise, when adding JPEG files to the PDF, the files are copied directly into the PDF and not re-encoded, which is many times faster and also preserves the quality of the original.
Default is 80
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t |
| jpeg_quality | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_get_page_direction | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_page_direction_t * | page_direction ) |
Returns value of page_direction field of the given object.
Page direction.
Default is PORTRAIT
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t |
| page_direction | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_get_page_fit | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_page_fit_t * | page_fit ) |
Returns value of page_fit field of the given object.
How to fit the image into the page. Only used if pageSize is not CUSTOM. The image can either be stretched to fill the page, in one of three ways, or centered on the page without stretching.
Default is FIT_IN
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t |
| page_fit | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_get_page_size | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_page_size_t * | page_size ) |
Returns value of page_size field of the given object.
Physical size of the page. If CUSTOM, the page size will be set as the image size at given dpi.
Default is A4
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t |
| page_size | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_get_resampling_method | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_resampling_method_t * | resampling_method ) |
Returns value of resampling_method field of the given object.
Resampling method.
Default is NONE
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t |
| resampling_method | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_set_attributes | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_pdf_attributes_t * | attributes ) |
Sets value of attributes field of the given object.
Attributes.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set |
| attributes | The value to be set. Must not be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_set_binarization_filter | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_parametric_filter_t * | binarization_filter ) |
Sets value of binarization_filter field of the given object.
Filter to apply to the input image when adding pages with binarization.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set |
| binarization_filter | The value to be set. Can be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_set_dpi | ( | scanbotsdk_pdf_configuration_t * | self, |
| int | dpi ) |
Sets value of dpi field of the given object.
The dpi parameter has two different meanings depending on the value of pageSize and pageFit. If pageSize is CUSTOM or pageFit is NONE, then dpi is the conversion ratio used to convert from units of pixels to physical inches when adding bitmap images (JPEG, PNG, or raw) to the PDF. Otherwise, if resamplingMethod is not NONE, then the image is downscaled if necessary (if the image after being fit to the page has a higher calculated DPI than dpi) to match dpi before adding it to the PDF. Otherwise, the setting is ignored and the calculated image DPI is used instead.
Default is 72
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set |
| dpi | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_set_jpeg_quality | ( | scanbotsdk_pdf_configuration_t * | self, |
| int | jpeg_quality ) |
Sets value of jpeg_quality field of the given object.
JPEG quality for images. Applies if an image is added as a cv::Mat and therefore needs to be encoded. Also applies if resamplingMethod not NONE and the image being added needs to be downscaled. Otherwise, when adding JPEG files to the PDF, the files are copied directly into the PDF and not re-encoded, which is many times faster and also preserves the quality of the original.
Default is 80
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set |
| jpeg_quality | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_set_page_direction | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_page_direction_t | page_direction ) |
Sets value of page_direction field of the given object.
Page direction.
Default is PORTRAIT
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set |
| page_direction | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_set_page_fit | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_page_fit_t | page_fit ) |
Sets value of page_fit field of the given object.
How to fit the image into the page. Only used if pageSize is not CUSTOM. The image can either be stretched to fill the page, in one of three ways, or centered on the page without stretching.
Default is FIT_IN
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set |
| page_fit | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_set_page_size | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_page_size_t | page_size ) |
Sets value of page_size field of the given object.
Physical size of the page. If CUSTOM, the page size will be set as the image size at given dpi.
Default is A4
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set |
| page_size | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_pdf_configuration_set_resampling_method | ( | scanbotsdk_pdf_configuration_t * | self, |
| scanbotsdk_resampling_method_t | resampling_method ) |
Sets value of resampling_method field of the given object.
Resampling method.
Default is NONE
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set |
| resampling_method | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_resampling_method_t_to_string | ( | scanbotsdk_resampling_method_t | value, |
| const char ** | result ) |
Returns the string representation of the given scanbotsdk_resampling_method_t value.
The returned string doesn't need to be freed.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |