ImageGear for C and C++ on Linux v18.10 - Updated
IG_mpi_page_delete
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Multi Page Image Functions > IG_mpi_page_delete

This function deletes the nCount number of elements starting with the nStartPage index from the page array of the multi-page image.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_mpi_page_delete( 
        [IN] HMIGEAR hMIGear, 
        [IN] UINT nStartPage, 
        [IN] UINT nCount
);

Arguments:

Name Type Description
hMIGear HMIGEAR The handle to the allocated multi-page image.
nStartPage UINT The first page to delete.
nCount UINT The total number of pages to delete.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Example:

 
Copy Code
HMIGEAR hMIGear;     /* handle to multi-page image */
AT_ERRCOUNT nErrCount = IGE_SUCCESS; /* will hold returned error count */
UINT nPageCount = 0; /* number of pages that should get from multi-page image */
UINT i;
HIGEAR hIGear;         /* handle of an image */
 ...
/* initialize of multi-page image and assign it with external file */
nErrCount = IG_mpi_page_count_get( hMIGear, &nPageCount );
/* delete all pages and shrink array to entries pages */
nErrCount = IG_mpi_page_delete( hMIGear, 0, nPageCount );

Remarks:

If the deleted pages are valid images, they are deleted with the function IG_image_delete(). Pages with higher indexes are shifted by removing the number and number of pages is decreased so that all pages are numbered from 0 to nPageCount-1.

For multi-page vector documents, this function DELETES a page in the underneath vector document data. The following formats are currently supported by this API: PDF, PostScript.