Home / convert api
Name Modified Size InfoDownloads / Week
Parent folder
output.pdf 2017-08-14 120.2 kB
word2pdfexample.php 2017-08-14 357 Bytes
6equkc.docx 2017-08-14 245.0 kB
input.txt 2017-08-14 48 Bytes
example.php 2017-08-14 298 Bytes
Xps2PDF.php 2017-08-14 535 Bytes
Web2PDF.php 2017-08-14 536 Bytes
Word2PDF.php 2017-08-14 665 Bytes
Visio2PDF.php 2017-08-14 543 Bytes
Web2Image.php 2017-08-14 547 Bytes
Snp2PDF.php 2017-08-14 549 Bytes
Text2PDF.php 2017-08-14 548 Bytes
README.md 2017-08-14 1.6 kB
RichText2PDF.php 2017-08-14 549 Bytes
Project2PDF.php 2017-08-14 555 Bytes
Publisher2PDF.php 2017-08-14 566 Bytes
PostScript2PDF.php 2017-08-14 573 Bytes
PowerPoint2PDF.php 2017-08-14 637 Bytes
Pdf2Image.php 2017-08-14 540 Bytes
Pdf2PowerPoint.php 2017-08-14 578 Bytes
OpenOffice2PDF.php 2017-08-14 1.0 kB
Lotus2PDF.php 2017-08-14 667 Bytes
LICENSE.md 2017-08-14 7.6 kB
Jnt2PDF.php 2017-08-14 551 Bytes
Jnt2Image.php 2017-08-14 573 Bytes
Image2PDF.php 2017-08-14 1.5 kB
Excel2PDF.php 2017-08-14 617 Bytes
Image2Image.php 2017-08-14 1.5 kB
Email2Image.php 2017-08-14 612 Bytes
Email2PDF.php 2017-08-14 600 Bytes
Abstract2PowerPoint.php 2017-08-14 967 Bytes
ConvertAPI.php 2017-08-14 6.8 kB
Abstract2Image.php 2017-08-14 1.7 kB
Abstract2PDF.php 2017-08-14 1.5 kB
Totals: 34 Items   401.7 kB 0

convertapi-php

PHP library for the convertapi.com REST API.

ConvertApi is an online file conversion service for creating PDF and Images from various source files, such as Word documents, web pages and raw HTML. converapi-php provides a set of classes for using the ConvertApi service with PHP.

Development of this library is not in any way connected with Baltsoft Software.

Using

Using the library is simple:

  1. Include the required concrete class ( include('Text2PDF.php'); )
  2. Instantiate the class ( $text2pdf = new ConvertAPI\Text2Pdf(); )
  3. Either:
  4. Carry out the conversion using filesystem path for output ( $text2pdf->convert('/path/to/intput/file.txt', '/path/to/output/file.pdf'); )
  5. Carry out the conversion using function return for output ( $text2pdf->convert('/path/to/intput/file.txt'); )

The conversion will write the converted document to the given filesystem path and return verious details about the conversion (depending on the response from ConvertApi), or return a binary string representation of the document.

See example/example.php for a working example.

Extending

The library currently supports all the conversions available via convertapi.com.

Addition of new conversions is simply a matter of extending the abstract ConvertAPI class and

a) defining: * $_apiUrl - the URL of the ConvertApi endpoint (see http://www.convertapi.com/ for details) * $_validInputFormats - an array of document types (extensions) which can be converted

b) completing function __set() to handle additional valid parameters for the conversion being defined.

Source: README.md, updated 2017-08-14