
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
github.com/andrej-griniuk/cakephp-html-to-image-view
This plugin renders html views as image (jpg or png) using wkhtmltoimage
command line utility from WkHtmlToPdf package.
You can install this plugin into your CakePHP application using Composer.
composer require andrej-griniuk/cakephp-html-to-image-view
First of all you need to load the plugin in your bootstrap.php
Plugin::load('HtmlToImageView', ['bootstrap' => true, 'routes' => true]);
This will enable jpeg
and png
extensions on any route. Alternatively you could load the plugin without 'routes' => true
and only enable extensions on the routes you would like.
Layout path and templates sub dir are img
, e.g. you'll need to create src/Template/Layout/img/defaut.ctp
for your image views and and image view template would be, for example, src/Template/Events/img/view.ctp
. Then simply call, for example, http://localhost/events/view.jpg
to render your view as image.
Default path to wkhtmltoimage
binary is /usr/bin/wkhtmltoimage
. You can change it by setting HtmlToImageView.binary
configuration variable:
Configure::write('HtmlToImageView.binary', '/another/path/to/wkhtmltoimage');
You can pass some options to wkhtmltoimage
from your view via $this->viewOptions(['imageOptions' => [...])
. List of available options:
For example:
$this->viewOptions([
'imageOptions' => [
'width' => 250,
'zoom' => 2
],
]);
See the full documentation and installation instruction for wkhtmltoimage
at the project website
https://github.com/andrej-griniuk/cakephp-html-to-image-view/issues
Copyright (c) 2018, Andrej Griniuk and licensed under The MIT License.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.