[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8381":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":15,"starSnapshotCount":15,"syncStatus":17,"lastSyncTime":34,"discoverSource":35},8381,"mpdf","mpdf\u002Fmpdf","PHP library generating PDF files from UTF-8 encoded HTML","https:\u002F\u002Fmpdf.github.io",null,"PHP",4683,1104,139,309,0,1,2,12,3,31.13,"GNU General Public License v2.0",false,"development",[25,26,27,28,29,30],"cjk","css","html","pdf","php","utf-8","2026-06-12 02:01:52","mPDF is a PHP library which generates PDF files from UTF-8 encoded HTML.\n\nIt is based on [FPDF](http:\u002F\u002Fwww.fpdf.org\u002F) and [HTML2FPDF](http:\u002F\u002Fhtml2fpdf.sourceforge.net\u002F)\n(see [CREDITS](CREDITS.txt)), with a number of enhancements. mPDF was written by Ian Back and is released\nunder the [GNU GPL v2 licence](LICENSE.txt).\n\n[![Latest Stable Version](https:\u002F\u002Fposer.pugx.org\u002Fmpdf\u002Fmpdf\u002Fv\u002Fstable)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fmpdf\u002Fmpdf)\n[![Total Downloads](https:\u002F\u002Fposer.pugx.org\u002Fmpdf\u002Fmpdf\u002Fdownloads)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fmpdf\u002Fmpdf)\n[![License](https:\u002F\u002Fposer.pugx.org\u002Fmpdf\u002Fmpdf\u002Flicense)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fmpdf\u002Fmpdf)\n\n\n> ⚠ If you are viewing this file on mPDF GitHub repository homepage or on Packagist, please note that\n> the default repository branch is `development` which can differ from the last stable release.\n\nRequirements\n============\n\nPHP versions and extensions\n---------------------------\n\n- `PHP >=5.6 \u003C7.3.0` is supported for `mPDF >= 7.0`\n- `PHP 7.3` is supported since `mPDF v7.1.7`\n- `PHP 7.4` is supported since `mPDF v8.0.4`\n- `PHP 8.0` is supported since `mPDF v8.0.10`\n- `PHP 8.1` is supported as of `mPDF v8.0.13`\n- `PHP 8.2` is supported as of `mPDF v8.1.3`\n- `PHP 8.3` is supported as of `mPDF v8.2.1`\n- `PHP 8.4` is supported as of `mPDF v8.2.5`\n- `PHP 8.5` is supported as of `mPDF v8.2.6`\n\nPHP `mbstring` and `gd` extensions have to be loaded.\n\nAdditional extensions may be required for some advanced features such as `zlib` for compression of output and\nembedded resources such as fonts, `bcmath` for generating barcodes or `xml` for character set conversion\nand SVG handling.\n\nKnown server caveats\n--------------------\n\nmPDF has some problems with fetching external HTTP resources with single threaded servers such as `php -S`. A proper\nserver such as nginx (php-fpm) or Apache is recommended.\n\nSupport us\n==========\n\nConsider supporting development of mPDF with a donation of any value. [Donation button][1] can be found on the\n[main page of the documentation][1].\n\nInstallation\n============\n\nOfficial installation method is via composer and its packagist package [mpdf\u002Fmpdf](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fmpdf\u002Fmpdf).\n\n```\n$ composer require mpdf\u002Fmpdf\n```\n\nUsage\n=====\n\nThe simplest usage (since version 7.0) of the library would be as follows:\n\n```php\n\u003C?php\n\nrequire_once __DIR__ . '\u002Fvendor\u002Fautoload.php';\n\n$mpdf = new \\Mpdf\\Mpdf();\n$mpdf->WriteHTML('\u003Ch1>Hello world!\u003C\u002Fh1>');\n$mpdf->Output();\n\n```\n\nThis will output the PDF inline to the browser as `application\u002Fpdf` Content-type.\n\nSetup & Configuration\n=====================\n\nAll [configuration directives](https:\u002F\u002Fmpdf.github.io\u002Freference\u002Fmpdf-variables\u002Foverview.html) can\nbe set by the `$config` parameter of the constructor.\n\nIt is recommended to set one's own temporary directory via `tempDir` configuration variable.\nThe directory must have write permissions (mode `775` is recommended) for users using mPDF\n(typically `cli`, `webserver`, `fpm`).\n\n**Warning:** mPDF will clean up old temporary files in the temporary directory. Choose a path dedicated to mPDF only.\n\n\n```php\n\u003C?php\n\n$mpdf = new \\Mpdf\\Mpdf(['tempDir' => __DIR__ . '\u002Ftmp']);\n\n```\n\nBy default, the temporary directory will be inside vendor directory and will have write permissions from\n`post_install` composer script.\n\nFor more information about custom temporary directory see the note on\n[Folder for temporary files](https:\u002F\u002Fmpdf.github.io\u002Finstallation-setup\u002Ffolders-for-temporary-files.html)\nin the section on Installation & Setup in the [manual][1].\n\nIf you have problems, please read the section on\n[troubleshooting](https:\u002F\u002Fmpdf.github.io\u002Ftroubleshooting\u002Fknown-issues.html) in the manual.\n\nAbout CSS support and development state\n=======================================\n\nmPDF as a whole is a quite dated software. Nowadays, better alternatives are available, albeit not written in PHP.\n\nUse mPDF if you cannot use non-PHP approach to generate PDF files or if you want to leverage some of the benefits of mPDF\nover browser approach – color handling, pre-print, barcodes support, headers and footers, page numbering, TOCs, etc.\nBut beware that a HTML\u002FCSS template tailored for mPDF might be necessary.\n\nIf you are looking for state of the art CSS support, mirroring existing HTML pages to PDF, use headless Chrome.\n\nmPDF will still be updated to enhance some internal capabilities and to support newer versions of PHP,\nbut better and\u002For newer CSS support will most likely not be implemented.\n\nOnline manual\n=============\n\nOnline manual is available at https:\u002F\u002Fmpdf.github.io\u002F.\n\nGeneral troubleshooting\n=============\n\nFor general questions or troubleshooting please use [Discussions](https:\u002F\u002Fgithub.com\u002Fmpdf\u002Fmpdf\u002Fdiscussions).\n\nYou can also use the [mpdf tag](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fmpdf) at Stack Overflow as the StackOverflow user base is more likely to answer you in a timely manner.\n\nContributing\n============\n\nBefore submitting issues and pull requests please read the [CONTRIBUTING.md](https:\u002F\u002Fgithub.com\u002Fmpdf\u002Fmpdf\u002Fblob\u002Fdevelopment\u002F.github\u002FCONTRIBUTING.md) file.\n\nUnit Testing\n============\n\nUnit testing for mPDF is done using [PHPUnit](https:\u002F\u002Fphpunit.de\u002F).\n\nTo get started, run `composer install` from the command line while in the mPDF root directory\n(you'll need [composer installed first](https:\u002F\u002Fgetcomposer.org\u002Fdownload\u002F)).\n\nTo execute tests, run `composer test` from the command line while in the mPDF root directory.\n\nAny assistance writing unit tests for mPDF is greatly appreciated. If you'd like to help, please\nnote that any PHP file located in the `\u002Ftests\u002F` directory will be autoloaded when unit testing.\n\n[1]: https:\u002F\u002Fmpdf.github.io\n","mPDF 是一个PHP库，用于从UTF-8编码的HTML生成PDF文件。它基于FPDF和HTML2FPDF，并进行了多项改进，支持CSS样式、CJK字符集等高级特性。该库适用于需要将网页内容或富文本转换为PDF格式的应用场景，如电子发票、报告文档生成等。mPDF要求PHP环境至少为5.6版本，并依赖于mbstring和gd扩展来确保正常运行，同时支持通过Composer进行安装。","2026-06-11 03:17:40","top_language"]