GithubHelp home page GithubHelp logo

dompdflaravel's Introduction

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Mpdf with laravel

First Install package by following this package link and follow its step. Next is to downlaod fonts from this bangla fonts website link. After Completing this step you will keep your font file inside project/vendor/mpdf/mpdf/src/Config/FontVariables.php and open FontVariables.php and search for 'indics' ,then after pothana2000 ,add follwoing code

"nikosh" => ['R' => "Nikosh.ttf",'useOTL' => 0xFF,]

You are done completing this step.

Create a view file ready in your laravel resource folder for pdf. after completing this step then in controller

Basic Usage

To use Laravel Mpdf add something like this to one of your controllers. You can pass data to a view in /resources/views.

//....
class ReportController extends Controller {
  public function generate_pdf()
  {
    $mpdf = new \Mpdf\Mpdf([
            'default_font_size' => 12,
    		'default_font'	=> 'nikosh'
    ]);
    $mpdf->writeHTML(view('printpdf'));
    $mpdf->output();
  }
}

image

Some Laravel cheatsheet

Add some faker data

Remove comma from your array

@php
    $membeid = json_decode($member->cat_id, true);
    $num_count = 0;
    $num_of_items = count($membeid);
    @endphp

    @foreach($membeid as  $key => $cat)
       {{ App\Category::getinfo($cat) }}
       @php $num_count = $num_count + 1; @endphp

       @if($num_count < $num_of_items)
            @php echo ", "; @endphp
        @endif

    @endforeach

dompdflaravel's People

Contributors

aklimaruhina avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.