PHP code example of medlib / cover

1. Go to this page and download the library: Download medlib/cover 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/ */

    

medlib / cover example snippets



use Medlib\BookCover;

$cover = new BookCover();
$cover->setTitle('Manual of scientific illustration')
	->setSubtitle('with special chapters on photography, cover design and book manufacturing')
	->setCreators('Charles S. Papp')
	->setEdition('3rd enl. ed.')
	->setPublisher('American Visual Aid Books')
	->setDatePublished('1976')
	->randomizeBackgroundColor()
	->save('manual_of_scientific.png');

// Autoloaded Service Providers
'providers' => [
    ...
    Medlib\BookCover\Services\CoverServiceProvider::class,
],

// Class Aliases
'aliases' => [
    ...
    'Cover'   => Medlib\BookCover\Facades\Cover::class,
],

header('Content-Type: image/png');
echo $cover->getImageBlob();
ou
echo $cover->getImageBase64();