OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How to update the Table Of Contents automatically

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
dtygel
Newbie
Newbie


Joined: 27 Jul 2010
Posts: 2

PostPosted: Tue Jul 27, 2010 4:32 am    Post subject: How to update the Table Of Contents automatically Reply with quote

Hi folks,

I created a script that generates an .odt file on the fly. It uses styles and has a Table Of Contents. Now I want people to receive this document to download as a pdf. For that, I'll use the unoconv python script.

My problem is the following: I want this pdf to have the TOC already updated. Is there a way I can do it automatically after creating the .odt file through PHP and before converting it to PDF using unoconv?

To see my script being used, take a look at this example:
http://www.fbes.org.br/farejador/catalogo/gerador_catalogo_ES_odt.php?Q3=0|numpts_pg=100|mapa=1|busca=castanha

Thanks!

daniel
Back to top
View user's profile Send private message
orangec
General User
General User


Joined: 19 Apr 2010
Posts: 8
Location: France

PostPosted: Wed Aug 04, 2010 8:56 am    Post subject: Reply with quote

Hi,

I'm also interested in this feature.

Any idea how to automatically update the Table of content?

Marc
Back to top
View user's profile Send private message
probe1
Moderator
Moderator


Joined: 18 Aug 2004
Posts: 2465
Location: Chonburi Thailand Asia

PostPosted: Wed Aug 04, 2010 7:59 pm    Post subject: Reply with quote

If you created the index with

Code:
oIndex = _
 ThisComponent.createInstance("com.sun.star.text.ContentIndex")


you update with
Code:

' update index
oIndex.update()




or -to update all-

Code:
oIndexes = ThisComponent.getDocumentIndexes()

For n = 0 To oIndexes.Count - 1
   oIndexes.getByIndex( n ).update()
Next n


Does this help?
_________________
Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs
Back to top
View user's profile Send private message Visit poster's website
orangec
General User
General User


Joined: 19 Apr 2010
Posts: 8
Location: France

PostPosted: Wed Aug 04, 2010 11:23 pm    Post subject: Reply with quote

I've just tested it and it works great for me!

Thank you very much!
Bye
Back to top
View user's profile Send private message
dagwieers
General User
General User


Joined: 29 Jul 2010
Posts: 14
Location: Belgium

PostPosted: Sat Aug 07, 2010 5:38 pm    Post subject: Reply with quote

Thanks for that information. I have now add this functionality to unoconv as well. It's still in the latest subversion tree (trunk), but will be part of the upcoming 0.4 release !
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
dtygel
Newbie
Newbie


Joined: 27 Jul 2010
Posts: 2

PostPosted: Sun Aug 08, 2010 7:21 am    Post subject: great! Reply with quote

Thanks for the suggestion, probe1, and thanks dagwieers for putting it in the next release of unoconv. I'll certainly test it and give you feedbacks if it worked!

Greetings,

daniel
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group