定制 wyzen-packages/htmltopdf 二次开发

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

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

wyzen-packages/htmltopdf

Composer 安装命令:

composer require wyzen-packages/htmltopdf

包简介

HTML to PDF API caller

README 文档

README

Librairie pour l'utilisation du service HTMLtoPDF Wyzen

 Required

Nécessite le service htmlToPdf Wyzen

Import

composer require wyzen-packages/htmltopdf

Options

from URL or HTML

  • depuis une source HTML ou HTML64
      $options = [
              "html" => "<h2>PDF from html code inline</h2>",
              //"html64" => "html encoded base64"
      ]
    
  • depuis une source URL
      $options = [
              "url" => "https://www.google.com",
      ]
    

common

    $options = [
            "options" => [
                "common" => [
                    "javascript-delay" => 1000,
                    "no-stop-slow-scripts" => true
                ],
            ],
        ];

pdf

    $options = [
            "options" => [
                "pdf" => [
                    "orientation" => "Portrait",
                    "header-center" => "My header",
                    "footer-center" => "My footer",
                ],
            ],
        ];

image

    $options = [
            "options" => [
                "image" => [
                    "format" => "png",
                    "width" => 800,
                    "height" => 600,
                ],
            ],
        ];

usage

use Wyzen\HtmlToPdf;

// Set URL
$htmlToPdf = new HtmlToPdf($_ENV['HTMLTOPDF_URL']);

// Set Auth
$htmlToPdf->setAuth($_ENV['HTMLTOPDF_ACCOUNT'], $_ENV['HTMLTOPDF_KEY']);

// Get HTML Help
$html = $htmlToPdf->getHelp();

// Get PDF response
$response = $htmlToPdf->toPdf($options)->getResponse();

// Get PDF content
$response = $htmlToPdf->toPdf($options)->getContent();

// Get Image response
$response = $htmlToPdf->toImage($options)->getResponse();

// Get Image content
$response = $htmlToPdf->toImage($options)->getContent();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固