I want to create a pdf file in magento 2.

For that I'm using dompdf from weprovide.

Pdf was generating perfectly but the image was missing. Instead of showing the image it shows an 'Image not found or type unknown'.

enter image description here

I've checked the HTML code that was passed to the dompdf, which has proper image link.

While I'm searching for this issue, somewhere they are mentioned to set options(isRemoteEnabled) for the PDF. Link

So can you help me to solve this issue.

If I want to set options in dom pdf means, how can I integrate that options in weprovide/dompdf code.

Thanks in advance.


I've solved this issue by enabling the RemoteEnabled option.

Updated Code:

namespace WeProvide\Dompdf\Controller\Result;

use Dompdf\Dompdf as PDF;
use Dompdf\Options as Options;

class Dompdf extends AbstractResult
    public $pdf;
    public $options;

     * Dompdf constructor.
    public function __construct(PDF $domPdf,Options $options)  {
        $this->pdf = $domPdf;
        $this->options = $options;

     * Set Option
    public function setRemoteOption()  {


I've enabled the remote and then set the option for DOM pdf.

I hope this will helpful for someone.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.