berteh / ScribusGenerator

Create beautiful documents with data. Open source pdf (and Scribus) template and mail-merge alternative.
http://berteh.github.io/ScribusGenerator/
MIT License
247 stars 37 forks source link

Generator creates duplicate items on first page #183

Closed garydale closed 2 years ago

garydale commented 3 years ago

As I noted at the end of my report on issue 182, the generator is giving me duplicate items on the first generated page. While in my earlier report, this was annoying, in the last item I "generated", each page had a few dozen PDF annotations. After spending considerable time getting each annotation to link to the correct page, I was confused when the links all seemed to go to page 1 in the exported PDF.

I quickly figured out that it was the duplicate items problem. Although I was editing the top annotation, the export to PDF seemed to move it below the unedited one. And since they were in the same position, I had to select each one of the top ones (in the Scribus document) and move them aside before selecting the bottom ones to delete so that the PDF export would produce the desired results.

I don't recall either of my problem reports from the previous time I used generator (once a year). It is possible it's related to the move to Python 3.... Or it may just be the version of Scribus (1.5.6.1). Whatever the reason, it's giving me a lot of problems this year.

berteh commented 2 years ago

Hi Gary. Sorry to read about these difficulties.

Elements of multiple copies 'moving' to unexpected places when using the 'next record' feature is usually due to these elements being located at an unexpected place (sequence) in the source SLA document... defined by the order in which the frames where created in the template document, and not by their actual graphical position if you later move them up or down.

It is (sometimes) possible to fix it by grouping the 'moving' frame with another frame that is duplicated at the right place, or (always) by moving the frame element code in the SLA file code to a better place. But I agree that's not user friendly, sorry!

I'd be happy to have a closer look at your template to try to find a better way to implement the multiple copies mechanism, that would not rely on the source code sequence... maybe at the cost of running a little bit slower.

berteh commented 2 years ago

The porting to Python3 introduced indeed some bugs in the items generation, sorry. These but should have been fixed in the January commits. Kindly update your script, test, and let me know if this is now resolved for you !