ScribusGenerator icon indicating copy to clipboard operation
ScribusGenerator copied to clipboard

Pagination support

Open fklosowski opened this issue 6 years ago • 4 comments

It would be great if SG would support forcing next page feature. This would enable users to generate catalogues of items where every category needs own page and in such circumstances, when there isn't enough items to fill full page. Page indicator should be in CSV file, lets say there would be special column name, like %page or something.

%page, category, item, description 1, fruits, apple, sweet 2, vegetables, potato, fresh 2, vegetables, carrot, long

In such case, apple goes to page 1 and potato, carrot goes to page 2 instead there are for example two variables defined per page.

fklosowski avatar Apr 10 '19 13:04 fklosowski

I understand the idea... but really see no way to implement such a thing in the current SG, sorry. If you want to give it a try you're welcome.

As a weak workaround maybe you could add empty lines in your csv, to match the number of items per page ? empty text frames will be removed automatically by SG... but I agree this is not really satisfactory if you have a complex design with static text or content.

berteh avatar Apr 14 '19 00:04 berteh

Well, thank you for your comment. And I want to say also thank you for your work. Yes, this workaround could be fine but after testing, I think that the main disadvantage of the whole system is XML objects order on page and %SG_NEXT-RECORD%, which plays major role in generating listings. If there is complex design, placing all the elements in right sequence may be challenging. For example I have template with five identical groups (quite simple thing: text, text, image) which I wanted to fill with rows progression of CSV data. I cloned these segments in Scribus and then tried to add %SG_NEXT-RECORD% somewhere to accomplish this task, but with no luck. So after all I had to delete all the cloned groups, add %SG_NEXT-RECORD% to the group I left and clone this updated group again to keep right order in XML which, I believe, is processed seqentially. So, sometimes the flow control is tricky. If your template is not designed with some rules in mind, there is no way to fix it, maybe by hand in XML. That's why I imagine that moving some controls to CSV would improve abilities to manipulate data.

fklosowski avatar Apr 16 '19 13:04 fklosowski

I understand the ordering problem relating to xml. there is some hints provided in the wiki at: https://github.com/berteh/ScribusGenerator/wiki#cards-deck-walkthrough

berteh avatar Apr 20 '19 20:04 berteh

Maybe this can be done by recusion. Generate a page with overflowing text hidden, generate many pages then merge all the single pages into a big pdf file.

arielmol avatar Sep 25 '19 22:09 arielmol