Scanbot SDK
Loading...
Searching...
No Matches
Scanbot C SDK Pdf generation

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
 

Enumerations

enum  scanbotsdk_page_size_t {
  SCANBOTSDK_PAGE_SIZE_LETTER = 0 ,
  SCANBOTSDK_PAGE_SIZE_LEGAL = 1 ,
  SCANBOTSDK_PAGE_SIZE_A3 = 2 ,
  SCANBOTSDK_PAGE_SIZE_A4 = 3 ,
  SCANBOTSDK_PAGE_SIZE_A5 = 4 ,
  SCANBOTSDK_PAGE_SIZE_B4 = 5 ,
  SCANBOTSDK_PAGE_SIZE_B5 = 6 ,
  SCANBOTSDK_PAGE_SIZE_EXECUTIVE = 7 ,
  SCANBOTSDK_PAGE_SIZE_US4x6 = 8 ,
  SCANBOTSDK_PAGE_SIZE_US4x8 = 9 ,
  SCANBOTSDK_PAGE_SIZE_US5x7 = 10 ,
  SCANBOTSDK_PAGE_SIZE_COMM10 = 11 ,
  SCANBOTSDK_PAGE_SIZE_CUSTOM = 12
}
 scanbotsdk_page_size_t enum More...
 
enum  scanbotsdk_page_direction_t {
  SCANBOTSDK_PAGE_DIRECTION_PORTRAIT = 0 ,
  SCANBOTSDK_PAGE_DIRECTION_LANDSCAPE = 1 ,
  SCANBOTSDK_PAGE_DIRECTION_AUTO = 2
}
 scanbotsdk_page_direction_t enum More...
 
enum  scanbotsdk_page_fit_t {
  SCANBOTSDK_PAGE_FIT_FIT_IN = 0 ,
  SCANBOTSDK_PAGE_FIT_FILL_IN = 1 ,
  SCANBOTSDK_PAGE_FIT_STRETCH = 2 ,
  SCANBOTSDK_PAGE_FIT_NONE = 3
}
 scanbotsdk_page_fit_t enum More...
 
enum  scanbotsdk_resampling_method_t {
  SCANBOTSDK_RESAMPLING_METHOD_NONE = 0 ,
  SCANBOTSDK_RESAMPLING_METHOD_NEAREST = 1 ,
  SCANBOTSDK_RESAMPLING_METHOD_LINEAR = 2 ,
  SCANBOTSDK_RESAMPLING_METHOD_CUBIC = 3 ,
  SCANBOTSDK_RESAMPLING_METHOD_LANCZOS4 = 4 ,
  SCANBOTSDK_RESAMPLING_METHOD_AREA = 5
}
 scanbotsdk_resampling_method_t enum More...
 

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.
 

Detailed Description

Typedef Documentation

◆ scanbotsdk_page_direction_t

◆ scanbotsdk_page_fit_t

◆ scanbotsdk_page_size_t

◆ scanbotsdk_pdf_attributes_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:

  1. 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.
  2. 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.
  3. 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

Enumeration Type Documentation

◆ scanbotsdk_page_direction_t

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.

◆ scanbotsdk_page_fit_t

scanbotsdk_page_fit_t enum

Page fit.

Enumerator
SCANBOTSDK_PAGE_FIT_FIT_IN 

Fit image into page. May leave white borders if the aspect ratio of the image and the page don't match. Preserves image aspect ratio.

SCANBOTSDK_PAGE_FIT_FILL_IN 

Fill page with image. Will crop the image if the aspect ratio of the image and the page don't match. Preserves image aspect ratio.

SCANBOTSDK_PAGE_FIT_STRETCH 

Stretch image to fill the entire page. The image will never be cropped and there will never be any white borders left, but the image aspect ratio will be made to match the page aspect ratio.

SCANBOTSDK_PAGE_FIT_NONE 

No resizing, centers the image on the page. The physical size of the image will be determined by the dpi parameter.

◆ scanbotsdk_page_size_t

scanbotsdk_page_size_t enum

Page size.

Enumerator
SCANBOTSDK_PAGE_SIZE_LETTER 

8.5 x 11 (inches) 612 x 792 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_LEGAL 

8.5 x 14 (inches) 612 x 1008 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_A3 

297 x 420 (mm) 841.89 x 1199.551 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_A4 

210 x 297 (mm) 595.276 x 841.89 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_A5 

148 x 210 (mm) 419.528 x 595.276 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_B4 

250 x 353 (mm) 708.661 x 1000.63 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_B5 

176 x 250 (mm) 498.898 x 708.661 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_EXECUTIVE 

7.25 x 10.5 (inches) 522 x 756 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_US4x6 

4 x 6 (inches) 288 x 432 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_US4x8 

4 x 8 (inches) 288 x 576 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_US5x7 

5 x 7 (inches) 360 x 504 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_COMM10 

4.125 x 9.5 (inches) 297 x 684 (pixels) at 72 DPI.

SCANBOTSDK_PAGE_SIZE_CUSTOM 

Physical size will be calculated from the image dimensions and the dpi parameter.

◆ scanbotsdk_resampling_method_t

scanbotsdk_resampling_method_t enum

Resampling method.

