Categories > OpenTBS with PPTX >

Page breaks on pptx or odp presentations

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Pedro
Date: 2012-03-19
Time: 12:21

Page breaks on pptx or odp presentations

Hi!!!

First of all, I'd like to thank you for this awesome piece of software.

I'm trying to merge my data with a pptx document. The problem is I want a page per record. I've been reading about open document formats and I guess it's not possible, as in presentations documents all data will be merged in existing slides, I mean, no new slides will be created upon merge. Am I right?

What I want is to merge my 30 records data array with a PPTX with only one slide. I'd like the generated file to have 30 slides, one per record, as I can do with docx or odt. Is this possible?

Thank you very much in advance and keep the good work!

Pedro.
By: Skrol29
Date: 2012-03-19
Time: 18:35

Re: Page breaks on pptx or odp presentations

Hi Pedro,

> in presentations documents all data will be merged in existing slides, I mean,
> no new slides will be created upon merge. Am I right?

That's correct. For now, OpenTBS cannot add or delete slides in a PPTX.
Nevertheless, you can merge exactly 30 slides id you know you will have no more, no less.

> What I want is to merge my 30 records data array with a PPTX with only one slide.
> I'd like the generated file to have 30 slides, one per record, as I can do with docx or odt. Is this possible?

OpenTBS cannot merge or multiply slides in a PPTX because it is a bit complicated.
Nevertheless, you can try to manipulate the archive structure of a PPTX in order to do copy slides yourself.
Since version 3.7.5 of OpenTBS, there is a property $TBS->TbsZip that gives a hook on the TbsZip object that deals with the inner archive of the document.

TbsZip is documented here:
http://www.tinybutstrong.com/apps/tbszip/tbszip_help.html

So, there is a bit study of PPTX structure to understand how to add slides, and then it should be a piece of cake to implement it with $TBS->TbsZip.

By: Pedro
Date: 2012-03-20
Time: 08:26

Re: Page breaks on pptx or odp presentations

Thanks a lot!

The problem is I don't know how many records I have to merge (is the result of a search php+mysql).

I will try both ways:
1.- Creating a PPTX with, for example, 100 slides referencing data directly by index. Example: block.0.Employee.name (in slide 1), block.1.Employee.name. I will have to deal also with subblocks.
2.- The right way, a bit more expensive for me: using tbszip and adding/merging data by a custom program.

Thanks again for your fast response.

Regards,
Pedro.
By: Slyandi
Date: 2015-09-17
Time: 12:51

Re: Page breaks on pptx or odp presentations

Hi Guys,

As a newcomer I'd like to begin with congrats for this very nice library !

I'm using OpenTBS in the same way as pedro does : Merging an unknown number of records with a one slide template.

Of course for now I've settled for the solution number 1 in pedro's conclusion (Creating a template with a hopefully sufficient number of slides and deleting the unnesserary ones after merging), but I feel like it's a bit cheated...

The template are to be created and maintained by final users of the solution, and as you may know, users can sometimes ressent small inconvienients like this one and eventually make their final impression upon them.

So my question is :

Is the duplicate slide function on the way, or is there anyone that has made some script to do it manually (Pedro, as your last post was more than 3 years ago, I guess you got satisfied with the first solution)

Any help to give my users a documentation than does not tells them to duplicate the slide after creating their template would be so nice :D !

Thanks in advance and keep going with this great stuff !

Sylvain