isFileFormat syntax

Post Reply
richapollo
Newbie
Posts: 2
Joined: Thu Oct 11, 2012 7:38 pm

isFileFormat syntax

Post by richapollo »

Can someone clue me in on the syntax to use with the isFileFormat method? I'm trying to construct an if...else that only looks at PDFs.

if the file is a PDF {
grab some information about that file
}
loicaigon
Member
Posts: 147
Joined: Wed Jul 10, 2013 10:22 am

Re: isFileFormat syntax

Post by loicaigon »

This method belongs to the FileStatistics Class so you may need to operate like this :

Code: Select all

	var fs = new FileStatistics( job.getPath() );
	var isPDF = fs.isFileFormat("PDF");
	
	if ( isPDF ){
		//Cool it's PDF
	}
	else {
		//Oh no a dummy format again !
	}
Loic
Post Reply