majid/phptopdf 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

majid/phptopdf

Composer 安装命令:

composer require majid/phptopdf

包简介

laravel 4.2 package to converting html or php to pdf, this package also have the ability to get the url and return pdf which was generated from specified url .this is an online service so you need internet access to use this package

README 文档

README

Installation

Add this package to your composer.json and run composer update. "Majid/phptopdf": "dev-master"

Add the ServiceProvider to the providers array in

 app/config/app.php
'Majid\Phptopdf\PhptopdfServiceProvider'

then go to phptopdf sign up page and sign up , it's free. then get API_KEY from site and just copy and paste it in line 5 of file mentiond below.

your_project_path/vendor/phptopdf/src/Majid/Phptopdf/phptopdf.php
$my_html = '<HTML>';
$my_html .= "<link rel=\"stylesheet\" href=\"http://phptopdf.com/bootstrap.css\">";


$my_html .= "<div>".
$my_html .= "what ever html element and php function which has html element output you can use here like below"
$my_html .= "<div/>"

$math_var = (2+3) * 7;
$my_html .= "<div>".
$my_html .= $math_var;
$my_html .= "<div/>"



$my_html .= '</HTML>';
$pdf_options = array(
  "encoding" => 'UTF-8',
  "source_type" => 'html',
  "source" => $my_html,
  "action" => 'save',
  "save_directory" =>  app_path().'/../public/files/pdf',
  "file_name" => 'factor.pdf'
  );

  Phptopdf::phptopdf($pdf_options);

As you can see phptopdf function is a function which is available in phptopdf library and I just gathered all of its function under my class and you can use all of its functions as below :

Phptopdf::phptopdf
Phptopdf::phptopdf_url
Phptopdf::phptopdf_html

see phptopdf.com for functions arguments and right syntax.

Phptopdf::phptopdf($pdf_options);

and finally you can read phptopdf official web site for more documentation. ##License this package was created by Majid Abdolhosseini and is released under the MIT License.

majid/phptopdf 适用场景与选型建议

majid/phptopdf 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 110 次下载、GitHub Stars 达 7, 最近一次更新时间为 2014 年 11 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「pdf」 「laravel」 「htmltopdf」 「phptopdf」 「imagetopdf」 「urltopdf」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 majid/phptopdf 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 majid/phptopdf 我们能提供哪些服务?
定制开发 / 二次开发

基于 majid/phptopdf 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-23