Skip to content

Commit 0b9b868

Browse files
authored
Add release 8.10.0 (#113)
1 parent c967845 commit 0b9b868

27 files changed

+463
-86
lines changed

docs/configuration.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ sensiolabs_gotenberg:
6767
pdf_format: null # None
6868
pdf_universal_access: null # false
6969
metadata: null # None
70+
download_from: null # None
7071
url:
7172
header:
7273
template: null # None
@@ -100,6 +101,7 @@ sensiolabs_gotenberg:
100101
pdf_format: null # None
101102
pdf_universal_access: null # false
102103
metadata: null # None
104+
download_from: null # None
103105
markdown:
104106
header:
105107
template: null # None
@@ -133,6 +135,7 @@ sensiolabs_gotenberg:
133135
pdf_format: null # None
134136
pdf_universal_access: null # false
135137
metadata: null # None
138+
download_from: null # None
136139
office:
137140
landscape: null # false
138141
native_page_ranges: null # All pages
@@ -159,13 +162,17 @@ sensiolabs_gotenberg:
159162
quality: null # 90
160163
reduce_image_resolution: null # false
161164
max_image_resolution: null # 300
165+
password: null # None
166+
download_from: null # None
162167
merge:
163168
pdf_format: null # None
164169
pdf_universal_access: null # false
165170
metadata: null # None
171+
download_from: null # None
166172
convert:
167173
pdf_format: null # None
168174
pdf_universal_access: null # false
175+
download_from: null # None
169176
screenshot:
170177
html:
171178
width: null # 800
@@ -184,6 +191,7 @@ sensiolabs_gotenberg:
184191
fail_on_http_status_codes: null # [499-599]
185192
fail_on_console_exceptions: null # false
186193
skip_network_idle_event: null # false
194+
download_from: null # None
187195
url:
188196
width: null # 800
189197
height: null # 600
@@ -201,6 +209,7 @@ sensiolabs_gotenberg:
201209
fail_on_http_status_codes: null # [499-599]
202210
fail_on_console_exceptions: null # false
203211
skip_network_idle_event: null # false
212+
download_from: null # None
204213
markdown:
205214
width: null # 800
206215
height: null # 600
@@ -218,6 +227,7 @@ sensiolabs_gotenberg:
218227
fail_on_http_status_codes: null # [499-599]
219228
fail_on_console_exceptions: null # false
220229
skip_network_idle_event: null # false
230+
download_from: null # None
221231
```
222232
223233
> [!TIP]
@@ -298,4 +308,30 @@ sensiolabs_gotenberg:
298308
Whenever a controller returns something other than a `Response` object, the [`kernel.view`](https://symfony.com/doc/current/reference/events.html#kernel-view) event is fired.
299309
That listener listen to this event and detects if it is a `GotenbergFileResult` object. If so it automatically calls the `->stream()` method to convert it to a Response object.
300310

301-
Enabled byd efault but can be disabled via the `sensiolabs_gotenberg.controller_listener` configuration.
311+
Enabled by default but can be disabled via the `sensiolabs_gotenberg.controller_listener` configuration.
312+
313+
## Download from
314+
315+
> [!WARNING]
316+
> URL of the file. It MUST return a `Content-Disposition` header with a filename parameter.
317+
318+
To download files resource from URLs.
319+
320+
``` yaml
321+
sensiolabs_gotenberg:
322+
default_options:
323+
pdf:
324+
html:
325+
download_from:
326+
- url: 'http://example.com/url/to/file''
327+
extraHttpHeaders:
328+
- name: 'MyHeader'
329+
value: 'MyValue'
330+
- name: 'User-Agent'
331+
value: 'MyValue'
332+
333+
```
334+
335+
> [!TIP]
336+
> For more information go to [Gotenberg documentations](https://gotenberg.dev/docs/routes#download-from).
337+

docs/pdf/builders_api/HtmlPdfBuilder.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ Resets the metadata.
127127
* `addMetadata(string $key, string $value)`:
128128
The metadata to write.
129129

130+
* `downloadFrom(array $downloadFrom)`:
131+
130132
* `fileName(string $fileName, string $headerDisposition)`:
131133

132134
* `processor(Sensiolabs\GotenbergBundle\Processor\ProcessorInterface $processor)`:

docs/pdf/builders_api/LibreOfficePdfBuilder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# LibreOfficePdfBuilder
22

3+
* `password(string $password)`:
4+
Set the password for opening the source file.
5+
36
* `landscape(bool $bool)`:
47
Sets the paper orientation to landscape.
58

@@ -82,6 +85,8 @@ Specify if the resolution of each image is reduced to the resolution specified b
8285
* `maxImageResolution(Sensiolabs\GotenbergBundle\Enumeration\ImageResolutionDPI $resolution)`:
8386
If the form field reduceImageResolution is set to true, tell if all images will be reduced to the given value in DPI. Possible values are: 75, 150, 300, 600 and 1200.
8487

88+
* `downloadFrom(array $downloadFrom)`:
89+
8590
* `fileName(string $fileName, string $headerDisposition)`:
8691

8792
* `processor(Sensiolabs\GotenbergBundle\Processor\ProcessorInterface $processor)`:

docs/pdf/builders_api/MarkdownPdfBuilder.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ Resets the metadata.
130130
* `addMetadata(string $key, string $value)`:
131131
The metadata to write.
132132

133+
* `downloadFrom(array $downloadFrom)`:
134+
133135
* `fileName(string $fileName, string $headerDisposition)`:
134136

135137
* `processor(Sensiolabs\GotenbergBundle\Processor\ProcessorInterface $processor)`:

docs/pdf/builders_api/UrlPdfBuilder.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ Resets the metadata.
129129
* `addMetadata(string $key, string $value)`:
130130
The metadata to write.
131131

132+
* `downloadFrom(array $downloadFrom)`:
133+
132134
* `fileName(string $fileName, string $headerDisposition)`:
133135

134136
* `processor(Sensiolabs\GotenbergBundle\Processor\ProcessorInterface $processor)`:

docs/pdf/customization.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
### Additional content
2828
[header and footer](#header-and-footer)
2929
[headerFile and footerFile](#headerfile-and-footerfile)
30+
[download from](#download-from)
3031

3132
### Style
3233
[assets](../assets.md)
@@ -47,8 +48,8 @@
4748
[skipNetworkIdleEvent](#skipNetworkIdleEvent)
4849

4950
### Formatting
50-
[metadata](#metadata)
51-
[addMetadata](#addMetadata)
51+
[metadata](#metadata)
52+
[addMetadata](#addMetadata)
5253
[pdfFormat](#pdfFormat)
5354
[pdfUniversalAccess](#pdfUniversalAccess)
5455

@@ -526,6 +527,51 @@ class YourController
526527
}
527528
```
528529

530+
### download from
531+
532+
> [!WARNING]
533+
> URL of the file. It MUST return a `Content-Disposition` header with a filename parameter.
534+
535+
To download files resource from URLs.
536+
537+
```php
538+
namespace App\Controller;
539+
540+
use Sensiolabs\GotenbergBundle\GotenbergPdfInterface;
541+
542+
class YourController
543+
{
544+
public function yourControllerMethod(GotenbergPdfInterface $gotenberg): Response
545+
{
546+
return $gotenberg
547+
->html()
548+
->downloadFrom([
549+
[
550+
'url' => 'http://example.com/url/to/file',
551+
'extraHttpHeaders' =>
552+
[
553+
'MyHeader' => 'MyValue',
554+
],
555+
],
556+
[
557+
'url' => 'http://example.com/url/to/file',
558+
'extraHttpHeaders' =>
559+
[
560+
'MyHeaderOne' => 'MyValue',
561+
'MyHeaderTwo' => 'MyValue',
562+
],
563+
],
564+
])
565+
->generate()
566+
->stream()
567+
;
568+
}
569+
}
570+
```
571+
572+
> [!TIP]
573+
> For more information go to [Gotenberg documentations](https://gotenberg.dev/docs/routes#download-from).
574+
529575
## Request
530576

531577
### waitDelay

docs/pdf/office-builder.md

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,19 +771,72 @@ class YourController
771771
> [!TIP]
772772
> For more information go to [Gotenberg documentations](https://gotenberg.dev/docs/routes#images-libreoffice).
773773
774+
### download from
774775

776+
> [!WARNING]
777+
> URL of the file. It MUST return a `Content-Disposition` header with a filename parameter.
775778
779+
To download files resource from URLs.
776780

781+
```php
782+
namespace App\Controller;
777783

784+
use Sensiolabs\GotenbergBundle\GotenbergPdfInterface;
778785

786+
class YourController
787+
{
788+
public function yourControllerMethod(GotenbergPdfInterface $gotenberg): Response
789+
{
790+
return $gotenberg
791+
->office()
792+
->downloadFrom([
793+
[
794+
'url' => 'http://url/to/file.com',
795+
'extraHttpHeaders' =>
796+
[
797+
'MyHeader' => 'MyValue',
798+
],
799+
],
800+
[
801+
'url' => 'http://url/to/file.com',
802+
'extraHttpHeaders' =>
803+
[
804+
'MyHeaderOne' => 'MyValue',
805+
'MyHeaderTwo' => 'MyValue',
806+
],
807+
],
808+
])
809+
->generate()
810+
->stream()
811+
;
812+
}
813+
}
814+
```
779815

816+
> [!TIP]
817+
> For more information go to [Gotenberg documentations](https://gotenberg.dev/docs/routes#download-from).
780818
819+
## password
781820

821+
Default: `None`
782822

823+
Set the password for opening the source file.
783824

825+
```php
826+
namespace App\Controller;
784827

828+
use Sensiolabs\GotenbergBundle\GotenbergPdfInterface;
785829

786-
787-
788-
789-
830+
class YourController
831+
{
832+
public function yourControllerMethod(GotenbergPdfInterface $gotenberg): Response
833+
{
834+
return $gotenberg->office()
835+
->files('document.txt')
836+
->password('My password')
837+
->generate()
838+
->stream()
839+
;
840+
}
841+
}
842+
```

docs/screenshot/builders_api/HtmlScreenshotBuilder.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ Adds additional files, like images, fonts, stylesheets, and so on (overrides any
7272
* `addAsset(string $path)`:
7373
Adds a file, like an image, font, stylesheet, and so on.
7474

75+
* `downloadFrom(array $downloadFrom)`:
76+
7577
* `fileName(string $fileName, string $headerDisposition)`:
7678

7779
* `processor(Sensiolabs\GotenbergBundle\Processor\ProcessorInterface $processor)`:

docs/screenshot/builders_api/MarkdownScreenshotBuilder.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ Adds additional files, like images, fonts, stylesheets, and so on (overrides any
7575
* `addAsset(string $path)`:
7676
Adds a file, like an image, font, stylesheet, and so on.
7777

78+
* `downloadFrom(array $downloadFrom)`:
79+
7880
* `fileName(string $fileName, string $headerDisposition)`:
7981

8082
* `processor(Sensiolabs\GotenbergBundle\Processor\ProcessorInterface $processor)`:

docs/screenshot/builders_api/UrlScreenshotBuilder.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Adds additional files, like images, fonts, stylesheets, and so on (overrides any
7474
* `addAsset(string $path)`:
7575
Adds a file, like an image, font, stylesheet, and so on.
7676

77+
* `downloadFrom(array $downloadFrom)`:
78+
7779
* `fileName(string $fileName, string $headerDisposition)`:
7880

7981
* `processor(Sensiolabs\GotenbergBundle\Processor\ProcessorInterface $processor)`:

0 commit comments

Comments
 (0)