Download the PHP package idg/idg without Composer

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

Document image generator

Minimum PHP Version Build Status

Fast and simple document image generator. This is a wrapper over Imagick with which you can create such images:

Example

See: examples/index.php

Features

Requirements

PHP 5.6+, Imagick extension.

Installation

composer require idg/idg

Usage

Result

Example

see: examples/columns.php

Methods

Idg

Method Return Description
Idg($width, $maxHeight, $minHeight = null, $background = null, $type = 'png') Idg Creating new generator
$idg->beginDocument($marginTop = 0, $marginLeft = 0, $marginBottom = 0, $marginRight = 0) Document Begin Document. It required.
$idg->endDocument() End document.
$idg->beginBlock() Block Begin relative block.
$idg->endBlock() End block.
$idg->beginAbsoluteBlock($top, $left) AbsoluteBlock Begin absolute block.
$idg->endAbsoluteBlock() End absolute block.
$idg->beginRow() Row Begin row.
$idg->endRow() End row.
$idg->beginColumn($width) Column Begin column.
$idg->endColumn() End column.
$idg->image($file, $fromBlob = false) Image Adding image.
$idg->text($content) Text Adding text.
$idg->addElement(Element $element) Element Add custom element.
$idg->getCanvas() Imagick Return Imagick object.
$idg->compose() Composing blocks.
$idg->getImageBlob() string Returning image result blob.
$idg->beginElement(Element $element) Element Begin custom element.
$idg->endElement() End custom element.

Element

The element is responsible for its display

Main methods

Method Return Description
Element() Element Creating new element
$element->setTop($value) Element Setting top
$element->setLeft($value) Element Setting left
$element->setWidth($value) Element Setting width
$element->setStaticHeight($value) Element Setting static height
$element->setAfterRender($closure) Element Setting after render function, see: examples/custom_element.php
$element->getParent() Element or null Get parent element
$element->getIdg() Igd Get Igd object
$element->getWidth() int Get width or parents width
$element->getLeft() int Get left
$element->getTop() int Get top
$element->getTopOffset() int Get global top offset
$element->getHeight() int Get height with children
$element->getOuterHeight() int Get height with top
$element->increaseHeight($value) Increase self height
$element->getChildren() Element[] List of children
$element->getSiblings() Element[] List of siblings with current element
$element->getPrevSibling() Element Prev sibling
$element->getPrevSiblings() Element[] List of prev siblings
$element->beforeRender() Method will call before render document
$element->render() Method will call on render document
$element->afterRender() Method will call after render document

Element properties

Padding

Method Return Description
$element->setPaddingTop($value) Element Setting padding top
$element->setPaddingLeft($value) Element Setting padding left
$element->setPaddingRight($value) Element Setting padding right
$element->setPaddingBottom($value) Element Setting padding bottom
$element->setPadding($top, $right, $bottom, $left) Element Setting padding

Margin

Method Return Description
$element->setMarginTop($value) Element Setting margin top
$element->setMarginLeft($value) Element Setting margin left
$element->setMarginRight($value) Element Setting margin right
$element->setMarginBottom($value) Element Setting margin bottom
$element->setMargin($top, $right, $bottom, $left) Element Setting margin

Border

Method Return Description
$element->setBorderColor($value) Element Setting border color
$element->setBorderWidth($value) Element Setting border width
$element->setBorder($width, $color) Element Setting border
$element->setBorderOpacity($value) Element Setting border opacity

Background

Method Return Description
$element->setBackgroundColor($value) Element Setting background color. $value can be Gradient object
$element->setBackgroundOpacity($value) Element Setting background opacity
$element->setBackground($color, $opacity) Element Setting background

Rotation

Rotation is inherit.

Method Return Description
$element->setRotation($value) Element Setting rotation
$element->getRotation() int Get rotation total rotation

Text (extends Element)

Method Return Description
$element->setAlign($value) Element Setting align
$element->setAngle($value) Element Setting angle of line
$element->setFontSize($value) Element Setting font size, 16 default
$element->setFont($value) Element Setting font family
$element->setTextColor($value) Element Setting text color, black default
$element->setDecoration($value) Element Setting text decoration
$element->setFontStyle(\ImagickDraw $draw) Element Setting style, it override all attributes

Padding, margin, border and gradient on background

Example

See: examples/properties.php

Computed properties

Example

See: examples/computed_properties.php

Custom elements

Example

See: examples/custom_element.php
Custom element must be instance from Element (or children)

For more customization you can use standart Imagick methods:

Donation

PayPal: [email protected]

Yandex.Money: 410011704835851


All versions of idg with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
ext-imagick 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 idg/idg contains the following files

Loading the files please wait ....