Why can I not open my pdf made with a HTML 2 pdf converter?

Viewed 108

I am trying to open a pdf on my pc that I made with an HTML 2 pdf converter, but I get the error:

 The document contains content that is not tagged in the code.

I can't open the pdf in Google Chrome either. But in Firefox, I can open it and the content is correct. If I send it to someone with a mac, than he can also open the pdf without any problems and the content is correct.

Operating system on which the code runs: Cent OS 7.

Composer package: spiritix/php-chrome-html2pdf.

Code:

<?php

use Spiritix\Html2Pdf\Converter;
use Spiritix\Html2Pdf\Input\UrlInput;
use Spiritix\Html2Pdf\Output\DownloadOutput;

$input = new UrlInput();
$input->setUrl('https://www.google.com');

$converter = new Converter($input, new DownloadOutput());

$converter->setOption('landscape', true);

$converter->setOptions([
    'printBackground' => true,
    'displayHeaderFooter' => true,
    'headerTemplate' => '<p>I am a header</p>',
]);

$output = $converter->convert();
$output->download('google.pdf');

Any idea what can be causing this? Is this a Chromium issue, library issue or a system issue?

0 Answers
Related