Here is the code:
imageData->ImageOptions.PageNumber = 1;
uFlags = FILEINFO_TOTALPAGES;
nRet = L_FileInfo( imageData->Source.szFilename, &(imageData->Source.FileInfo), uFlags, &imageData->ImageOptions);
if (nRet!=SUCCESS) {
return(-1);
}
else {
imageData->iRealPages = imageData->Source.FileInfo.TotalPages;
}
for (imageData->iCurrentConvImage = 1; imageData->iCurrentConvImage <= imageData->iRealPages; imageData->iCurrentConvImage++) {
L_GetDefaultLoadFileOption( &(imageData->ImageOptions), sizeof(imageData->ImageOptions) );
L_GetDefaultSaveFileOption( &(imageData->ImageOptionsSave), sizeof(imageData->ImageOptionsSave) );
imageData->ImageOptions.PageNumber = imageData->iCurrentConvImage;
imageData->Source.FileInfo.PageNumber = imageData->iCurrentConvImage;
nRet = L_LoadBitmap( imageData->Source.szFilename, &(imageData->Source.hBitmap), 1, ORDER_BGR, &imageData->ImageOptions, &imageData->Source.FileInfo);
if (nRet!=SUCCESS) {
return(-1);
}
imageData->ImageOptionsSave.Passes = imageData->ImageOptions.Passes;
imageData->ImageOptionsSave.GlobalLoop = imageData->ImageOptions.GlobalLoop;
imageData->ImageOptionsSave.PageNumber = imageData->iCurrentConvImage;
imageData->ImageOptionsSave.Flags = ESO_NOSUBFILETYPE|ESO_REPLACEPAGE;
nRet = L_SaveBitmap( imageData->Target.szFilename, &(imageData->Source.hBitmap), imageData->iImageType, imageData->iBitsPP, imageData->iQFactor, &imageData->ImageOptionsSave );
if (nRet != SUCCESS) {
return(-1);
}
L_FreeBitmap( &(imageData->Source.hBitmap) );
}
Images attached... as you notice, the first image is only half-page tall, and so is the rest.
Thanks!!!