https://github.com/appoly/document-generator
https://github.com/appoly/document-generator
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/appoly/document-generator
- Owner: appoly
- Created: 2021-09-17T13:25:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-15T10:49:02.000Z (almost 4 years ago)
- Last Synced: 2025-12-29T15:13:36.911Z (6 months ago)
- Language: PHP
- Size: 30.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Appoly Document Generator
This package will generate PDFs and PNGs from websites.
## Installation
```bash
composer require appoly/document-generator
```
## Usage
```php
use Appoly\DocumentGenerator\Facades\DocumentGenerator;
$png = DocumentGenerator::url('https://www.appoly.co.uk')
->png()
->get();
```
## Options
| Option | Description |
| ----------------------------- | ---------------------------------------------------------------- |
| `->pdf()` | sets the file to .pdf |
| `->png()` | sets the file to .png |
| `->url($url)` | sets the url that will be rendered |
| `->html($html)` | sets the html that will be rendered |
| `->height($h)` | sets the files height |
| `->width($w)` | sets the files width |
| `->showBackground($i = true)` | when rendering a PDF, Set to `true` to print background graphics |
| `->filename($name)` | sets the file name - defaults to `random.filetype` |
## API Key
A api key is required. This can be defined in your `.env`
`DOCUMENT_GENERATOR_API_KEY`