From dbf68f045105f2eadb5f7e7460330745eef2bec7 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 7 Jan 2021 16:03:07 +0100 Subject: [PATCH 01/10] Explaining `$this->factory->create();` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1da6cabe..37d78774 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ final class MyService public function render() { // ... - $this->factory->create(); + $dompdf = $this->factory->create(); // Returns a `Dompdf\Dompdf` object // ... } } From 2e47b7cf1f22fd7b9e6bfeba1c876a3e42fadf49 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 7 Jan 2021 16:10:53 +0100 Subject: [PATCH 02/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37d78774..3b5d6de6 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ $this->wrapper->getStreamResponse($html, 'document.pdf'); ### Configure the Bundle ```yaml -# config/packages/nucleos_dompdf.yml +# config/packages/nucleos_dompdf.yaml nucleos_dompdf: defaults: From 4abee60a57d897129c851ba27d8326f8c232afa8 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 7 Jan 2021 16:12:43 +0100 Subject: [PATCH 03/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b5d6de6..b7186981 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ nucleos_dompdf: defaults: dpi: 150 defaultPaperSize: A4 - ... + # See https://github.com/dompdf/dompdf/wiki/Usage#options for available options ``` ### Events From 73991f60e727985c8b3d467d14116d2c13813b4b Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 7 Jan 2021 17:03:37 +0100 Subject: [PATCH 04/10] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b7186981..a14e208c 100644 --- a/README.md +++ b/README.md @@ -102,8 +102,7 @@ $this->wrapper->getStreamResponse($html, 'document.pdf'); nucleos_dompdf: defaults: - dpi: 150 - defaultPaperSize: A4 + defaultFont: 'helvetica' # See https://github.com/dompdf/dompdf/wiki/Usage#options for available options ``` From 9a341ae5ea9d343368036174dc8d8224afe65f65 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 7 Jan 2021 17:16:10 +0100 Subject: [PATCH 05/10] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a14e208c..a1377690 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ final class MyService { // ... $dompdf = $this->factory->create(); // Returns a `Dompdf\Dompdf` object + // Or pass an array of options: + $dompdf = $this->factory->create(['chroot' => '/home']); // ... } } From f3c0b35fcabe41c678a69c94f310677975a64c6a Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 7 Jan 2021 17:26:15 +0100 Subject: [PATCH 06/10] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a1377690..27dc5b6e 100644 --- a/README.md +++ b/README.md @@ -110,9 +110,9 @@ nucleos_dompdf: ### Events -The dompdf wrapper dispatches events to convenient get the inner dompdf instance when creating the pdf. -- `dompdf.output` is dispatched in getPdf -- `dompdf.stream` is dispatched in streamHtml +The dompdf wrapper dispatches events to conveniently get the inner dompdf instance when creating the PDF. +- `dompdf.output` is dispatched in `getPdf()` +- `dompdf.stream` is dispatched in `streamHtml()` See [Symfony event dispatcher documentation](https://symfony.com/doc/current/event_dispatcher.html) for more info. From d789bbe674b228d53f7ea040a70bdd8e85ab65d7 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 7 Jan 2021 18:45:49 +0100 Subject: [PATCH 07/10] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 27dc5b6e..d526e19c 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ final class MyOtherService $html = '

Sample Title

Lorem Ipsum

'; $response = $this->wrapper->getStreamResponse($html, "document.pdf"); + // `$response` is a `Symfony\Component\HttpFoundation\StreamedResponse` $response->send(); // ... } From ac449bcfc7332daa8698d5e61cab29bccd0fcac9 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 7 Jan 2021 21:17:49 +0100 Subject: [PATCH 08/10] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d526e19c..9732e382 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ NucleosDompdfBundle [![Code Coverage](https://codecov.io/gh/nucleos/NucleosDompdfBundle/branch/main/graph/badge.svg)](https://codecov.io/gh/nucleos/NucleosDompdfBundle) [![Type Coverage](https://shepherd.dev/github/nucleos/NucleosDompdfBundle/coverage.svg)](https://shepherd.dev/github/nucleos/NucleosDompdfBundle) -This bundle provides a wrapper for using [dompdf] inside symfony. +This bundle provides a wrapper for using [dompdf] inside Symfony. ## Installation @@ -115,7 +115,7 @@ The dompdf wrapper dispatches events to conveniently get the inner dompdf instan - `dompdf.output` is dispatched in `getPdf()` - `dompdf.stream` is dispatched in `streamHtml()` -See [Symfony event dispatcher documentation](https://symfony.com/doc/current/event_dispatcher.html) for more info. +See [Symfony Events and Event Listeners](https://symfony.com/doc/current/event_dispatcher.html) for more info. ## License From 0905305f02de244a85a08dbba6ebad3b75c9fa3d Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Sat, 9 Jan 2021 23:32:00 +0100 Subject: [PATCH 09/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9732e382..bbdba91a 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,8 @@ final class MyOtherService // ... $html = '

Sample Title

Lorem Ipsum

'; + /** @var Symfony\Component\HttpFoundation\StreamedResponse */ $response = $this->wrapper->getStreamResponse($html, "document.pdf"); - // `$response` is a `Symfony\Component\HttpFoundation\StreamedResponse` $response->send(); // ... } From e00a5187a2348c5e21dabc5c46b080b54805b528 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Sun, 10 Jan 2021 00:36:46 +0100 Subject: [PATCH 10/10] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bbdba91a..0256a383 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,8 @@ final class MyService public function render() { // ... - $dompdf = $this->factory->create(); // Returns a `Dompdf\Dompdf` object + /** @var Dompdf\Dompdf $dompdf */ + $dompdf = $this->factory->create(); // Or pass an array of options: $dompdf = $this->factory->create(['chroot' => '/home']); // ... @@ -72,7 +73,7 @@ final class MyOtherService // ... $html = '

Sample Title

Lorem Ipsum

'; - /** @var Symfony\Component\HttpFoundation\StreamedResponse */ + /** @var Symfony\Component\HttpFoundation\StreamedResponse $response */ $response = $this->wrapper->getStreamResponse($html, "document.pdf"); $response->send(); // ...