PHP Classes

How to Convert File to PDF, HTML, RTF, Text, Markdown, Excel or Word Using a Laravel Facade Provided by the Package Laravel Docverter: Laravel facade and service to convert documents

Recommend this page to a friend!
  Info   View files Example   View files View files (21)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-05-31 (7 days ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
laravel_docverter 1.0GNU General Publi...5PHP 5, Files and Folders, Libraries
Description 

Author

This package provides a Laravel facade and service to convert documents.

It provides a Laravel service class that accesses document file format conversion classes.

The package provides a facade to access the document file format conversion Laravel service.

Currently, it can convert the document files RTF, PDF, HTML, text, image, Markdown, Microsoft Excel, or Microsoft Word.

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

Winner: 1x

Example

<?php
use RTF2PDF\RTF2PDFConverter;

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

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


Details

Docverter

Laravel Docverter is a versatile PHP Laravel 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.

Requirements

PHP Version : 7.4 + Laravel Version: 8 +

Installation

You can install the package via Composer:

composer require jumbaeric/laraveldocverter

Usage

use DocVerter\Facades\DocverterFacade;

// Convert RTF to PDF
DocverterFacade::convert('rtf2pdf', 'example.rtf', 'output.pdf');

// Convert PDF to RTF
DocverterFacade::convert('pdf2rtf', 'example.pdf', 'output.rtf');

// Convert HTML to PDF
DocverterFacade::convert('html2pdf', 'example.html', 'output.pdf');

// Convert PDF to HTML
DocverterFacade::convert('pdf2html', 'example.pdf', 'output.html');

// Convert Text to PDF
DocverterFacade::convert('text2pdf', 'example.txt', 'output.pdf');

// Convert PDF to Text
DocverterFacade::convert('pdf2text', 'example.pdf', 'output.txt');

// Convert Image to PDF
DocverterFacade::convert('image2pdf', 'example.jpg', 'output.pdf');

// Convert PDF to Image
DocverterFacade::convert('pdf2image', 'example.pdf', 'output.jpg');

// Convert Markdown to PDF
DocverterFacade::convert('markdown2pdf', 'example.md', 'output.pdf');

// Convert PDF to Markdown
DocverterFacade::convert('pdf2markdown', 'example.pdf', 'output.md');

// Convert Excel to PDF
DocverterFacade::convert('excel2pdf', 'example.xlsx', 'output.pdf');

// Convert PDF to Excel
DocverterFacade::convert('pdf2excel', 'example.pdf', 'output.xlsx');

// Convert Word to PDF
DocverterFacade::convert('word2pdf', 'example.docx', 'output.pdf');

// Convert PDF to Word
DocverterFacade::convert('pdf2word', 'example.pdf', 'output.docx');

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 (15 files, 3 directories)
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
Files folder imageConfig (1 file)
Files folder imageFacade (1 file)
Files folder imageServiceProvider (1 file)
  Plain text file DocverterManager.php Class Class source
  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

  Files folder image Files  /  src  /  Config  
File Role Description
  Accessible without login Plain text file docverter.php Aux. Auxiliary script

  Files folder image Files  /  src  /  Facade  
File Role Description
  Plain text file DocverterFacade.php Class Class source

  Files folder image Files  /  src  /  ServiceProvider  
File Role Description
  Plain text file DocverterServiceProvider.php Class Class source

 Version Control Unique User Downloads  
 100%
Total:0
This week:0