PHP code example of jumbaeric / docverter

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

    

jumbaeric / docverter example snippets


use DocVerter\RTF2PDFConverter;

$rtfContent = file_get_contents('example.rtf');
$pdfFilePath = 'output.pdf';

$converter = new RTF2PDFConverter($rtfContent, $pdfFilePath);
$converter->convert();

use DocVerter\PDF2RTFConverter;

$pdfFilePath = 'example.pdf';
$rtfFilePath = 'output.rtf';

$converter = new PDF2RTFConverter($pdfFilePath, $rtfFilePath);
$converter->convert();


use DocVerter\HTML2PDFConverter;

$htmlContent = file_get_contents('example.html');
$pdfFilePath = 'output.pdf';

$converter = new HTML2PDFConverter($htmlContent, $pdfFilePath);
$converter->convert();

use DocVerter\PDF2HTMLConverter;

$pdfFilePath = 'example.pdf';
$htmlFilePath = 'output.html';

$converter = new PDF2HTMLConverter($pdfFilePath, $htmlFilePath);
$converter->convert();


use DocVerter\Text2PDFConverter;

$textContent = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
$pdfFilePath = 'output.pdf';

$converter = new Text2PDFConverter($textContent, $pdfFilePath);
$converter->convert();

use DocVerter\Image2PDFConverter;

$imagePath = 'example.jpg';
$pdfFilePath = 'output.pdf';

$converter = new Image2PDFConverter($imagePath, $pdfFilePath);
$converter->convert();

use DocVerter\PDF2ImageConverter;

$pdfFilePath = 'example.pdf';
$imageFolderPath = 'output/';

$converter = new PDF2ImageConverter($pdfFilePath, $imageFolderPath);
$converter->convert();

use DocVerter\Markdown2PDFConverter;

$markdownContent = file_get_contents('example.md');
$pdfFilePath = 'output.pdf';

$converter = new Markdown2PDFConverter($markdownContent, $pdfFilePath);
$converter->convert();

use DocVerter\PDF2MarkdownConverter;

$pdfFilePath = 'example.pdf';
$markdownFilePath = 'output.md';

$converter = new PDF2MarkdownConverter($pdfFilePath, $markdownFilePath);
$converter->convert();

use DocVerter\Excel2PDFConverter;

$excelFilePath = 'example.xlsx';
$pdfFilePath = 'output.pdf';

$converter = new Excel2PDFConverter($excelFilePath, $pdfFilePath);
$converter->convert();

use DocVerter\PDF2ExcelConverter;

$pdfFilePath = 'example.pdf';
$excelFilePath = 'output.xlsx';

$converter = new PDF2ExcelConverter($pdfFilePath, $excelFilePath);
$converter->convert();

use DocVerter\Word2PDFConverter;

$wordFilePath = 'example.docx';
$pdfFilePath = 'output.pdf';

$converter = new Word2PDFConverter($wordFilePath, $pdfFilePath);
$converter->convert();

use DocVerter\PDF2WordConverter;

$pdfFilePath = 'example.pdf';
$wordFilePath = 'output.docx';

$converter = new PDF2WordConverter($pdfFilePath, $wordFilePath);
$converter->convert();
 php
use DocVerter\PDF2TextConverter;

$pdfFilePath = 'example.pdf';
$textFilePath = 'output.txt';

$converter = new PDF2TextConverter($pdfFilePath, $textFilePath);
$converter->convert();