infoway9/laravel-mpdf 问题修复 & 功能扩展

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

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

infoway9/laravel-mpdf

Composer 安装命令:

composer require infoway9/laravel-mpdf

包简介

Generate PDF document in Laravel framework with this mPDF wrapper.

README 文档

README

Generate PDF documents from raw HTML or laravel blade file using the laravel

Installation

Require this package in your composer.json or install it by running:

composer require infoway9/laravel-mpdf

Note: This package supports auto-discovery features of Laravel 5.4+, You only need to manually add the service provider and alias if working on Laravel version lower then 5.5

To start using Laravel, add the Service Provider and the Facade to your config/app.php:

'providers' => [
	// ...
	Infoway\mPdf\mPdfServiceProvider::class
]
'aliases' => [
	// ...
	'PDF' => Infoway\mPdf\Facades\Pdf::class
]

Now, you should publish package's config file to your config directory by using following command:

php artisan vendor:publish --tag=laravel-mpdf

Basic Usage

This is the basic usage of this package.

<?php
namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use PDF;

class HomeController extends Controller {

    public function index() {
        $data = [
    		'foo' => 'bar'
    	];
        PDF::loadView('pdf',$data)->download('abc.pdf');
    }

}

Other methods

All available methods of pdf object are:

output(): Outputs the PDF as a string.
save($filename): Save the PDF to a file
download($filename): Make the PDF and download it. stream($filename): Return a response with the PDF to show in the browser.

License

Laravel PDF is open-sourced software licensed under the MIT license

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固