Per Plugin Configuration
Since #2663788: Add support for Dompdf we now have multiple implementations of HTML to PDF engines in Entity Print. You can now store custom configuration per implementation. To do so you can implement defaultConfiguration(), buildConfigurationForm(), validateConfigurationForm(), submitConfigurationForm() to interact with the setting form at /admin/config/content/entityprint
You should also provide configuration for your custom settings, example:
entity_print_pdf_engine.dompdf:
type: mapping
label: 'Dompdf specific settings'
mapping:
enable_html5_parser:
type: boolean
label: 'Enable HTML5 parsing'
enable_remote:
type: boolean
label: 'Enable remote urls'
Detecting Plugin Dependencies
In addition, there are two new methods on the interface to detect when the PDF engine has its dependencies installed and a way to document how users should install those dependencies. See getInstallationInstructions(), dependenciesAvailable()
PDF Engine Annotation
A new annotation was introduced for storing additional information in the definition.
Before
/**
* @PluginID("dompdf")
*/
class DomPdf extends PluginBase implements PdfEngineInterface, ContainerFactoryPluginInterface
After
/**
* @PdfEngine(
* id = "dompdf",
* label = @Translation("Dompdf")
* )
*/
class DomPdf extends PluginBase implements PdfEngineInterface, ContainerFactoryPluginInterface