Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ sensiolabs_gotenberg:
name:
name: ~
value: ~

# Flattening PDFs. - default None. https://gotenberg.dev/docs/routes#flatten-chromium
flatten: null
url:

# Add default header to the builder.
Expand Down Expand Up @@ -493,6 +496,9 @@ sensiolabs_gotenberg:

# Or the syntax below is also possible
# - { name: 'X-Custom-Header', value: 'custom-header-value' }

# Flattening PDFs. - default None. https://gotenberg.dev/docs/routes#flatten-chromium
flatten: null
markdown:

# Add default header to the builder.
Expand Down Expand Up @@ -692,6 +698,9 @@ sensiolabs_gotenberg:

# Or the syntax below is also possible
# - { name: 'X-Custom-Header', value: 'custom-header-value' }

# Flattening PDFs. - default None. https://gotenberg.dev/docs/routes#flatten-chromium
flatten: null
office:

# Set the password for opening the source file. https://gotenberg.dev/docs/routes#page-properties-libreoffice
Expand Down Expand Up @@ -805,6 +814,9 @@ sensiolabs_gotenberg:

# Specify whether to put extracted pages into a single file or as many files as there are page ranges. Only works with pages mode. - default false. https://gotenberg.dev/docs/routes#split-libreoffice
split_unify: null

# Flatten the resulting PDF. - default None. https://gotenberg.dev/docs/routes#flatten-libreoffice
flatten: null
merge:

# Convert PDF into the given PDF/A format - default None.
Expand Down Expand Up @@ -840,6 +852,9 @@ sensiolabs_gotenberg:
name:
name: ~
value: ~

# Flatten the resulting PDF. - default None. https://gotenberg.dev/docs/routes#merge-pdfs-route
flatten: null
convert:

# Convert PDF into the given PDF/A format - default None.
Expand Down Expand Up @@ -869,6 +884,43 @@ sensiolabs_gotenberg:

# Specify whether to put extracted pages into a single file or as many files as there are page ranges. Only works with pages mode. - default false. https://gotenberg.dev/docs/routes#split-libreoffice
split_unify: null

# Convert PDF into the given PDF/A format - default None.
pdf_format: null # One of "PDF\/A-1b"; "PDF\/A-2b"; "PDF\/A-3b"

# Enable PDF for Universal Access for optimal accessibility - default false.
pdf_universal_access: null

# The metadata to write. Not all metadata are writable. Consider taking a look at https://exiftool.org/TagNames/XMP.html#pdf for an (exhaustive?) list of available metadata.
metadata:
Author: ~
Copyright: ~
CreationDate: ~
Creator: ~
Keywords: ~
Marked: ~
ModDate: ~
PDFVersion: ~
Producer: ~
Subject: ~
Title: ~
Trapped: ~ # One of "True"; "False"; "Unknown"

# Flatten the resulting PDF. - default None. https://gotenberg.dev/docs/routes#split-pdfs-route
flatten: null

# URLs to download files from (JSON format). - default None. https://gotenberg.dev/docs/routes#split-pdfs-route
download_from:

# Prototype
-
url: ~
extraHttpHeaders:

# Prototype
name:
name: ~
value: ~
screenshot:
html:

