I have an mistake with the width of pdf file after loading with GFLC_FILE_INFORMATION getFromFile (GFL sdk/C++).
When I load this pdf file from XnView the with and the height is ok.
but when I load from GFL sdk the with is not the same that XnView.
There are 29 pages so 29 images.
First page information (from acrobat reader):
240*240 mm
the other pages:
480*240mm
it' possible to relead GFLC_FILE_INFORMATION for each page?
I use the method setImageWanted(x) to save each page to jpg file.
Code: Select all
GFLC_BITMAP bitmap;
GFLC_LOAD_PARAMS load_option;
GFLC_FILE_INFORMATION file_info;
GFLC_FORMAT format;
GFLC_SAVE_PARAMS save_option;
GFL_ERROR error;
format.findByFilename(filenameTmp);
GFL_ERROR errorInfo;
errorInfo=file_info.getFromFile(filenameTmp);
if ( errorInfo != GFL_NO_ERROR )
return ERROR_RETURN;
load_option.setImageWanted(0);
load_option.setFormat(format);
load_option.setEpsDpi(250);
GFL_INT32 height= file_info.getHeight();
GFL_INT32 width= file_info.getWidth();
for(i=0;i<file_info.getNumberOfImages();i++){
load_option.setImageWanted(i);
height= file_info.getHeight();
width= file_info.getWidth();
error = bitmap.loadFromFile( filenameTmp,load_option,file_info );
if ( error ){
DisplayError( filenameTmp, error );
break;
}else{
save_option.setFlags(GFL_SAVE_REPLACE_EXTENSION);
save_option.setFormat(output_index);
save_option.setProgressive(GFL_TRUE);
save_option.setQuality(quality);
sprintf_s(destImg,256,destImgNameTpl,quality,i);
sprintf_s(buffer,lengTab2,destImgTemplate,this->_dirOutput,destImg);
if(fexists(buffer)){
remove(buffer);
}
error = bitmap.saveIntoFile( buffer, save_option );
if ( error ){
DisplayError( buffer, error );
break;
}
bitmap.clear();
this->AddImgInfo(destImg,this->_dirOutput,this->_nbImgGen);
this->_nbImgGen++;
}
}
Could you help me ?
Thanks.