PHPackages                             pdfmyurl/pdfmyurl - 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. pdfmyurl/pdfmyurl

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

pdfmyurl/pdfmyurl
=================

Convert any URL to PDF and/or HTML to PDF in PHP with the PDFmyURL API

1.61.5(6y ago)35.4k↓50%MITPHPPHP &gt;=5.3.10

Since Jan 10Pushed 6y ago1 watchersCompare

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

READMEChangelog (7)DependenciesVersions (7)Used By (0)

Convert any URL to PDF and/or HTML to PDF in PHP
================================================

[](#convert-any-url-to-pdf-andor-html-to-pdf-in-php)

PHP library to convert URLs and/or HTML to PDF via the PDFmyURL API service.

You can use the PDFmyURL API with a license from . You can get a trial license at  first if you like.

Notable features of our API are:

- Conversion of webpages to PDF according to the latest HTML &amp; CSS standards, so also flexbox and other cool stuff!
- Setting of options that are typically not available in other libraries, such as
    - Headers, Footers, Custom Page Sizes etc
    - Watermarking with image or text
    - Using custom backgrounds
    - Converting only parts of the webpage
    - Modifying a webpage with custom CSS
    - Protecting the PDFs with a password

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

[](#installation)

You can install the library via Packagist as follows.

```
$ composer require pdfmyurl/pdfmyurl

```

You can also just include the PDFmyURL.php file in your project from the src directory of course.

Usage
-----

[](#usage)

Here's how you convert a URL to PDF in PHP with our API. You can download this example from the src directory.

```
