PHPackages                             docraptor/docraptor - 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. [API Development](/categories/api)
4. /
5. docraptor/docraptor

ActiveLibrary[API Development](/categories/api)

docraptor/docraptor
===================

A native client library for the DocRaptor HTML to PDF/XLS service.

4.2.0(2y ago)221.7M—7.8%10[1 issues](https://github.com/DocRaptor/docraptor-php/issues)[1 PRs](https://github.com/DocRaptor/docraptor-php/pulls)4MITPHPPHP ^7.4 || ^8.0

Since Jan 16Pushed 2y ago3 watchersCompare

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

READMEChangelogDependencies (4)Versions (32)Used By (4)

[![Build Status](https://camo.githubusercontent.com/5c45743a03bfb07e5e50767d94a8f44c5c54243daccc777bf76fa1dd3104649c/68747470733a2f2f7472617669732d63692e6f72672f446f63526170746f722f646f63726170746f722d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/DocRaptor/docraptor-php)

DocRaptor PHP Native Client Library
===================================

[](#docraptor-php-native-client-library)

This is a PHP package for using [DocRaptor API](https://docraptor.com/documentation) to convert [HTML to PDF and XLSX](https://docraptor.com).

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

[](#installation)

```
composer require docraptor/docraptor
```

Basic Usage
-----------

[](#basic-usage)

```
$docraptor = new DocRaptor\DocApi();
$docraptor->getConfig()->setUsername("YOUR_API_KEY_HERE");             // this key works for test documents
// $docraptor->getConfig()->setDebug(true);

$doc = new DocRaptor\Doc();
$doc->setTest(true);                                                   // test documents are free but watermarked
$doc->setDocumentContent("Hello World");     // supply content directly
// $doc->setDocumentUrl("http://docraptor.com/examples/invoice.html"); // or use a url
$doc->setName("docraptor-php.pdf");                                    // help you find a document later
$doc->setDocumentType("pdf");                                          // pdf or xls or xlsx
// $doc->setJavascript(true);                                          // enable JavaScript processing
// $prince_options = new DocRaptor\PrinceOptions();                    // pdf-specific options
// $doc->setPrinceOptions($prince_options);
// $prince_options->setMedia("screen");                                // use screen styles instead of print styles
// $prince_options->setBaseurl("http://hello.com");                    // pretend URL when using document_content

$create_response = $docraptor->createDoc($doc);
```

Next Steps
----------

[](#next-steps)

- Optionally store and get a URL for your converted document with [document hosting](https://docraptor.com/document-hosting)
- View more [code examples](examples) with error handling, asynchronous creation, file saving, and document hosting.
- Perfect your document styling with our [style and formatting reference](https://docraptor.com/documentation/style), and [API reference](https://docraptor.com/documentation/api). Easily add headers and footers, page breaks, page numbers, table of contents, and much more!

More Help
---------

[](#more-help)

Stuck? We're experts at turning HTML into PDFs so please [email us](mailto:support@docraptor.com) if you run into trouble.

Development
-----------

[](#development)

The majority of the code in this repo is generated using openapi-generator on [docraptor.yaml](docraptor.yaml). You can modify this file and regenerate the client using `script/generate_language`.

Release Process
---------------

[](#release-process)

1. Pull latest master
2. Merge feature branch(es) into master
3. `script/test`
4. Increment version: `generator-config.json`
5. Run `script/generate_language` to update generated version numbers:

- `composer.json`
- `lib/Configuration.php` (2 places)

6. Update [CHANGELOG.md](CHANGELOG.md)
7. Commit "Release version vX.Y.Z"
8. Push to GitHub
9. Tag version: `git tag 'vX.Y.Z' && git push --tags` (GitHub packagist integration will tell packagist to release a new version)
10. Verify update on
11. Refresh documentation on docraptor.com

Version Policy
--------------

[](#version-policy)

This library follows [Semantic Versioning 2.0.0](http://semver.org).

Contributors
------------

[](#contributors)

- Matthew Gordon
- Joel Meador
- Elijah Miller
- James Paden
- Jason Gladish
- Nikola Nikolov

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Every ~198 days

Recently: every ~207 days

Total

16

Last Release

797d ago

Major Versions

v0.4.0 → v1.0.02016-10-18

1.3.0 → 2.0.02020-08-03

2.0.0 → 3.0.02021-11-30

3.0.2 → 4.0.02022-11-14

PHP version history (5 changes)0.0.1PHP &gt;=5.3.3

1.3.0PHP &gt;=5.4

2.0.0PHP &gt;=5.5

3.0.0PHP ^7.3 || ^8.0

3.0.2PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d78b3816e0fd057e9c27fd792516d007b787244323cb08ce88105eccb439d4cc?d=identicon)[jasongladish](/maintainers/jasongladish)

![](https://www.gravatar.com/avatar/09e7d08e04f2fd05902a91d53680ec37a6df191fbd55b7040e84012481825114?d=identicon)[esquivalient](/maintainers/esquivalient)

![](https://www.gravatar.com/avatar/8f4fd15b6ff32cc4546401050cc87fd08a08ef0e11f047cc65e2e27182f929c4?d=identicon)[mediocretes](/maintainers/mediocretes)

---

Top Contributors

[![jqr](https://avatars.githubusercontent.com/u/273?v=4)](https://github.com/jqr "jqr (66 commits)")[![jason-o-matic](https://avatars.githubusercontent.com/u/13733?v=4)](https://github.com/jason-o-matic "jason-o-matic (59 commits)")[![janxious](https://avatars.githubusercontent.com/u/50124?v=4)](https://github.com/janxious "janxious (13 commits)")[![JamesPaden](https://avatars.githubusercontent.com/u/297533?v=4)](https://github.com/JamesPaden "JamesPaden (9 commits)")[![esquivalient](https://avatars.githubusercontent.com/u/1167916?v=4)](https://github.com/esquivalient "esquivalient (5 commits)")[![mediocretes](https://avatars.githubusercontent.com/u/149895?v=4)](https://github.com/mediocretes "mediocretes (4 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![davidronk](https://avatars.githubusercontent.com/u/3627673?v=4)](https://github.com/davidronk "davidronk (1 commits)")[![AlexOverbeck](https://avatars.githubusercontent.com/u/1075489?v=4)](https://github.com/AlexOverbeck "AlexOverbeck (1 commits)")

---

Tags

apipdfhtmlxlsxlsxdocraptor

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[pdfcrowd/pdfcrowd

A client library for the Pdfcrowd API. It lets you convert between HTML, PDF and various image formats

631.1M1](/packages/pdfcrowd-pdfcrowd)[bushlanov-dev/max-bot-api-client-php

Max Bot API Client library

281.6k](/packages/bushlanov-dev-max-bot-api-client-php)

PHPackages © 2026

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