Menu

#24 Scaling error in document with mixed page sizes

v 3.0.0 beta
open
nobody
None
1
2019-07-07
2019-07-04
No

Im using v3.1.1 and I get this error when the document (attached simple example) contains different sized pages:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pdfbooklet/pdfbooklet.py", line 3168, in previewNext
self.preview(self.previewPage) # update the preview
File "/usr/lib/python3/dist-packages/pdfbooklet/pdfbooklet.py", line 3149, in preview
if self.render.createNewPdf(ar_pages, ar_layout, ar_cahiers, "", previewPage) :
File "/usr/lib/python3/dist-packages/pdfbooklet/pdfbooklet.py", line 4617, in createNewPdf
matrix1_s = self.calcMatrix2(0, 0, Scale = scaleFactor_f)
File "/usr/lib/python3/dist-packages/pdfbooklet/pdfbooklet.py", line 3932, in calcMatrix2
Scale_f = float(Scale)
TypeError: float() argument must be a string or a number, not 'NoneType'

1 Attachments

Discussion

  • Averell

    Averell - 2019-07-04

    Thanks a lot for this bug report. It was an unfinished function, I just forgot to write an "esle" after an "if". This is fixed in the source and will be published in the 3.1.2 version. It will be the occasion for you to tell me if the new installer is working. It will be available in ten minutes (16h00 in France)

     
  • Averell

    Averell - 2019-07-04
    • status: open --> closed
     
  • peterthevicar

    peterthevicar - 2019-07-04

    Thanks for responding so quickly. Nearly there! When I run pdfbooklet I get:

    $ pdfbooklet
    bash: /usr/bin/pdfbooklet: /usr/lib/python3: bad interpreter: Permission denied
    

    There's an error in the #! line which should say either python3 or /usr/bin/python3, not /usr/lib

    When I run

    python3 /usr/bin/pdfbooklet
    

    all is well and the mixed sizes now work as expcted. Thank you!
    However it doesn't cope with a mixture of portrait and landscape pages (see attached example)

     
  • Averell

    Averell - 2019-07-05
    • status: closed --> open
     
  • Averell

    Averell - 2019-07-05

    Hello, normally all should be fixed in the last release. I didn't change the version, so dowload and install again and tell me.
    I added something : after fixing the bug, your page 2 (red rectangle) was correct, but appeared at the bottom of the page. Ithought it would be better to have it centered. This is the case. Perhaps you could test with different pages configuration (larger, smaller, portrait, landscape... A test pdf would be very useful to tune this feature and I don't have a Pdf Editor.
    Thanks

     
  • peterthevicar

    peterthevicar - 2019-07-06

    Thank you, this is much better and produces a printable and readable result. Yay!

    Feature request: The ideal would be to auto rotate and scale the pages. I can do that manually using the 'Page transformations' tab. Documents with financial data often have lots of portrait pages for information then landscape for the spreadsheets so it could be time-consuming for a large file.

    Just to note that if in 'Output size' you select 'Automatic', and NOT 'Auto scale', it scales the portrait page but not the landscape page.

    To create my test pdfs I just use LibreOffice and its export as pdf function. I'm happy to create something if you let you know what would be useful.

     
  • Averell

    Averell - 2019-07-06

    See the 3.1.3a attached. There was the question of the rotation direction. I made it clockwise.
    Also, creating a feature is 10% of the time (just mathematics), designing the corresponding interface takes the remaining 90%...
    So I just added the feature, which means that AutoRotate and AutoScale are linked together (or both or none). Later I could add the necessary checkbox to allow the user to choose.

    "Just to note that if in 'Output size' you select 'Automatic', and NOT 'Auto scale', it scales the portrait page but not the landscape page."
    Well, the bug is that ... it should not scale the portrait ! Automatic here, is only automatic choice for the output page size. I'll see that.

    test pages : it would be fine it you added some pages to your test2.pdf :

    • A5 (portrait and landscape)
    • A3 (portrait and landscape)
    • personalized, near square size (20 x 22 for example)
    • personalized narrow (10 x 30 for example).

    And then you can test and tell me what happens. There will surely be some errors.

     
  • peterthevicar

    peterthevicar - 2019-07-06

    Hero! That seems to have sorted it just as I would want, thank you so much for doing it so quickly!

    I've produced the attached test file to your specification and you can see for some cases it doesn't do so well. In this example parts of pages 4 and 5 are off the page in the booklet. On the other hand I can't imagine any actual real-life examples like this!

    I've got a much more minor feature request so will put on a separate ticket so you have the joy of closing it one day :)

     

    Last edit: peterthevicar 2019-07-06
  • Averell

    Averell - 2019-07-07

    Thank you for the test file.
    Fixed : just a missing (* Scale)
    see attached file

     
  • peterthevicar

    peterthevicar - 2019-07-07

    That fixed it for me, well done indeed!

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB