PHP Classes

How to Use PHP File Converter to Convert Documents Between Formats like PDF, HTML Text, Image, Markdown, Excel, Word and RTF Using the Package Docverter: Convert files between different document formats

Recommend this page to a friend!
  Info   View files Example   View files View files (17)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-05-31 (4 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 1 This week: 1All time: 11,349 This week: 56Up
Version License PHP version Categories
docverter 1.0.0GNU General Publi...5PHP 5, Files and Folders, Libraries
Description 

Author

This package can convert files between different document formats.

It provides several classes that can take files from one document format to another document format.

Currently, it can convert document files between:

- Microsoft Excel to PDF

- HTML to PDF

- Image to PDF

- Markdown to PDF

- PDF to Microsoft Excel

- PDF to HTML

- PDF to Image

- PDF to Markdown

- PDF to RTF

- PDF to Text

- PDF Word

- RTF to PDF

- Text to PDF

- Microsoft Word to PDF

Picture of Eric Jumba
  Performance   Level  
Name: Eric Jumba <contact>
Classes: 5 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

Recommendations

Recommendation for a PHP class to convert rtf to pdf
I need a php open-source library that can convert PDF to RTF

Example

<?php
use RTF2PDF\RTF2PDFConverter;

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

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


Details

Docverter

Docverter is a versatile PHP package for document conversion between various formats. Whether you need to convert RTF, PDF, HTML, Text, Image, Markdown, Excel, or Word documents, this package provides seamless functionality using industry-standard libraries.

Installation

You can install the package via Composer:

composer require jumbaeric/docverter

Usage

RTF to PDF Conversion

use DocVerter\RTF2PDFConverter;

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

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

PDF to RTF Conversion

use DocVerter\PDF2RTFConverter;

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

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

HTML to PDF Conversion


use DocVerter\HTML2PDFConverter;

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

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

PDF to HTML Conversion

use DocVerter\PDF2HTMLConverter;

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

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

Text to PDF Conversion

use DocVerter\Text2PDFConverter;

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

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

PDF to Text Conversion

use DocVerter\PDF2TextConverter;

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

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

Image to PDF Conversion

use DocVerter\Image2PDFConverter;

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

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

PDF to Image Conversion

use DocVerter\PDF2ImageConverter;

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

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

Markdown to PDF Conversion

use DocVerter\Markdown2PDFConverter;

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

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

PDF to Markdown Conversion

use DocVerter\PDF2MarkdownConverter;

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

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

Excel to PDF Conversion

use DocVerter\Excel2PDFConverter;

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

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

PDF to Excel Conversion

use DocVerter\PDF2ExcelConverter;

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

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

Word to PDF Conversion

use DocVerter\Word2PDFConverter;

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

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

PDF to Word Conversion

use DocVerter\PDF2WordConverter;

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

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

Features

  • Versatile Conversion: Convert between RTF, PDF, and HTML formats seamlessly.
  • Powered by Industry-standard Libraries: Utilizes Dompdf, PHPRtfLite, PhpSpreadsheet, PhpWord, and other libraries for reliable conversion.
  • Simple Integration: Easily integrate into your PHP projects with Composer.
  • Customizable Options: Easily customize PDF generation options as needed.

Keywords and Tags

  • Docverter
  • PHP RTF to PDF
  • Rich Text Format to PDF
  • HTML to PDF
  • PDF to HTML
  • Dompdf
  • PHPRtfLite
  • RTF Converter
  • HTML Converter
  • PDF Generation
  • PHP Package
  • Composer Package
  • Document Conversion

Credits

<a href="https://github.com/dompdf/dompdf">Dompdf</a> - PDF generation library. <a href="https://github.com/phprtflite/phprtflite">PHPRtfLite</a> - RTF generation library. <a target="_new" rel="noreferrer" href="https://github.com/PHPOffice/phpspreadsheet">PhpSpreadsheet</a> - Excel generation library. <a target="_new" rel="noreferrer" href="https://github.com/PHPOffice/PHPWord">PhpWord</a> - Word generation library.


  Files folder image Files  
File Role Description
Files folder imageexamples (1 file)
Files folder imagesrc (14 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file example.php Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file Excel2PDFConverter.php Class Class source
  Plain text file HTML2PDFConverter.php Class Class source
  Plain text file Image2PDFConverter.php Class Class source
  Plain text file Markdown2PDFConverter.php Class Class source
  Plain text file PDF2ExcelConverter.php Class Class source
  Plain text file PDF2HTMLConverter.php Class Class source
  Plain text file PDF2ImageConverter.php Class Class source
  Plain text file PDF2MarkdownConverter.php Class Class source
  Plain text file PDF2RTFConverter.php Class Class source
  Plain text file PDF2TextConverter.php Class Class source
  Plain text file PDF2WordConverter.php Class Class source
  Plain text file RTF2PDFConverter.php Class Class source
  Plain text file Text2PDFConverter.php Class Class source
  Plain text file Word2PDFConverter.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:1
This week:1
All time:11,349
This week:56Up