I want to create a pdf of the node page with its content and images when a node is deleted. Currently I have achieved this.I am getting the content and the images. The problem is I want the exact design of the node page. I am rendering the node by
$entity = Drupal::entityTypeManager(); $view_builder = $entity->getViewBuilder('node'); $build = $view_builder->view($node); $output = Drupal::service('renderer')->render($build);
The output is coming from node.html.twig whereas the actual twig file should be node–content-type–full.html.twig I am using Dompdf to create and store the pdf
$options = new Options(); $options->setIsHtml5ParserEnabled(true); $options->set('isRemoteEnabled', TRUE); //PDF Creation $dompdf = new Dompdf($options); $dompdf->load_html($node_html); $dompdf->set_paper('A4', 'portrait'); $dompdf->render();
How will I get the exact design of the node page on pdf