PHPackages                             phpcfdi/cfditopdf - 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. [Payment Processing](/categories/payments)
4. /
5. phpcfdi/cfditopdf

ActiveLibrary[Payment Processing](/categories/payments)

phpcfdi/cfditopdf
=================

Create a generic PDF file from a CFDI 3.3 &amp; 4.0 (CLI included)

v0.5.0(6mo ago)4144.3k↑51%23[1 issues](https://github.com/phpcfdi/cfditopdf/issues)4MITPHPPHP &gt;=8.1CI passing

Since Mar 22Pushed 6mo ago4 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (17)Used By (4)

phpcfdi/cfditopdf
=================

[](#phpcfdicfditopdf)

[![Source Code](https://camo.githubusercontent.com/c443f20260bd50001267b863b809a9503a2e86f0a0b8ed438374b2111876bb05/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d706870636664692f63666469746f7064662d626c75653f6c6f676f3d676974687562)](https://github.com/phpcfdi/cfditopdf)[![Packagist PHP Version Support](https://camo.githubusercontent.com/a6cb336db3d0ab813592f2c6626223fc90e153c1a289bf29e43c28550a1e64d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706870636664692f63666469746f7064663f6c6f676f3d706870)](https://packagist.org/packages/phpcfdi/cfditopdf)[![Discord](https://camo.githubusercontent.com/e7d280832b4bb781e0e83dc7b04440636ea6a67d076133da0938b79caab9d6dd/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3435393836303535343039303238333031393f6c6f676f3d646973636f7264)](https://discord.gg/aFGYXvX)[![Latest Version](https://camo.githubusercontent.com/393c0b52cf6e6cc0185a0e6c436a2c4b7a77207dd5d8fe0e0852cb9a7e9fc9d6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f706870636664692f63666469746f7064663f6c6f676f3d676974)](https://github.com/phpcfdi/cfditopdf/releases)[![Software License](https://camo.githubusercontent.com/34ddb7f8585d53b2616d783db1dd1c7c4f0607c41742d51f83eb59d32db79baf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706870636664692f63666469746f7064663f6c6f676f3d6f70656e2d736f757263652d696e6974696174697665)](https://github.com/phpcfdi/cfditopdf/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/7f9f7704a16185a0279e81bfd0c90cca2d4f2c194a5066889be94ac186b0eec6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706870636664692f63666469746f7064662f6275696c642e796d6c3f6272616e63683d6d6173746572266c6f676f3d6769746875622d616374696f6e73)](https://github.com/phpcfdi/cfditopdf/actions/workflows/build.yml?query=branch:master)[![Reliability](https://camo.githubusercontent.com/1018d033c77418818f97b3228535c17e7421b74ad51e7b2f3bebb199a46818c3/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d706870636664695f63666469746f706466266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/component_measures?id=phpcfdi_cfditopdf&metric=Reliability)[![Maintainability](https://camo.githubusercontent.com/41fb264587d1f49f659a3e30e9c124de8794ad69f7c67d261f76db9fbbf79a5b/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d706870636664695f63666469746f706466266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/component_measures?id=phpcfdi_cfditopdf&metric=Maintainability)[![Code Coverage](https://camo.githubusercontent.com/fa638c7956a93fd841b7b9a729f2a7308bf63ea94f826146eef42ec3bd1ba45d/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f636f7665726167652f706870636664695f63666469746f7064662f6d61737465723f6c6f676f3d736f6e617271756265636c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/component_measures?id=phpcfdi_cfditopdf&metric=Coverage)[![Violations](https://camo.githubusercontent.com/78fcdcfad79b83ef963e4c0a07a3397370921b705465ac35a3e11899df320ab1/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f76696f6c6174696f6e732f706870636664695f63666469746f7064662f6d61737465723f666f726d61743d6c6f6e67266c6f676f3d736f6e617271756265636c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/project/issues?id=phpcfdi_cfditopdf&resolved=false)[![Total Downloads](https://camo.githubusercontent.com/ffbe5cbc2168ab6feb361c8c422fc813131651073ba2386a9d3b24ae954744a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706870636664692f63666469746f7064663f6c6f676f3d7061636b6167697374)](https://packagist.org/packages/phpcfdi/cfditopdf)[![Docker Downloads](https://camo.githubusercontent.com/9cf193560d81f2ea8fc20c665a13dc77ca0ad795abdafbaec69155606b70db31/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f706870636664692f63666469746f7064663f6c6f676f3d646f636b6572)](https://hub.docker.com/r/phpcfdi/cfditopdf)

> Create a generic PDF file from a CFDI 3.3 &amp; 4.0

In some cases you just simply need a PDF file from a Mexican CFDI (Comprobante Fiscal Digital por Internet). This tool help you to create a generic one. You can also use it to build your own and pretty formats.

Installation
------------

[](#installation)

Use [composer](https://getcomposer.org/), so please run

```
composer require phpcfdi/cfditopdf
```

Basic usage from CLI
--------------------

[](#basic-usage-from-cli)

```
$ bin/cfditopdf [options]  []
  -h, --help                Show this help
  -V, --version             Show command version
  -d, --dirty               Do not try to clean up the cfdi file
  -f, --fonts-dir           Path where TCPDF fonts are located
  -l, --resource-location   Use this path to store the xml resources locally,
                            if none then it will always download xlst resources
  cfdi-file                 Path of the XML file (input file)
  pdf-file                  Path of the PDF file (output file) if none then it will remove
                            ".xml" extension and suffix ".pdf" extension

```

Basic usage from docker
-----------------------

[](#basic-usage-from-docker)

```
docker run -it --rm --user="$(id -u):$(id -g)" cfditopdf --help
```

See more information on the [Docker README](Docker.README.md) file.

Basic usage as a PHP library
----------------------------

[](#basic-usage-as-a-php-library)

```
