royopa/fpdf-symfony2 问题修复 & 功能扩展

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

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

royopa/fpdf-symfony2

最新稳定版本:4.0

Composer 安装命令:

composer require royopa/fpdf-symfony2

包简介

fpdf vendor for use with symfony, based on toooni/fpdf

README 文档

README

Uses FPDF 1.8 and FPDI 2.3, tested in Symfony 2+ and 3+

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Scrutinizer Code Quality

Instalation and Usage

Package available on Composer.

If you're using Composer to manage dependencies, you can use

composer require royopa/fpdf-symfony2

Usage

class WelcomeController extends Controller
{
    public function indexAction()
    {
        $pdf = new \FPDF();

        $pdf->AddPage();
        $pdf->SetFont('Arial','B',16);
        $pdf->Cell(40,10,'Hello World!');

        return new Response($pdf->Output(), 200, array(
            'Content-Type' => 'application/pdf'));
    }
}

FPDF

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. FPDF is a open source project: you may use it for any kind of usage and modify it to suit your needs.

On the fpdf homepage you will find links to the documentation, forums and so on.

Example

My Controller:

<?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;


class DefaultController extends Controller
{
    /**
     * @Route("/", name="homepage")
     */
    public function indexAction(Request $request)
    {
        $pdf = new \FPDF();

        $pdf->AddPage();
        $pdf->SetFont('Arial','B',16);
        $pdf->Cell(40,10,'Hello World!');

        return new Response($pdf->Output(), 200, array(
            'Content-Type' => 'application/pdf'));
    }
}

统计信息

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

GitHub 信息

  • Stars: 28
  • Watchers: 2
  • Forks: 22
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 未知