PHP code example of gears / pdf

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

    

gears / pdf example snippets


$pdf = Gears\Pdf::convert('/path/to/document.docx');

Gears\Pdf::convert('/path/to/document.docx', '/path/to/document.pdf');

$pdf = Gears\Pdf::convert('/path/to/document.html');

$document = new Gears\Pdf('/path/to/document.docx');
$document->converter = function()
{
	return new Gears\Pdf\Docx\Converter\Unoconv();
};
$document->save('/path/to/document.pdf');

$document->setValue('FOO', 'BAR');

$document->cloneBlock('BLOCK_TO_CLONE', 3);

$document->replaceBlock('BLOCK_TO_REPLACE', '<docx><xml></xml></docx>');

$document->deleteBlock('BLOCK_TO_DELETE');

$document->cloneRow('ROW_TO_CLONE', 5);