Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self.image() error when centering image and add_page() is called #199

Open
MCilento93 opened this issue Jun 22, 2022 · 1 comment
Open

Comments

@MCilento93
Copy link

With current version when adding new image at given x location, if a new page is required because of image sizing, the new x is wrong.
I figured it by wrapping the 'image' method (I forced the pdf.x variable to be always the one correct):

    def insert_image(self,img_path,desired_img_w=100):
        self.ln()
        x_img=(self.w-desired_img_w)/2
        self.x=x_img
        self.image(img_path,w=desired_img_w,x=x_img)
        self.ln()
@MCilento93 MCilento93 changed the title self.image() wrong x location when adding a page self.image() error when centering image and add_page() is called Jun 22, 2022
@Lucas-C
Copy link

Lucas-C commented Jul 8, 2022

pyfpdf is not maintained anymore, have you tried using fpdf2?
https://pyfpdf.github.io/fpdf2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants