Giter Club home page Giter Club logo

Comments (8)

blaketeres avatar blaketeres commented on August 17, 2024

Having the same issue.

from fpdf2.

blaketeres avatar blaketeres commented on August 17, 2024

A quick fix for me was to add this method to my class. Looks like something is passing RGBA values normalized in the range 0-1 (rather than RGB 0-255) to set_fill_color.

from fpdf import FPDF


class MyPDF(FPDF):
    def set_fill_color(self, *args, **kwargs):
        try:
            super().set_fill_color(*args, **kwargs)
        except Exception:
            super().set_fill_color(*[x * 255 for x in args[:3]])

from fpdf2.

Lucas-C avatar Lucas-C commented on August 17, 2024

What version of fpdf2 are you using @blaketeres & @mohindra9211?
You can see it by running pip freeze

And have you checked if this bug is still present when using the latest version from the master branch of this repo?
You can install it this way:

pip install git+https://github.com/py-pdf/fpdf2.git@master

I think this may be a duplicate of #963 fixed by #964

from fpdf2.

mohindra9211 avatar mohindra9211 commented on August 17, 2024

What version of fpdf2 are you using @blaketeres & @mohindra9211? You can see it by running pip freeze

And have you checked if this bug is still present when using the latest version from the master branch of this repo? You can install it this way:

pip install git+https://github.com/py-pdf/fpdf2.git@master

I think this may be a duplicate of #963 fixed by #964

I am using FPDF2 version 2.7.6

from fpdf2.

Lucas-C avatar Lucas-C commented on August 17, 2024

I am using FPDF2 version 2.7.6

OK, then you are very likely affected by this bug that has been resolved.

Have you tried installing the latest version of fpdf2 from the master branch?

I tested @mohindra9211 code and with this latest version, there is no error raised.

from fpdf2.

blaketeres avatar blaketeres commented on August 17, 2024

Yep, works when using master branch. Thanks for the response and I'll await the next release.

from fpdf2.

mohindra9211 avatar mohindra9211 commented on August 17, 2024

I am using FPDF2 version 2.7.6

OK, then you are very likely affected by this bug that has been resolved.

Have you tried installing the latest version of fpdf2 from the master branch?

I tested @mohindra9211 code and with this latest version, there is no error raised.

Thanks for solving this issue and please update it to the latest version of fpdf2.

from fpdf2.

Lucas-C avatar Lucas-C commented on August 17, 2024

Thank you for your feedbacks

Now closing this

from fpdf2.

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.