Page 1 of 1

isFileFormat syntax

Posted: Wed Jul 08, 2015 10:47 pm
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
}

Re: isFileFormat syntax

Posted: Thu Jul 09, 2015 9:51 am
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