HaveF / papercrop

Automatically exported from code.google.com/p/papercrop
GNU General Public License v2.0
0 stars 0 forks source link

Missing end for multipart documents #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On config.lua we find this setting:
nr_of_pages_per_pdf_book = 100;

And later on in the function "output_image" we find:
//* if (book_pages.nr_of_pages < nr_of_pages_per_pdf_book) then *//

This causes the page nr.100 never to be included in any of the files.
Changing it to <= solved the problem for me, but ideal would be if the last 
page appeared both as the last page of the 1st file and 1st page of the 2nd 
file.

Any insights?

BTW. this program is a dream. Small, concise, clear, and powerful as a rocket. 
Congratulations.
Greetings,
Eloi 

Original issue reported on code.google.com by eloi.ber...@gmail.com on 13 Apr 2011 at 11:02

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Which version are you using?
I thought I fixed this problem in a recent version by adding add_page call at 
the else block, instead of if block. 
Double inserting of the last page would be done by double calling add_page 
function  like this:

            if (book_pages.nr_of_pages < nr_of_pages_per_pdf_book) then
                book_pages:add_page(image, outdir);
            else
                book_pages:add_page(image, outdir);
                book_pages:writeToFile(outdir);
                book_pages:init_for_next_part();
                book_pages:add_page(image, outdir);
            end

Thanks,
Taesoo

Original comment by taesoob...@gmail.com on 13 Apr 2011 at 1:11

GoogleCodeExporter commented 9 years ago
The only difference between < and <= would be to which book the 100th page 
belongs. 
The above code is supposed to include the 100th page in both the previous and 
next book but hasn't tested. If this works as expected, I will make this the 
default behavior from the next version.

Original comment by taesoob...@gmail.com on 13 Apr 2011 at 1:19

GoogleCodeExporter commented 9 years ago
You're right, I switched back to "<".
And adding "else >>  book_pages:add_page(image, outdir);" works like a charm.

I'm using paperCrop_0.45_rev61 just downloaded 2 o 3 days ago.

The problem of the last half page I couldn't duplicate... so if it happens 
again I'll try to document better. That time I was using PaperCrop_0.44_rev54.
Tks again!

Original comment by eloi.ber...@gmail.com on 15 Apr 2011 at 10:58

GoogleCodeExporter commented 9 years ago

Original comment by taesoob...@gmail.com on 20 Jun 2011 at 6:17