Download the PHP package uiii/processwire-fieldtypepdf without Composer

On this page you can find all versions of the php package uiii/processwire-fieldtypepdf. 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 processwire-fieldtypepdf

PDF Fieldtype/Inputfield

Packagist

Module for ProcessWire CMS allowing you to easily generate images from the PDF files embedded to the site.

  1. Requirements
  2. Installation
  3. How to use
    • In site's administration
    • In templates
  4. API documentation
  5. Tests
  6. Upgrading from 1.0.1 and lower
  7. Troubleshooting
  8. Changelog

Requirements

For ProcessWire 2.x support use version 1.x, maintained in pw-2 branch.

Installation

How to install or uninstall modules.

Via Composer

In your ProcessWire installation root run:

Login to your ProcessWire admin and go to Modules > Refresh and install the module.

If you want to read more about ProcessWire and Composer visit https://processwire.com/blog/posts/composer-google-calendars-and-processwire/

How to use

In site's administration

Add a field and set its type to PDF. Use the field the same way as the file field (obviously, this accepts only *.pdf files). After the file is uploaded you will see a small thumbnail of it, just like for image field.

Image generation is highly configurable (image format, extension, background, ...). See the PDF to image converter section on field's Details tab.

Field settings

In templates

There are some backward-compatible API changes against the version 1.0.1 and lower, see Upgrading from 1.0.1 and lower.

The PDF field extends file field and adds new hookable ___toImage($page = 0, $options = array()) method to generate the image from PDF.

Method accepts two optional parameters. First is the $page, which specifies the PDF's page number the image is generated from, default is 0. The exception is thrown if the page is out of range.

The second is $options parameter, which is an array of options to override the options set in administration.

For each combinations of page and suffixes there will be one image. The generated images are saved in page's assets and will be created only once until forceNew options is TRUE. The image is the instance of Pageimage, so you can do with it whatever you can do with the image field. When you delete the PDF file the generated images are deleted too.

API documentation

Generate into doc directory:

Tests

DO NOT run the tests against the production site. They modify the fields, templates and pages as they need, so can potentially damage your site!

Prepare the PW testing installation and export the PW_PATH environment variable containing the path to the root of that installation. Copy the module sources in the $PW_PATH/site/modules/FieldtypePDF directory.

Install required packages:

Run the tests

Test multiple ProcessWire versions (automatically)

You can also automatically test against multiple ProcessWire versions. It uses Tense tool for it.

  1. Install reuquired packages:

  2. Run the tests:

WARNING: The tool will ask you for database connection parameters. Configure the db connection parameters carefully because it creates and drops a database for each ProcessWire installation.

Upgrading from 1.0.1 and lower

In 1.1.0 some methods of class PagePDF are deprecated. See the list here. You doesn't have to make any changes but it is recommended to use the new API, for compatibility with later versions.

Instructions for replacing the deprecated methods:

NOTE: There is certain incompatibility between these two methods. While isThumbnail returns TRUE for all the images generated from the PDF and also theirs derivatives (e.g. pdf.jpg, pdf.100x100.jpg), the isImageOfThis return TRUE only for the images generated directly from PDF (e.g. pdf.jpg). That doesn't change much, because you can use it in combination with Pageimage::isVariation.

Troubleshooting

Thumbnail's colors do not match the colors in PDF

To fix that, you need to made some changes in ImageMagick delegate files. Detailed instructions can be found here: http://www.lassosoft.com/CMYK-Colour-Matching-with-ImageMagick

GhostScript exceptions occured

If you got some GhostScript exceptions when generating image, update GhostScript and ImageMagick to the latest versions.

If you can't, you can use the fallback mode. Turn it on in the module's settings.

Be aware of that this will produce low quality images and most of the field type options won't be abvailable.


All versions of processwire-fieldtypepdf with dependencies

PHP Build Version
Package Version
Requires hari/pw-module Version ^1.0
uiii/tense Version ^1.0
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 uiii/processwire-fieldtypepdf contains the following files

Loading the files please wait ....