Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.

CTS 3 - Missing code

  • 0 Replies

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 823
    • View Profile
CTS 3 - Missing code
« February 26, 2017, 11:10:02 PM »
This thread is for listing apparently unimplemented code (currently dummy stubs) that was forgotten by someone.

To start:

In lib/PDF/API2/Basic/, there is a method rebuild_tree() that claims to rebuild (rebalance) the tree to meet Adobe specifications. Unfortunately, the code is empty.
Code: [Select]
=head2 $root_pages = $p->rebuild_tree([@pglist])

Rebuilds the pages tree to make a nice balanced tree that conforms to Adobe
recommendations. If passed a pglist then the tree is built for that list of
pages. No check is made of whether the pglist contains pages.

Returns the top of the tree for insertion in the root object.

It doesn't appear to return anything, for that matter, so better not try using it…
Code: [Select]
sub rebuild_tree {
    my ($self, @pglist) = @_;

Apparently, the unbalanced trees are still legal, just not efficient. I'm not sure this method is called, anyway (but is mentioned in add_page()). I'll add a warning in the POD.

Update for 3.015: remove (comment out) all mention of rebuild_tree()
« Last Edit: May 10, 2019, 03:03:11 PM by Phil »