[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8167":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":17,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":15,"starSnapshotCount":15,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},8167,"dompdf","dompdf\u002Fdompdf","HTML to PDF converter for PHP","https:\u002F\u002Fdompdf.github.io\u002F",null,"PHP",11139,1830,284,495,0,1,3,21,44.79,"GNU Lesser General Public License v2.1",false,"master",true,[25,5,26,27,28,29,30],"css","font","html","html-to-pdf","pdf-generation","php","2026-06-12 02:01:50","Dompdf\n======\n\n[![Build Status](https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Factions\u002Fworkflows\u002Ftest.yml)\n[![PHP Versions Supported](https:\u002F\u002Fposer.pugx.org\u002Fdompdf\u002Fdompdf\u002Frequire\u002Fphp)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fdompdf\u002Fdompdf)\n[![Latest Release](https:\u002F\u002Fposer.pugx.org\u002Fdompdf\u002Fdompdf\u002Fv)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fdompdf\u002Fdompdf)\n[![Total Downloads](https:\u002F\u002Fposer.pugx.org\u002Fdompdf\u002Fdompdf\u002Fdownloads)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fdompdf\u002Fdompdf)\n[![License](https:\u002F\u002Fposer.pugx.org\u002Fdompdf\u002Fdompdf\u002Flicense)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fdompdf\u002Fdompdf)\n \n**Dompdf is an HTML to PDF converter**\n\nAt its heart, dompdf is (mostly) a [CSS 2.1](http:\u002F\u002Fwww.w3.org\u002FTR\u002FCSS2\u002F) compliant\nHTML layout and rendering engine written in PHP. It is a style-driven renderer:\nit will download and read external stylesheets, inline style tags, and the style\nattributes of individual HTML elements. It also supports most presentational\nHTML attributes.\n\n*This document applies to the latest stable code which may not reflect the current \nrelease. For released code please\n[navigate to the appropriate tag](https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Ftags).*\n\n----\n\n**Check out the [demo](http:\u002F\u002Feclecticgeek.com\u002Fdompdf\u002Fdebug.php) and ask any\nquestion on [StackOverflow](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fdompdf) or\nin [Discussions](https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Fdiscussions).**\n\nFollow us on [![Twitter](http:\u002F\u002Ftwitter-badges.s3.amazonaws.com\u002Ftwitter-a.png)](http:\u002F\u002Fwww.twitter.com\u002Fdompdf).\n\n---\n\n\n\n## Features\n\n * Handles most CSS 2.1 and a few CSS3 properties, including @import, @media &\n   @page rules\n * Supports most presentational HTML 4.0 attributes\n * Supports external stylesheets, either local or through http\u002Fftp (via\n   fopen-wrappers)\n * Supports complex tables, including row & column spans, separate & collapsed\n   border models, individual cell styling\n * Image support (gif, png (8, 24 and 32 bit with alpha channel), bmp & jpeg)\n * No dependencies on external PDF libraries, thanks to the R&OS PDF class\n * Inline PHP support\n * Basic SVG support (see \"Limitations\" below)\n \n## Requirements\n\n * PHP version 7.1 or higher\n * DOM extension\n * MBString extension\n * php-font-lib\n * php-svg-lib\n \nNote that some required dependencies may have further dependencies \n(notably php-svg-lib requires sabberworm\u002Fphp-css-parser).\n\n### Recommendations\n\n * GD (for image processing)\n   * Additionally, the IMagick or GMagick extension improves image processing performance for certain image types\n * OPcache (OPcache, XCache, APC, etc.): improves performance\n\nVisit the wiki for more information:\nhttps:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Fwiki\u002FRequirements\n\n## About Fonts & Character Encoding\n\nPDF documents internally support the following fonts: Helvetica, Times-Roman,\nCourier, Zapf-Dingbats, & Symbol. These fonts only support Windows ANSI\nencoding. In order for a PDF to display characters that are not available in\nWindows ANSI, you must supply an external font. Dompdf will embed any referenced\nfont in the PDF so long as it has been pre-loaded or is accessible to dompdf and\nreference in CSS @font-face rules. See the\n[font overview](https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Fwiki\u002FAbout-Fonts-and-Character-Encoding)\nfor more information on how to use fonts.\n\nThe [DejaVu TrueType fonts](https:\u002F\u002Fdejavu-fonts.github.io\u002F) have been pre-installed\nto give dompdf decent Unicode character coverage by default. To use the DejaVu\nfonts reference the font in your stylesheet, e.g. `body { font-family: DejaVu\nSans; }` (for DejaVu Sans). The following DejaVu 2.34 fonts are available:\nDejaVu Sans, DejaVu Serif, and DejaVu Sans Mono.\n\n## Easy Installation\n\n### Install with composer\n\nTo install with [Composer](https:\u002F\u002Fgetcomposer.org\u002F), simply require the\nlatest version of this package.\n\n```bash\ncomposer require dompdf\u002Fdompdf\n```\n\nMake sure that the autoload file from Composer is loaded.\n\n```php\n\u002F\u002F somewhere early in your project's loading, require the Composer autoloader\n\u002F\u002F see: http:\u002F\u002Fgetcomposer.org\u002Fdoc\u002F00-intro.md\nrequire 'vendor\u002Fautoload.php';\n```\n\n### Download and install\n\nDownload a packaged archive of dompdf and extract it into the \ndirectory where dompdf will reside\n\n * You can download stable copies of dompdf from\n   https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Freleases\n * Or download a nightly (the latest, unreleased code) from\n   http:\u002F\u002Feclecticgeek.com\u002Fdompdf\n\nUse the packaged release autoloader to load dompdf, libraries,\nand helper functions in your PHP:\n\n```php\n\u002F\u002F include autoloader\nrequire_once 'dompdf\u002Fautoload.inc.php';\n```\n\nNote: packaged releases are named according using semantic\nversioning (_dompdf_MAJOR-MINOR-PATCH.zip_). So the 1.0.0 \nrelease would be dompdf_1-0-0.zip. This is the only download\nthat includes the autoloader for Dompdf and all its dependencies.\n\n### Install with git\n\nFrom the command line, switch to the directory where dompdf will\nreside and run the following commands:\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf.git\ncd dompdf\u002Flib\n\ngit clone https:\u002F\u002Fgithub.com\u002FPhenX\u002Fphp-font-lib.git php-font-lib\ncd php-font-lib\ngit checkout 0.5.1\ncd ..\n\ngit clone https:\u002F\u002Fgithub.com\u002FPhenX\u002Fphp-svg-lib.git php-svg-lib\ncd php-svg-lib\ngit checkout v0.3.2\ncd ..\n\ngit clone https:\u002F\u002Fgithub.com\u002Fsabberworm\u002FPHP-CSS-Parser.git php-css-parser\ncd php-css-parser\ngit checkout 8.1.0\n```\n\nRequire dompdf and it's dependencies in your PHP.\nFor details see the [autoloader in the utils project](https:\u002F\u002Fgithub.com\u002Fdompdf\u002Futils\u002Fblob\u002Fmaster\u002Fautoload.inc.php).\n\n## Framework Integration\n\n* For Symfony: [nucleos\u002Fdompdf-bundle](https:\u002F\u002Fgithub.com\u002Fnucleos\u002FNucleosDompdfBundle)\n* For Laravel: [barryvdh\u002Flaravel-dompdf](https:\u002F\u002Fgithub.com\u002Fbarryvdh\u002Flaravel-dompdf)\n* For Redaxo: [PdfOut](https:\u002F\u002Fgithub.com\u002FFriendsOfREDAXO\u002Fpdfout)\n\n## Quick Start\n\nJust pass your HTML in to dompdf and stream the output:\n\n```php\n\u002F\u002F reference the Dompdf namespace\nuse Dompdf\\Dompdf;\n\n\u002F\u002F instantiate and use the dompdf class\n$dompdf = new Dompdf();\n$dompdf->loadHtml('hello world');\n\n\u002F\u002F (Optional) Setup the paper size and orientation\n$dompdf->setPaper('A4', 'landscape');\n\n\u002F\u002F Render the HTML as PDF\n$dompdf->render();\n\n\u002F\u002F Output the generated PDF to Browser\n$dompdf->stream();\n```\n\n### Setting Options\n\nSet options during dompdf instantiation:\n\n```php\nuse Dompdf\\Dompdf;\nuse Dompdf\\Options;\n\n$options = new Options();\n$options->set('defaultFont', 'Courier');\n$dompdf = new Dompdf($options);\n```\n\nor at run time\n\n```php\nuse Dompdf\\Dompdf;\n\n$dompdf = new Dompdf();\n$options = $dompdf->getOptions();\n$options->setDefaultFont('Courier');\n$dompdf->setOptions($options);\n```\n\nSee [Dompdf\\Options](src\u002FOptions.php) for a list of available options.\n\n### Resource Reference Requirements\n\nIn order to protect potentially sensitive information Dompdf imposes \nrestrictions on files referenced from the local file system or the web. \n\nFiles accessed through web-based protocols have the following requirements:\n * The Dompdf option \"isRemoteEnabled\" must be set to \"true\"\n * PHP must either have the curl extension enabled or the \n   allow_url_fopen setting set to true\n   \nFiles accessed through the local file system have the following requirement:\n * The file must fall within the path(s) specified for the Dompdf \"chroot\" option\n\n## Limitations (Known Issues)\n\n * Table cells are not pageable, meaning a table row must fit on a single page: See https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Fissues\u002F98\n * Elements are rendered on the active page when they are parsed.\n * Embedding \"raw\" SVG's (`\u003Csvg>\u003Cpath...>\u003C\u002Fsvg>`) isn't working yet: See https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Fissues\u002F320  \n   Workaround: Either link to an external SVG file, or use a DataURI like this:\n     ```php\n     $html = '\u003Cimg src=\"data:image\u002Fsvg+xml;base64,' . base64_encode($svg) . '\">';\n     ```\n * Does not support CSS flexbox: See https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Fissues\u002F971\n * Does not support CSS Grid: See https:\u002F\u002Fgithub.com\u002Fdompdf\u002Fdompdf\u002Fissues\u002F2988\n * A single Dompdf instance should not be used to render more than one HTML document\n   because persisted parsing and rendering artifacts can impact future renders.\n---\n\n[![Donate button](https:\u002F\u002Fwww.paypal.com\u002Fen_US\u002Fi\u002Fbtn\u002Fbtn_donate_SM.gif)](http:\u002F\u002Fgoo.gl\u002FDSvWf)\n\n*If you find this project useful, please consider making a donation.\nAny funds donated will be used to help further development on this project.)*\n","Dompdf 是一个用于将 HTML 转换为 PDF 的 PHP 库。它支持 CSS 2.1 及部分 CSS3 属性，包括 @import、@media 和 @page 规则，并兼容大部分 HTML 4.0 呈现属性。该项目能够处理外部样式表（本地或通过 HTTP\u002FFTP 访问）、复杂的表格结构以及多种图像格式。此外，dompdf 还提供了基本的 SVG 支持和内联 PHP 功能，且无需依赖额外的 PDF 库。适用于需要在服务器端生成 PDF 文件的各种场景，如报告生成、票据打印等。",2,"2026-06-11 03:16:31","top_language"]