Expand Down
3 changes: 3 additions & 0 deletions docs/pdf/builders_api/ConvertPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Sets download from to download each entry (file) in parallel (URLs MUST return a
> See: [https://gotenberg.dev/docs/routes#download-from](https://gotenberg.dev/docs/routes#download-from)

### files(Stringable|string ...$paths)
### flatten(bool $bool)
Flattening a PDF combines all its contents into a single layer. (default false).

### pdfFormat(?Sensiolabs\GotenbergBundle\Enumeration\PdfFormat $format)
Convert the resulting PDF into the given PDF/A format.

Expand Down
3 changes: 3 additions & 0 deletions docs/pdf/builders_api/HtmlPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Sets download from to download each entry (file) in parallel (URLs MUST return a
> [!TIP]
> See: [https://gotenberg.dev/docs/routes#download-from](https://gotenberg.dev/docs/routes#download-from)

### flatten(bool $bool)
Flattening a PDF combines all its contents into a single layer. (default false).

### metadata(array $metadata)
Resets the metadata.<br />

Expand Down
3 changes: 3 additions & 0 deletions docs/pdf/builders_api/MarkdownPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Add Markdown into a PDF.<br />
> [!TIP]
> See: [https://gotenberg.dev/docs/routes#markdown-files-into-pdf-route](https://gotenberg.dev/docs/routes#markdown-files-into-pdf-route)

### flatten(bool $bool)
Flattening a PDF combines all its contents into a single layer. (default false).

### metadata(array $metadata)
Resets the metadata.<br />

Expand Down
3 changes: 3 additions & 0 deletions docs/pdf/builders_api/UrlPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Sets download from to download each entry (file) in parallel (URLs MUST return a
> [!TIP]
> See: [https://gotenberg.dev/docs/routes#download-from](https://gotenberg.dev/docs/routes#download-from)

### flatten(bool $bool)
Flattening a PDF combines all its contents into a single layer. (default false).

### metadata(array $metadata)
Resets the metadata.<br />

Expand Down
44 changes: 37 additions & 7 deletions docs/pdf/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
[nativePageRanges](#nativePageRanges)
[splitMode](#splitMode)
[splitSpan](#splitSpan)
[splitUnify](#splitUnify)
[splitUnify](#splitUnify)

### Additional content
### Additional content
[header and footer](#header-and-footer)
[headerFile and footerFile](#headerfile-and-footerfile)
[download from](#download-from)

### Style
[assets](../assets.md)
[addAsset](../assets.md)
[addAsset](../assets.md)

### Request
[waitDelay](#waitDelay)
Expand All @@ -50,7 +50,7 @@
[failOnResourceHttpStatusCodes](#failOnResourceHttpStatusCodes)
[failOnResourceLoadingFailed](#failOnResourceLoadingFailed)
[failOnConsoleExceptions](#failOnConsoleExceptions)
[skipNetworkIdleEvent](#skipNetworkIdleEvent)
[skipNetworkIdleEvent](#skipNetworkIdleEvent)

### Formatting
[metadata](#metadata)
Expand All @@ -59,6 +59,7 @@
[pdfUniversalAccess](#pdfUniversalAccess)
[generateDocumentOutline](#generateDocumentOutline)
[generateTaggedPdf](#generateTaggedPdf)
[flatten](#flatten)

## Render

Expand Down Expand Up @@ -211,7 +212,7 @@ class YourController

Default: `0.39 inches` on all four sides

You can override the default margins, with the arguments `top`, `bottom`, `right`,
You can override the default margins, with the arguments `top`, `bottom`, `right`,
`left` and `unit`.
`unit` is optional but by default in inches.

Expand Down Expand Up @@ -997,7 +998,7 @@ class YourController

default: `None`

Return a 409 Conflict response if the HTTP status code from at least one resource
Return a 409 Conflict response if the HTTP status code from at least one resource
is not acceptable.

```php
Expand Down Expand Up @@ -1029,7 +1030,7 @@ class YourController

default: `false`

Return a 409 Conflict response if there are exceptions to load at least one resource
Return a 409 Conflict response if there are exceptions to load at least one resource
in the Chromium.

```php
Expand Down Expand Up @@ -1304,3 +1305,32 @@ class YourController
}
}
```

### flatten

Default: `false`

You may have the possibility to flatten PDF page.
It combines all its contents into a single layer, making it non-editable and
ensuring that the document's integrity is maintained.

```php
namespace App\Controller;

use Sensiolabs\GotenbergBundle\GotenbergPdfInterface;

class YourController
{
public function yourControllerMethod(GotenbergPdfInterface $gotenberg): Response
{
return $gotenberg
->html()
->content('content.html.twig', [
'my_var' => 'value'
])
->flatten() // is same as `->flatten(true)`
->generate()
;
}
}
```
Loading