Download the PHP package el-gitto-junior/pdf without Composer

On this page you can find all versions of the php package el-gitto-junior/pdf. 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 pdf

The Pdf Gear

Build Status Latest Stable Version Total Downloads License

This project started life as a DOCX templating engine. It has now envolved to also support converting HTML to PDF using a headless version of webkit, phantomjs.

The DOCX templating is great for documents that end clients update and manage over time, particularly text heavy documents. For example I use it to auto generate some legal contracts, where simple replacements are made for attributes like First Name, Last Name, Company Name & Address. The client, an insurance company, can provide updated template word documents that might contain subtle changes to policies & other conditions.

The HTML to PDF engine is great for cases where greater control over the design of the document is required. It's also more natural for us programmers, using standard HTML & CSS, with a splash of Javscript.

How to Install

Installation via composer is easy:

composer require gears/pdf:*

You will also need to add the following to your root file.

"scripts":
{
    "post-install-cmd": ["PhantomInstaller\\Installer::installPhantomJS"],
    "post-update-cmd": ["PhantomInstaller\\Installer::installPhantomJS"]
}

DOCX: If you are going to be using the DOCX templating you will need to install either libre-office-headless or unoconv on your host.

How to Use, the basics

Both APIs are accessed through the main class.

To convert a word document into a PDF without any templating:

To save the generated PDF to a file:

To convert a html document into a PDF:

NOTE: The save to file works just the same for a HTML document.

DOCX Templating

By default the DOCX backend defaults to using , to use , override the converter like so:

NOTE: Currently the HTML backend only uses phantomjs.

There are several templating methods for the DOCX engine. The first is setValue, this replaces all instances of with

To clone an entire block of DOCX xml, you surround your block with tags like: & . Whatever content is contained inside this block will be repeated 3 times in the generated PDF.

If you need to replace an entire block with custom DOCX xml you can. But you need to make sure your XML conforms to the DOCX standards. This is a very low level method and I wouldn't normally use this.

To delete an entire block, for example you might have particular sections of the document that you only want to show to certian users.

Finally the last method is useful for adding new rows to tables. Similar to the method. You place the tag in first cell of the table. This row is the one that gets cloned.

For more examples please see the Unit Tests. These contain the PHP code to generate the final PDF along with the original DOCX templates.

NOTE: The HTML to PDF converter does not have these same templating functions. Obviously it's just standard HTML that you can template how ever you like.

HTML PhantomJs Print Environment

This is still in development and subject to radical change. So I won't document this section just yet...

Credits

The DOCX templating code originally came from PHPWord

You may still like to use PHPWord to generate your DOCX documents. And then use this package to convert the generated document to PDF.


Developed by Brad Jones - [email protected]


All versions of pdf with dependencies

PHP Build Version
Package Version
Requires gears/di Version *
el-gitto-junior/string Version ^0.6.1
symfony/process Version ^3.3
symfony/filesystem Version ^3.3
jakoch/phantomjs-installer Version 1.9.8
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 el-gitto-junior/pdf contains the following files

Loading the files please wait ....