ImageGear for C and C++ on Windows v19.10 - Updated
IG_REC_PDF_page_create
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > PDF Output Functions > IG_REC_PDF_page_create

Creates a new page in the given PDF document and populates it with recognized text and image.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_PDF_page_create(
   HIG_REC_IMAGE hImage,
   HMIGEAR hPDFDoc,
   LPAT_REC_PDF_PAGE_OPTIONS lpOptions
);

Arguments:

Name Type Description
hImage HIG_REC_IMAGE Handle of the recognition image.
hPDFDoc HMIGEAR Given PDF document.
lpOptions LPAT_REC_PDF_PAGE_OPTIONS Page options. Pass NULL for lpOptions to use default options, which creates a PDF page containing the recognized image along with hidden text elements suitable for searching, highlighting, selection, copying and pasting, etc.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

See IG_REC_image_import.

Example:

 
Copy Code
AT_ERRCOUNT ErrCount = 0;
HIGEAR higImage = 0;
HIG_REC_IMAGE higRecImage = 0;
HMIGEAR hPDFDoc = 0;
AT_REC_PDF_PAGE_OPTIONS Options;

memset(&Options, 0, sizeof(Options));
Options.VisibleImage = TRUE;

ErrCount = IG_REC_primary_reduction_mode_set(IG_REC_IMG_CONVERSION_AUTO);

ErrCount += IG_load_file("Image.tif", &higImage); 
ErrCount += IG_REC_image_import(higImage, &higRecImage);
ErrCount += IG_REC_image_recognize(higRecImage);

ErrCount += IG_PDF_initialize(NULL);
ErrCount += IG_mpi_create(&hPDFDoc, 0);
ErrCount += IG_PDF_doc_create(hPDFDoc);

ErrCount += IG_REC_PDF_page_create(higRecImage, hPDFDoc, &Options);

ErrCount += IG_REC_image_delete(higRecImage);
ErrCount += IG_image_delete(higImage);

if(ErrCount != 0)
    ErrCount += IG_mpi_file_save("Image.pdf", hPDFDoc, 0, 0, 1, IG_FORMAT_PDF, IG_MPI_SAVE_OVERWRITE);
ErrCount += IG_mpi_delete(hPDFDoc);
ErrCount += IG_PDF_terminate();

See Also

HIG_REC_IMAGE