You are here

public function BackendProxyInterface::merge in FillPDF 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Service/BackendProxyInterface.php \Drupal\fillpdf\Service\BackendProxyInterface::merge()

Merge data into a PDF using the supplied form configuration and entities.

Parameters

\Drupal\fillpdf\FillPdfFormInterface $fillPdfForm: The form configuration to use. Will be processed the same way as the fillpdf.populate_pdf route, including replacements, token mappings, etc.

\Drupal\Core\Entity\EntityInterface[][] $entities: The entity data to use. The entities should be keyed by entity type. Under each key, there should be an array of entities keyed by their IDs.

array $mergeOptions: Configure how the merge should work. Valid keys are:

  • sample: (boolean, default: FALSE) whether to output a sample PDF
  • flatten: (boolean, default: TRUE) whether the merged PDF should have its fields made permanent and no longer editable.

It is safe to pass in a FillPDF $context array. Merge options are a subset of that.

Return value

string The merged PDF data.

1 method overrides BackendProxyInterface::merge()
BackendProxy::merge in src/Service/BackendProxy.php

File

src/Service/BackendProxyInterface.php, line 36

Class

BackendProxyInterface
The backend proxy allows backend-agnostic PDF operations.

Namespace

Drupal\fillpdf\Service

Code

public function merge(FillPdfFormInterface $fillPdfForm, array $entities, array $mergeOptions = []) : string;