PHP code example of v-technologies / transformist

1. Go to this page and download the library: Download v-technologies/transformist library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

v-technologies / transformist example snippets




$Transformist = new Transformist( );
$Transformist->setup(
	'/path/to/directory',
	'application/msword',
	'application/pdf'
);

if ( $Transformist->run( )) {
	// You're good to go !
}




// Output directory

$Transformist->setup(
	array( '/path/to/input/directory' => '/path/to/output/directory' ),
	'application/msword',
	'application/pdf'
);


// Conversion of a particular file

$Transformist->setup(
	'/path/to/directory',
	'file.doc',
	'application/pdf'
);


// All files matching a pattern

$Transformist->setup(
	'/path/to/directory',
	'*.doc',
	'application/pdf'
);


// Multiple conversions

$Transformist->setup(
	'/path/to/directory',
	array(
		'*.doc'     => 'application/pdf',
		'image/jpg' => 'image/png'
	)
);




$conversions = $Transformist->availableConversions( );




array(
	'image/jpeg' => array(
		'image/png'
	),
	'image/png' => array(
		'image/tiff'
	)
);




$results = $Transformist->testConverters( );

// Or statically:

$results = Transformist::testConverters( );




array(
	'Transformist_Converter_Office_Pdf' => true,
	'Transformist_Converter_Office_Png' => 'An external library is missing!',
	'Transformist_Converter_Office_Tiff' => true
);