Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8188555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:57:13+00:00 2026-06-07T02:57:13+00:00

I’m using dompdf to generate a PDF file. In the file I’m including an

  • 0

I’m using dompdf to generate a PDF file. In the file I’m including an image that is generated on the fly by PHP by using;

<img src="image.php" />

When I view the page I can see an error saying “Image not found” which links to the supposedly not found image which displays fine when you click on it.

I’ve tried adding a .png extension to the page generating the image but that doesn’t make any difference. I’ve also saved the generated image to the server and linked to that instead and it works fine.

The only method I can think of to solve this is to save the image on the server and then link to that. Ideally, I don’t want to do this so I was wondering if anybody had come across this before or if anyone can think of a fix for it.

The version of dompdf I’m using is 0.6.0 beta 3 and I’m using it with CodeIgniter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:57:15+00:00Added an answer on June 7, 2026 at 2:57 am

    How are you loading your HTML document into dompdf? $dompdf->load_html()? $dompdf->load_html_file()? To access a PHP-generated image you should be using the latter. Additionally, unless you are loading the document through a web server dompdf will grab the file itself, not the rendered file. Since image.php is not a valid image type dompdf will fail to load it.

    There are two solutions:

    1. Load your document through your web server, e.g. $dompdf->load_html_file('http://example.com/mydoc.html');. When you do this the image reference will be interpreted as http://example.com/image.php.
    2. Reference your image using a full URL (including domain) so that your server processes it before sending it back to dompdf, e.g. <img src="http://example.com/image.php" />.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to create an if statement in PHP that prevents a single post
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.