Need python code for adding TOC, defining styles for Heading 1

asked 2018-06-24 20:44:13 +0100

tshrinivasan gravatar image

I am exploring Python UNO for automating ebooks making using LibreOffice for FreeTamilEbooks.com

The workflow is as below. 1. Authors send us word file and a cover image 2. We should mark all chapter heading as "Heading 1, Heading 2" etc

Then a python script should do the following

  1. Add cover image in first page
  2. Change all content font to "Vijaya" (a Tamil language font) and size 12
  3. Change all Heading1 to font size 16, set blue color, add a red line below it
  4. Add footer and add page number ( I have code for this)
  5. Add Table of Content in page 3
  6. Save as PDF ( I have code for this)

Please help to get it done using python. Guide me the required components, properties to use with python.

Thanks.

edit retag flag offensive close merge delete

Comments

Kindly make an attempt to write the code first before asking, and then post relevant parts of your code. Also, there is a great deal of information about these things already online. Edit the question to mention what you have found. See the first bullet point under guidelines for asking.

Jim K gravatar imageJim K ( 2018-06-25 22:19:05 +0100 )edit

Your requirement looks like the definition of styles or template. Apart from your desire to learn Python LO code, wouldn't it be simpler to send a template to authors, even if many use M$ Office?

ajlittoz gravatar imageajlittoz ( 2018-06-26 07:53:52 +0100 )edit