php - How to set page sizing of pdf with Knp Snappy bundle

one text

Solution:

There are several flags you can set within options:

$options = [
  'page-size' => 'A1',
  'margin-top' => 10,
  'margin-right' => 10,
  'margin-bottom' => 10,
  'margin-left' => 10,
];

$this->container->get('knp_snappy.pdf')->generateFromHtml(
  $this->templating->render(
    $twigInclude,
    [
      'htmlFiles' => $htmlFiles,
      'headlines' => $headlines,
    ]
  ),
  $folderHistory . '/reports/' . $filename . '.pdf',
  $options,
  true // this flag will overwrite existing file
);

Source