can we delete slides with multiple range using opentbs?

77 views Asked by At

currently we are doing this, which is working fine, but i was trying to delete slide with multiple range

 $slides_to_deletea = range(3, $num_slides);   
 $TBS->PlugIn(OPENTBS_DELETE_SLIDES, $slides_to_deletea);

can we delete multiple slide from different range

$slides_to_deletea = range(3, 5);
$slides_to_deletea = range(8, 12);

i tried this https://www.tinybutstrong.com/opentbs.php?doc#opentbs_delete_sheets

and also i was wondering if we can merge slides after deleting?

1

There are 1 answers

0
Skrol29 On BEST ANSWER

can we delete multiple slide from different range

Yes.

Example #1

$slides_to_deletea = range(3, 5);  
$TBS->PlugIn(OPENTBS_DELETE_SLIDES, $slides_to_deletea);

// continue to merge as you wish hereā€¦

$slides_to_deletea = range(8, 12);
$TBS->PlugIn(OPENTBS_DELETE_SLIDES, $slides_to_deletea);

Example #2

$slides_to_deletea = range(3, 5);  
$slides_to_deletea = array_merge($slides_to_deletea, range(8, 12));
$TBS->PlugIn(OPENTBS_DELETE_SLIDES, $slides_to_deletea);

and also i was wondering if we can merge slides after deleting?

Yes. When you use OPENTBS_DELETE_SLIDES, slides are only marked to be deleted. And slides (as well as sheets) are actually deleted during the final merging process only. That is when you call Show(). This enables you to undo a delete, and also to keep the numbering of slides after a delete, so that you can continue to drive the merging as you wish using a constant numbering.