PHP Classes

PHP RTF to PDF Converter: Convert documents in RTF format to PDF

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-03-13 (5 months ago) RSS 2.0 feedNot enough user ratingsTotal: 50 All time: 10,700 This week: 64Up
Version License PHP version Categories
php-rtf-to-pdf 1.0.0MIT/X Consortium ...5PHP 5, Files and Folders, Documents
Description 

Author

This package can convert documents in RTF format to PDF.

It can take the file name of a document in RTF format and convert it to HTML.

The package can convert the document in HTML to a PDF file with a given name.

Innovation Award
PHP Programming Innovation award nominee
March 2024
Number 4
RTF is a document format for storing the structure and data of word-processing documents that can be displayed, printed, or converted to documents in formats used by specific word Processing applications.

Several applications can export word-processing documents edited by users to files in the RTF format.

This package can read document files in RTF format and export them to PDF so the documents can be saved to files or printed.

Manuel Lemos
Picture of The Algoslingers
  Performance   Level  
Name: The Algoslingers <contact>
Classes: 9 packages by
Country: Ghana Ghana
Innovation award
Innovation award
Nominee: 5x

Winner: 1x

Example

<?php
/*
 * --------- EXAMPLE USAGE ---------
 *
 * @brief PHP class for converting rtf to pdf
 * @version 1.0.0
 * @author Thealgoslingers
 * @twitter @thealgoslingers
 */

require_once "vendor/autoload.php";

use
thealgoslingers\RtfToPdf;

/*
 * Go check samples folder
 * a new output.pdf file will be created
 * after running this script
 */
 
## the rtf file path
$rtf_file_path = "samples/sample.rtf";

## path to save the new pdf file
$path_to_save_output = "samples/output.pdf";

## start converting the rtf file
$rtfpdf = new RtfToPdf($rtf_file_path);

## output the pdf file
$rtfpdf->output($path_to_save_output);
?>


Details

php-rtf-to-pdf

Convert rtf to pdf

Installation

  composer require thealgoslingers/php-rtf-to-pdf

Example usage

 <?php
/*
 * --------- EXAMPLE USAGE ---------
 *
 * @brief PHP class for converting rtf to pdf
 * @version 1.0.0
 * @author Thealgoslingers
 * @twitter @thealgoslingers
 */

## autoload libs
require_once "vendor/autoload.php";

use thealgoslingers\RtfToPdf;

/*
 * Go check samples folder
 * a new output.pdf file will be created
 * after running this script
 */
 
## the rtf file path
$rtf_file_path = "samples/sample.rtf";

## path to save the new pdf file 
$path_to_save_output = "samples/output.pdf";

## start converting the rtf file
$rtfpdf = new RtfToPdf($rtf_file_path);

## output the pdf file
$rtfpdf->output($path_to_save_output);
?>

This code is the same as in the `index.php` file Use that file instead of copying from here


  Files folder image Files (7)  
File Role Description
Files folder imagesamples (1 file)
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files (7)  /  samples  
File Role Description
  Accessible without login Plain text file sample.rtf Data Auxiliary data

  Files folder image Files (7)  /  src  
File Role Description
  Plain text file RtfToPdf.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:50
This week:0
All time:10,700
This week:64Up