Coder Social home page Coder Social logo

Comments (6)

LittleBigFox avatar LittleBigFox commented on August 27, 2024 6

Hi!

I'd the same problem, just replace the tcpdf/include/tcpdf_static.php function file_exists (L1879 in tcpdf 6.3.4) like this:

public static function file_exists($filename) {

if (preg_match('|^https?://|', $filename) == 1) {
    return self::url_exists($filename);
} 

if(stripos($filename,'data:')===0) {
    return true;
}

if (strpos($filename, '://')) {
      return false; // only support http and https wrappers for security reasons
}

return @file_exists($filename);

}

from tcpdf.

detook avatar detook commented on August 27, 2024 3

Do this
<img src="@/9j/4AAQ....
instead of
<img src="data:image/png;base64,/9j/4AAQ....

from tcpdf.

compojoom avatar compojoom commented on August 27, 2024 2

@detook solution works, but so is @LittleBigFox's if one is ok with modifying the static file.

I personally find it very sad that we have to add an @ instead of the default:

data:image/png;base64

I've created a PR with @LittleBigFox's fix:
#671

from tcpdf.

Vitexus avatar Vitexus commented on August 27, 2024 1

spipu/html2pdf#413

from tcpdf.

clickmeplz avatar clickmeplz commented on August 27, 2024 1

Version 6.2.21 works fine in local and server. I have 6.3.2 and render Ok in local and not works in server.
Above solution not working for me. I checked with 6.3.2 and 6.4.4

from tcpdf.

eliel-jr avatar eliel-jr commented on August 27, 2024

I'm testing versions: v6.3.4, v6.3.3, v6.3.2, v6.3.1, v6.3.0, v6.2.26, v6.2.25, v6.2.23, v6.2.22 and all broken

in v6.2.21 render OK.

from tcpdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.