GFLC_FILE_INFORMATION getFromFile the with is bag

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, xnview

Post Reply
StephSBS
Posts: 8
Joined: Mon Jan 24, 2011 3:45 pm

GFLC_FILE_INFORMATION getFromFile the with is bag

Post by StephSBS » Mon Jan 24, 2011 4:42 pm

Hi,

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++;
		}
	}
it's a problem for GFL ?

Could you help me ?

Thanks.

User avatar
xnview
Author of XnView
Posts: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: GFLC_FILE_INFORMATION getFromFile the with is bag

Post by xnview » Tue Jan 25, 2011 8:57 am

With which version? Could you post the PDF?
Pierre.

StephSBS
Posts: 8
Joined: Mon Jan 24, 2011 3:45 pm

Re: GFLC_FILE_INFORMATION getFromFile the with is bag

Post by StephSBS » Tue Jan 25, 2011 9:04 am

Hi,
I use the GFL SDK 3.11 for windows
Y cant' post the PDF because is too big.
Could you send me your email in private message?

By

Post Reply