Download the PHP package omaralalwi/gpdf without Composer

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

Gpdf

Gpdf : HTML to PDF Converter for PHP & Laravel

Open Source PHP Package for converting HTML to PDF in PHP & Laravel applications, support store to s3, with out-of-the-box support for Arabic content and other languages. Extends dompdf to add new features and solve issues like Arabic language support.

Requirements

Installation

Publish Resources

After installation, publish the config and fonts resources by running the following commands in the root project path:

Note for Publish Issues: If you encounter any issues while publishing, manually copy the vendor/omaralalwi/gpdf/assets/fonts folder to public/vendor/gpdf and ensure the fonts are in public/vendor/gpdf/fonts. Also, copy vendor/omaralalwi/gpdf/config/gpdf.php to the /config folder in the root path.


Usage with Native PHP Apps

After installing the package and publishing resources, include autoload.php and use the Gpdf class.

Basic Usage

Note: Customize the settings file as needed.

Stream Generated PDF Files

Stream a PDF directly to the browser using generateWithStream:

Store Files To Local

Save a PDF files to local storage using generateWithStore:

Note By default it store files to local driver.

generateWithStore params

Parameter Type Description
html file string The HTML content to be stored.
store path or bucket name with s3 string The path where the file will be stored, with S3 store this should bucket name.
file name string The name of the file.
with stream bool If you need to stream the file to the browser after storing, set this to true.
sslVerify bool If with stream is set to true, you should set this to true in production to verify SSL.

Store Files To S3

same to store in local, just replace local path with bucket name, and replace generateWithStore with generateWithStoreToS3 .

Demo Native PHP App

please see this Demo Native PHP app contain more detailed examples and cases like pass dynamic parameters for html file & pass inline configs , .. and another cases.


Usage with Laravel

Using the Gpdf Facade

Using Dependency Injection

Stream Generated PDF Files

Stream a PDF directly to the browser using generateWithStream:

Storing Generated PDF Files

Store Files To local

Save a PDF to storage using generateWithStore:

Note By default it store files to local driver (ensure that: the store path is access able for read and write).

please see generateWithStore params .

Store Files To S3

same to store in local, just replace local path with bucket name, and replace generateWithStore with generateWithStoreToS3 .

Note Ensure you setup s3 configs in config file.

Generate Advance With Fixed Header

please see this example if you need to add fixed header to all pages

Demo Laravel App

this Demo Laravel app contain more detailed examples and cases.


Supported Fonts

Gpdf supports the following installed fonts (ready to use without any additional configurations):

Supported Fonts

Support for Arabic

Gpdf supports Arabic content out-of-the-box. Simply pass Arabic text within your HTML content. Make sure to use Arabic fonts, which are included by default.

Supported Arabic Fonts

The following built-in fonts support Arabic:

DejaVu Sans Mono , Tajawal , Almarai , Cairo , Noto Naskh Arabic , Markazi Text .

We Recommended to Use font name from Omaralalwi\Gpdf\Enums\GpdfDefaultSupportedFonts Enum class , like default font name in config file .

Examples


Installing New Fonts

To install a new font, follow these steps:

  1. Ensure the default fonts are published to public/vendor/gpdf/fonts.
  2. Prepare at least one font (Normal) for each family (Normal, Bold, Italic, BoldItalic).
  3. Copy the fonts to any path (not the default fonts path).
  4. The font family name must be enclosed in double quotes and written in lowercase.
  5. fonts names must be in kebab case with capitalize.
  6. Run install font script with the following command:

For example, to install the Tajawal font family:


Features


Thanks

Testing

or

Changelog

See CHANGELOG for recent changes.

Contributing

See CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected].

Credits

License

The MIT License (MIT). See LICENSE for more information.



All versions of gpdf with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
aws/aws-sdk-php Version ^3.308
dompdf/dompdf Version ^3.0
khaled.alshamaa/ar-php Version ^6.3
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 omaralalwi/gpdf contains the following files

Loading the files please wait ....