Download the PHP package api2pdf/api2pdf.php without Composer

On this page you can find all versions of the php package api2pdf/api2pdf.php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package api2pdf.php

api2pdf.php

PHP code for Api2Pdf REST API

Api2Pdf.com is a powerful REST API for instantly generating PDF and Office documents from HTML, URLs, Microsoft Office Documents (Word, Excel, PPT), Email files, and images. You can generate image preview or thumbnail of a PDF, office document, or email file. The API also supports merge / concatenation of two or more PDFs, setting passwords on PDFs, and adding bookmarks to PDFs. Api2Pdf is a wrapper for popular libraries such as wkhtmltopdf, Headless Chrome, PdfSharp, and LibreOffice.

Installation

Run the following from command line:

Usage without Composer

Copy the file in the src directory to a sub-directory in your project, then add the following in the beginning of your PHP file:

Resources

Resources this API supports:

Authorization

Acquire API Key

Create an account at portal.api2pdf.com to get your API key.

Usage

Initialize the Client

All usage starts by calling the import command and initializing the client by passing your API key as a parameter to the constructor.

Once you initialize the client, you can make calls like so:

Result Format

An ApiResult object is returned from every API call. If a call is unsuccessful then an exception will be thrown with a message containing the result of failure.

Additional attributes include the total data usage out, and the cost for the API call, typically very small fractions of a penny.

wkhtmltopdf

Convert HTML to PDF

Convert HTML to PDF (load PDF in browser window and specify a file name)

Convert HTML to PDF (use arguments for advanced wkhtmltopdf settings) View full list of wkhtmltopdf options available.

Convert URL to PDF

Convert URL to PDF (load PDF in browser window and specify a file name)

Convert URL to PDF (use arguments for advanced wkhtmltopdf settings) View full list of wkhtmltopdf options available.


Headless Chrome

Convert HTML to PDF

Convert HTML to PDF (load PDF in browser window and specify a file name)

Convert HTML to PDF (use arguments for advanced Headless Chrome settings) View full list of Headless Chrome options available.

Convert URL to PDF

Convert URL to PDF (load PDF in browser window and specify a file name)

Convert URL to PDF (use arguments for advanced Headless Chrome settings) View full list of Headless Chrome options available.

Convert HTML to Image

Convert HTML to Image (load image in browser window and specify a file name)

Convert HTML to Image (use arguments for advanced Headless Chrome settings) View full list of Headless Chrome options available.

Convert URL to Image

Convert URL to Image (load image in browser window and specify a file name)

Convert URL to Image (use arguments for advanced Headless Chrome settings) View full list of Headless Chrome options available.


LibreOffice

Convert any office file to PDF, image file to PDF, email file to PDF, HTML to Word, HTML to Excel, and PDF to HTML. Any file that can be reasonably opened by LibreOffice should be convertible. Additionally, we have an endpoint for generating a thumbnail of the first page of your PDF or Office Document. This is great for generating an image preview of your files to users.

You must provide a url to the file. Our engine will consume the file at that URL and convert it to the PDF.

Convert Microsoft Office Document or Image to PDF

Thumbnail or Image Preview of a PDF or Office Document or Email file

Convert HTML to Microsoft Word or Docx

Convert HTML to Microsoft Excel or Xlsx

Convert PDF to HTML


PdfSharp - Merge / Concatenate Two or More PDFs, Add bookmarks to pdfs, add passwords to pdfs

To use the merge endpoint, supply a list of urls to existing PDFs. The engine will consume all of the PDFs and merge them into a single PDF, in the order in which they were provided in the list.

Merge PDFs from list of URLs to existing PDFs

Add bookmarks to existing PDF

Add password to existing PDF


Helper Methods

delete($responseId)

By default, Api2Pdf will delete your generated file 24 hours after it has been generated. For those with high security needs, you may want to delete your file on command. You can do so by making an DELETE api call with the responseId attribute that was returned on the original JSON payload.


All versions of api2pdf.php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package api2pdf/api2pdf.php contains the following files

Loading the files please wait ....