Elderl23 / pyfpdf

Automatically exported from code.google.com/p/pyfpdf
GNU Lesser General Public License v3.0
0 stars 0 forks source link

v1.7.1 Flowing image #48

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I like the new feature of flowing images in version 1.7.1.

But in flowing mode the x-position is in the current implementation 
overwritten. Is it possible to keep the x-position?

I fixed the problem for me by commenting the corresponding lines as you can see 
here:

    def image(self, name, x=None, y=None, w=0,h=0,type='',link=''):
        # ...
        # Flowing mode
        if y is None:
            if (self.y + h > self.page_break_trigger and not self.in_footer and self.accept_page_break()):
                #Automatic page break
                #x = self.x
                self.add_page(self.cur_orientation)
                #self.x = x
            y = self.y
        #...

I mean the page break is realted to the y-position, but has nothing to do with 
the x-position, right?

Original issue reported on code.google.com by dieterle...@gmail.com on 14 Feb 2013 at 7:03

GoogleCodeExporter commented 8 years ago
This code is preserving the x position, commenting it will disable that feature

does add_page() reset the x value?

if you can, please attach some sample PDF with and without the desired 
behaviour.

what does the original library?

Original comment by reingart@gmail.com on 14 Feb 2013 at 7:50