PHPackages                             sircoolmind/laravel-pdf-latex-new - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. sircoolmind/laravel-pdf-latex-new

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

sircoolmind/laravel-pdf-latex-new
=================================

A latex package for laravel to generate pdfs. Credit to original author and programmer responsible for latest feature

1.3(1y ago)020MITPHPPHP &gt;=5.4.0

Since Jul 25Pushed 1y agoCompare

[ Source](https://github.com/SirCoolMind/laravel-pdf-latex-new)[ Packagist](https://packagist.org/packages/sircoolmind/laravel-pdf-latex-new)[ RSS](/packages/sircoolmind-laravel-pdf-latex-new/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Laravel Latex Package For Laravel 5
===================================

[](#laravel-latex-package-for-laravel-5)

 [![Laravel](laravel-logo.png)](laravel-logo.png) [![LaTex](latex-logo.svg)](latex-logo.svg)

LaTex is an extraordinary typesetting system, using which you can highly professional and clean documentation. The document can be a simple article or huge technical/scientific book.

The reason to choose LaTex is that, it has extensive features inbuilt have headers, footers, book index, page numbers, watermarks and so on... Once you explore the possibilities of a LaTex document, you would be amazed.

This package makes entire scaffolding using which you can generate, save or download PDF documents.

Pre-requisites :
----------------

[](#pre-requisites-)

You need to have `texlive-full` program installed on your server. This program has tex packages and language libraries which help you generate documents.

Note : You can also opt to install `textlive` which is the lighter and primitive version of the package where as `texlive-full` contains all package bundles.

The different is : - When you install `textlive` and want to use any additional tex package, you need to install it manually. - `texlive-full` comes with these extra packages. As a result it may take up some additional space on server (to store the package library files).

### 1. Latex dependency setup inside server/vagrant

[](#1-latex-dependency-setup-inside-servervagrant)

```
sudo apt install texlive-full
```

### 2. Latex package manager setup

[](#2-latex-package-manager-setup)

```
tlmgr init-usertree
tlmgr option repository ctan

tlmgr repository add ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2019/tlnet-final
tlmgr repository list
tlmgr repository remove http://mirror.ctan.org/systems/texlive/tlnet
tlmgr option repository ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2019/tlnet-final

tlmgr --verify-repo=none install dirtree
tlmgr --verify-repo=none install fontsize
```

If encounter error tlnet-final not found, it could be your OS version is up-to-date. You may tried to update the year into 2021 inside the URL.

```
tlmgr repository add ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2021/tlnet-final
tlmgr repository list
tlmgr repository remove http://mirror.ctan.org/systems/texlive/tlnet
tlmgr option repository ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2021/tlnet-final
```

Below command is for IMT Tech Sdn Bhd staff and Laravel 5
---------------------------------------------------------

[](#below-command-is-for-imt-tech-sdn-bhd-staff-and-laravel-5)

Require two independent files, IMTTechReports.cls dan logo.png. Can ask Hafiz or Kak Ija.

### Return value of Texlive path

[](#return-value-of-texlive-path)

```
kpsewhich -var-value TEXMFHOME
```

### Replace %path% with value above

[](#replace-path-with-value-above)

```
sudo mkdir %path%/tex/latex/imttech
sudo cp IMTTechReports.cls %path%/tex/latex/imttech/
sudo mkdir %path%/tex/latex/imttech/images
sudo cp th_logo.png %path%/tex/latex/imttech/images
```

Original:

```
sudo mkdir /vagrant/home/texmf/tex/latex/imttech
sudo cp IMTTechReports.cls /home/vagrant/texmf/tex/latex/imttech/
sudo mkdir /vagrant/home/texmf/tex/latex/imttech/images
sudo cp th_logo.png /home/vagrant/texmf/tex/latex/imttech/images
```

Installation :
--------------

[](#installation-)

```
composer require sircoolmind/laravel-pdf-latex-new
```

Dry Run :
---------

[](#dry-run-)

Before diving into the usage directly, it is important to make sure required programms are installed properly on yoru server. The package comes with dryrun method which you can use in put inside any controller or route. It will automatically generate `dryrun.pdf` if everything is set up prperly on the server. If not, it will throw `LatexException` with detailed server errors.

```