Enumerator
SCANBOTSDK_RESAMPLING_METHOD_NONE 

Always geometrically rescale the image to fit the page if necessary. Fast.

Otherwise, downscale the bitmap to match the dpi setting via the selected method before adding it to the PDF if the calculated image DPI after stretching is greater than dpi. Slower.

SCANBOTSDK_RESAMPLING_METHOD_NEAREST 

Nearest-neighbor interpolation. Lowest quality. Produces blocky images, especially when upsampling.

SCANBOTSDK_RESAMPLING_METHOD_LINEAR 

Bi-linear interpolation. Better quality than nearest-neighbor, slower. Okay when the target size is not too different from the source size.

SCANBOTSDK_RESAMPLING_METHOD_CUBIC 

Bi-cubic interpolation. Better quality than bi-linear, slower. Produces high-quality results in a larger range than that of bi-linear.

SCANBOTSDK_RESAMPLING_METHOD_LANCZOS4 

Lanczos (Sinc) interpolation over 8x8 neighborhood. Produces very high quality results, but slower than bi-cubic. Retains sharp edges like those of text when downsampling.

SCANBOTSDK_RESAMPLING_METHOD_AREA 

Accurate, produces moire-free results, but tends to produce blurrier images. When upsampling, it is similar to nearest-neighbor.

Function Documentation

◆ scanbotsdk_page_direction_t_to_string()

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.

Parameters
valueThe value to be converted to string.
resultPointer to a variable that will store the string representation of the value.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_page_fit_t_to_string()

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.

Parameters
valueThe value to be converted to string.
resultPointer to a variable that will store the string representation of the value.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_page_size_t_to_string()

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.

Parameters
valueThe value to be converted to string.
resultPointer to a variable that will store the string representation of the value.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_attributes_create()

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.

Parameters
authorAuthor.

Default is "Created with Scanbot SDK" The value must not be null.

Parameters
creatorCreator.

Default is "" The value must not be null.

Parameters
titleTitle.

Default is "" The value must not be null.

Parameters
subjectSubject.

Default is "" The value must not be null.

Parameters
keywordsKeywords.

Default is "" The value must not be null.

Parameters
resultPointer to a variable that will store the created instance of scanbotsdk_pdf_attributes_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_attributes_create_with_defaults()

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.

Parameters
resultPointer to a variable that will store the created instance of scanbotsdk_pdf_attributes_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_attributes_free()

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.

Parameters
objectPointer to the instance of scanbotsdk_pdf_attributes_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_attributes_get_author()

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"

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t
authorPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_attributes_get_creator()

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 ""

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t
creatorPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_attributes_get_keywords()

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 ""

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t
keywordsPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_attributes_get_subject()

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 ""

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t
subjectPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_attributes_get_title()

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 ""

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t
titlePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_attributes_set_author()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set
authorThe value to be set. Must not be null.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_attributes_set_creator()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set
creatorThe value to be set. Must not be null.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_attributes_set_keywords()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set
keywordsThe value to be set. Must not be null.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_attributes_set_subject()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set
subjectThe value to be set. Must not be null.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_attributes_set_title()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_attributes_t, the field of which will be set
titleThe value to be set. Must not be null.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_create()

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.

Parameters
attributesAttributes. The value must not be null.
page_sizePhysical size of the page. If CUSTOM, the page size will be set as the image size at given dpi.

Default is A4

Parameters
page_directionPage direction.

Default is PORTRAIT

Parameters
page_fitHow 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

Parameters
dpiThe 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

Parameters
jpeg_qualityJPEG 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

Parameters
resampling_methodResampling method.

Default is NONE

Parameters
binarization_filterFilter to apply to the input image when adding pages with binarization. The value can be null.
resultPointer to a variable that will store the created instance of scanbotsdk_pdf_configuration_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_create_with_defaults()

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.

Parameters
resultPointer to a variable that will store the created instance of scanbotsdk_pdf_configuration_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_free()

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.

Parameters
objectPointer to the instance of scanbotsdk_pdf_configuration_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_get_attributes()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t
attributesPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_configuration_get_binarization_filter()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t
binarization_filterPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_configuration_get_dpi()

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

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t
dpiPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_configuration_get_jpeg_quality()

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

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t
jpeg_qualityPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_configuration_get_page_direction()

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

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t
page_directionPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_configuration_get_page_fit()

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

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t
page_fitPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_configuration_get_page_size()

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

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t
page_sizePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_configuration_get_resampling_method()

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

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t
resampling_methodPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_pdf_configuration_set_attributes()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set
attributesThe value to be set. Must not be null.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_set_binarization_filter()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set
binarization_filterThe value to be set. Can be null.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_set_dpi()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set
dpiThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_set_jpeg_quality()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set
jpeg_qualityThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_set_page_direction()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set
page_directionThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_set_page_fit()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set
page_fitThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_set_page_size()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set
page_sizeThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_pdf_configuration_set_resampling_method()

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.

Parameters
selfPointer to the instance of scanbotsdk_pdf_configuration_t, the field of which will be set
resampling_methodThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_resampling_method_t_to_string()

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.

Parameters
valueThe value to be converted to string.
resultPointer to a variable that will store the string representation of the value.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.