PHPackages                             majid/phptopdf - 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. majid/phptopdf

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

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

81102[2 issues](https://github.com/majidphpdeveloper/phptopdf/issues)PHP

Since Nov 23Pushed 11y ago1 watchersCompare

[ Source](https://github.com/majidphpdeveloper/phptopdf)[ Packagist](https://packagist.org/packages/majid/phptopdf)[ RSS](/packages/majid-phptopdf/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PDF maker Package for Laravel 4.2
---------------------------------

[](#pdf-maker-package-for-laravel-42)

### Installation

[](#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](https://phptopdf.com/signup/) 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 = '';
$my_html .= "";

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

$math_var = (2+3) * 7;
$my_html .= "".
$my_html .= $math_var;
$my_html .= ""

$my_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](http://www.phptopdf.com) for functions arguments and right syntax.

```
Phptopdf::phptopdf($pdf_options);
```

and finally you can read [phptopdf official web site](http://wwww.phptopdf.com) for more documentation. ##License this package was created by Majid Abdolhosseini and is released under the MIT License.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c3e5d182214e2e6b989a2230bcae80b2107b088da1c6dbea6f6f8d28702e272?d=identicon)[majidphpdeveloper](/maintainers/majidphpdeveloper)

---

Top Contributors

[![mhndev](https://avatars.githubusercontent.com/u/5164182?v=4)](https://github.com/mhndev "mhndev (4 commits)")

### Embed Badge

![Health badge](/badges/majid-phptopdf/health.svg)

```
[![Health](https://phpackages.com/badges/majid-phptopdf/health.svg)](https://phpackages.com/packages/majid-phptopdf)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.2k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M100](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M215](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M128](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
