Download the PHP package opus4-repo/opus4-pdf without Composer

On this page you can find all versions of the php package opus4-repo/opus4-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 opus4-pdf

opus4-pdf

This package provides PDF support in OPUS 4 for instance to generate cover sheets or validate files.

(Deutsche Dokumentation)

Requirements

XeTeX and Pandoc

The opus4-pdf package currently requires XeTeX and Pandoc to generate PDF cover sheets.

In Ubuntu / Debian based Linux systems, these tools can be installed using apt or apt-get:

$ apt-get install texlive-xetex
$ apt-get install pandoc

In case of Pandoc, please ensure that you install / use at least version 2.17. The current implementation was not tested against older Pandoc versions.

To check the version of Pandoc that has been installed, run:

$ pandoc -v

Fonts

PDF cover sheets will be generated via template files. Note that the included demo-cover.md file requires the "Open Sans" (true type or open type) font to be installed on the system. This font is available under the Apache License v.2.0 in the Google Fonts library. Alternatively, it can be obtained under the SIL Open Font License 1.1 from bunny.net.

The Vagrantfile file gives an example on how fonts can be installed on Ubuntu/Debian-based Linux systems from the command line.

Unit tests

In order to run the unit tests the system must also meet the following basic requirements:

Dependencies

Further dependencies are declared in composer.json and can be downloaded automatically using

composer install

or

php composer.phar install

This will cause the required packages to get downloaded and installed in the vendor directory.

The script bin/install-composer.sh can be used to automatically download composer.phar, so the most recent version can be used. Composer is also available in most Linux distributions.

Integration with OPUS 4

Besides the above mentioned requirements, perform the following steps in order to enable PDF cover sheet generation for your OPUS 4 installation.

Setting configuration options

By default, PDF cover sheet generation is disabled. To enable PDF cover sheet generation, add the following configuration options to your application's config.ini file:

pdf.covers.generate = 1

This will cause PDF cover sheets to be added in front of PDF files downloaded via the OPUS 4 frontdoor.

By default, OPUS 4 looks for PDF cover templates in the application/configs/covers directory. You can optionally specify a different directory path via this configuration option:

pdf.covers.path = APPLICATION_PATH "/application/configs/covers"

This package contains a simple demo cover template in the test/_files directory which can be used as the base for any custom template. To use this demo cover template, put this template into the covers directory that you've specified for pdf.covers.path, and add this option:

pdf.covers.default = 'demo-cover.md'

If you've created a custom PDF cover template replace the value for the pdf.covers.default option with your template's file name (or path relative to the covers directory if your template is located in its own subdirectory).

You may optionally specify different cover templates to be used for certain OPUS 4 collections. To do so, you can map a collection-specific cover template to a certain collection ID:

collection.12345.cover = 'my-cover.md'

Replace 12345 with the actual ID of your collection and my-cover.md with the actual name of your collection-specific cover template (or its relative path if it's located within a subdirectory).

Displaying licence logos

Currently, the PDF cover sheet generation process can only make use of image files that are available locally.

By default, the application looks for licence logos within a public/img/licences directory, but you can also specify another directory via the licences.logos.path option:

licences.logos.path = APPLICATION_PATH "/public/img/licences"

Inside the specified licences directory, OPUS 4 expects licence logos at a path that matches the URL path given for the licence in its database table. For example, if the link_logo column in the OPUS database table document_licences contains this logo URL:

https://licensebuttons.net/l/by-sa/4.0/88x31.png

OPUS 4 would expect the local representation of that licence logo at:

public/img/licences/l/by-sa/4.0/88x31.png

Running the unit tests

With Vagrant and VirtualBox installed, the included Vagrantfile can be used to install all requirements and Composer dependencies in a virtual machine.

The unit tests can then be run via these commands:

$ cd opus4-pdf
$ vagrant up
$ vagrant ssh
$ composer test

Creating custom PDF cover templates

In the application, downloaded files that include a cover sheet get cached in the workspace/filecache directory (original files will not be modified). As long as a cached version exists and the document of the file doesn't change, the cached version will be delivered on subsequent download requests.

The opus4 console tool includes a cover:generate command which will generate a PDF cover for a given document ID. This command will always force a rebuild of the cover sheet which can be useful when developing a custom cover template.

To display the command's help, execute this command on the console:

bin/opus4 help cover:generate

In order to generate a PDF cover for a document using the current default template, execute this command:

bin/opus4 cover:generate ID

Replace ID with the document's actual ID. The generated PDF cover will be written to the current working directory using the document's ID as its file name. You can use the --out option to specify a different file name, e.g. "cover.pdf":

bin/opus4 cover:generate --out=cover.pdf ID

Finally, you can use the --template option to specify the path to a custom cover template, e.g.:

bin/opus4 cover:generate --out=cover.pdf --template=./application/configs/covers/my-cover.md ID

All versions of opus4-pdf with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
iio/libmergepdf Version ^4.0
ueberdosis/pandoc Version *
seboettg/citedata Version @dev
opus4-repo/opus4-common Version ^4.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 opus4-repo/opus4-pdf contains the following files

Loading the files please wait ....