定制 umanit/document-generator-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

umanit/document-generator-bundle

Composer 安装命令:

composer require umanit/document-generator-bundle

包简介

This bundle is used to drive the document generator microservice developed by UmanIT: https://github.com/umanit/microservice-document-generator

README 文档

README

This bundle is used to drive the document generator microservice developed by UmanIT: https://github.com/umanit/microservice-document-generator

Installation

$ composer require umanit/document-generator-bundle

The bundle relies on HTTPlug to perform HTTP requests, so you will need to install a client implementation to use it. For example, the following will use the HTTPlug message factory and the Guzzle adapter.

$ composer require php-http/message php-http/guzzle6-adapter

Configuration

  • umanit_document_generator.base_uri: Base URI of the API used to generate documents.
  • umanit_document_generator.encryption_key: (Optional) Key used to crypt message before calling the API. It must match the one defined in the micro-service.

Usage

The only exposed service is umanit_document_generator.document_generator. It provides all the necessary methods to communicate with the micro-service API.

You can generate PNG or PDF using an URL or a HTML source code string.

Examples:

<?php

$generator = $container->get('umanit_document_generator.document_generator');

// Get a PNG of https://www.google.fr
$image = $generator->generatePngFromUrl('https://www.google.fr');

// Get a PDF from a HTML code source
$pdf = $generator->generatePdfFromHtml('<html><body>Hello World!</body></html>');

Each methods provides an additional parameter to specify other supported options by the micro-service, such as decode for HTML generation or pageOptions and scenario for both types.

Data encryption

By default, messages are not encrypted before calling the API. If you want to enable this feature, ensure you have define the umanit_document_generator.encryption_key configuration the same as in the micro-service then call the encryptData(true) method on the service. The encryption could be disabled the same way by calling encryptData(false).

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固