You are here

public function EntityPrintPdfBuilder::getEntityRenderedAsHtml in Entity Print 8

Get a HTML version of the entity as used for the PDF rendering.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The content entity to render.

bool $use_default_css: TRUE if you want the default CSS included, otherwise FALSE.

bool $optimize_css: TRUE if you the CSS should be compressed otherwise FALSE.

Return value

string The rendered HTML for this entity, the same as what is used for the PDF.

Overrides PdfBuilderInterface::getEntityRenderedAsHtml

File

src/EntityPrintPdfBuilder.php, line 77

Class

EntityPrintPdfBuilder

Namespace

Drupal\entity_print

Code

public function getEntityRenderedAsHtml(EntityInterface $entity, $use_default_css = TRUE, $optimize_css = TRUE) {
  return $this->rendererFactory
    ->create($entity)
    ->getHtml($entity, $use_default_css, $optimize_css);
}