| View previous topic :: View next topic |
| Author |
Message |
dtygel Newbie

Joined: 27 Jul 2010 Posts: 2
|
Posted: Tue Jul 27, 2010 4:32 am Post subject: How to update the Table Of Contents automatically |
|
|
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 |
|
 |
orangec General User

Joined: 19 Apr 2010 Posts: 8 Location: France
|
Posted: Wed Aug 04, 2010 8:56 am Post subject: |
|
|
Hi,
I'm also interested in this feature.
Any idea how to automatically update the Table of content?
Marc |
|
| Back to top |
|
 |
probe1 Moderator


Joined: 18 Aug 2004 Posts: 2465 Location: Chonburi Thailand Asia
|
Posted: Wed Aug 04, 2010 7:59 pm Post subject: |
|
|
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 |
|
 |
orangec General User

Joined: 19 Apr 2010 Posts: 8 Location: France
|
Posted: Wed Aug 04, 2010 11:23 pm Post subject: |
|
|
I've just tested it and it works great for me!
Thank you very much!
Bye |
|
| Back to top |
|
 |
dagwieers General User


Joined: 29 Jul 2010 Posts: 14 Location: Belgium
|
Posted: Sat Aug 07, 2010 5:38 pm Post subject: |
|
|
| 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 |
|
 |
dtygel Newbie

Joined: 27 Jul 2010 Posts: 2
|
Posted: Sun Aug 08, 2010 7:21 am Post subject: great! |
|
|
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 |
|
 |
|