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

Writer: Java Code snips for doing everything in writer

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets
View previous topic :: View next topic  
Author Message
kaushalc
General User
General User


Joined: 12 Jul 2009
Posts: 31

PostPosted: Thu Jun 10, 2010 4:48 am    Post subject: Writer: Java Code snips for doing everything in writer Reply with quote

I am involved in a large project on exporting content to writer. As a part of this project I have collected code from this form to perform various operations in writer like adding lists, setting page styles, adding images etc. Thought I would share it with the community. Hope it helps.

OO Developer API guide -- http://api.openoffice.org/docs/DevelopersGuide/DevelopersGuide.x html
Fast XML Parser -- http://wiki.services.openoffice.org/wiki/FastParser
OO SDK Download -- http://api.openoffice.org/docs/DevelopersGuide/DevelopersGuide.x html
Managing Text documents -- http://api.openoffice.org/docs/DevelopersGuide/Text/Text.xhtml
API to insert / edit Lists Bullets Called as Paragraph Numbering in OO -- http://api.openoffice.org/docs/DevelopersGuide/Text/Text.xhtml#1 _4_3_Line_Numbering_and_Outline_Numbering
Different Numbering styles -- http://api.openoffice.org/docs/common/ref/com/sun/star/style/Num beringType.html
Automatically create a paragraph style named code -- http://codesnippets.services.openoffice.org/Writer/Writer.Automa ticallyCreateAParagraphStyleNamedCode.snip
Paragraph Properties -- http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ Text/Formatting
Drawing Shapes OO API Class -- http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/m odule-ix.html
OO API Working with poly line shapes -- http://wiki.services.openoffice.org/wiki/Working_with_Shapes
Code that shows how to set page styles -- http://www.oooforum.org/forum/viewtopic.phtml?t=12311
Code to set page orientation -- http://www.oooforum.org/forum/viewtopic.phtml?t=16359
Code to set page height and width -- http://old.nabble.com/Change-page-height,-width-and-margins.-JAV A,-OPENOFFICE-3-td21892824.html
Code to set header footer -- http://www.oooforum.org/forum/viewtopic.phtml?t=66018
Code to set header/footer right, center and left text -- http://www.oooforum.org/forum/viewtopic.phtml?t=9830
Code to add page numbering in header -- http://codesnippets.services.openoffice.org/Writer/Writer.AddPag eNumbering.snip
Class that gives enum for page background image positioning - center, tile or stretch -- http://api.openoffice.org/docs/common/ref/com/sun/star/style/Gra phicLocation.html
Code to set Table or Page border line styles like width, colour etc -- http://www.oooforum.org/forum/viewtopic.phtml?t=32584
Code for TOC -- http://www.oooforum.org/forum/viewtopic.phtml?t=32886, http://markmail.org/download.xqy?id=a5emn2nfa5n5lqhb&number= 1.
Code for finding a TOC inside a document if it already exists -- http://www.oooforum.org/forum/viewtopic.phtml?t=41095
LINKS FOR IMAGE RELATED ISSUES
All Enums for image positioning
http://api.openoffice.org/docs/common/ref/com/sun/star/text/Text ContentAnchorType.html
http://api.openoffice.org/docs/common/ref/com/sun/star/text/Wrap TextMode.html
http://api.openoffice.org/docs/common/ref/com/sun/star/text/Hori Orientation.html
http://api.openoffice.org/docs/common/ref/com/sun/star/text/Vert Orientation.html
http://api.openoffice.org/docs/common/ref/com/sun/star/text/RelO rientation.html
Text graphics object properties
http://api.openoffice.org/docs/common/ref/com/sun/star/text/Text GraphicObject.html
Code for image alignment and orientation and text wrap: http://www.oooforum.org/forum/viewtopic.phtml?p=335094#335094
Code to insert Image but not as a link --http://codesnippets.services.openoffice.org/Writer/Writer.EmbedAGraphicIntoATe xtdocument.snip
Code to add IMAGE from a byte array -- http://www.oooforum.org/forum/viewtopic.phtml?t=81870
Nice discussion on getting images , text fields etc from a doc - http://www.oooforum.org/forum/viewtopic.phtml?t=3125
Add custom properties to Para -- http://www.oooforum.org/forum/viewtopic.phtml?t=23961
CREATE CHART AND INSERT INTO writer DOCUMENTS --- http://www.oooforum.org/forum/viewtopic.phtml?t=61911
delete empty pages in a writer document -- http://www.oooforum.org/forum/viewtopic.phtml?t=20309
Nice quick Tutorial on SAX parsers -- http://www.saxproject.org/quickstart.html
Shapes sample - http://www.oooforum.org/forum/viewtopic.phtml?t=70065
New!!! Custom shape drawing class -- http://api.openoffice.org/docs/common/ref/com/sun/star/drawing/X EnhancedCustomShapeDefaulter.html
Custom Shapes sample in C++ - http://docs.go-oo.org/xmloff/html/ximpcustomshape_8cxx-source.ht ml </br />
Code to find text frames in addId process also has finding lists --http://old.nabble.com/Finding-text-frames-in-selected-textrange-td23962545.htm l
Code to get the text frames in a doc -- http://www.oooforum.org/forum/viewtopic.phtml?t=72742
? -- http://dev.plutext.org/trac/docx4j/wiki/DevEnv
Smples for ? -- http://dev.plutext.org/trac/docx4j/browser/trunk/docx4j/src/main /java/org/docx4j/samples
Another sample -- http://osdir.com/ml/user-poi.apache.org/2009-05/msg00040.html
Apache POI -- http://poi.apache.org/
MS API for reading OOXML -- http://openxmldeveloper.org/archive/2007/06/06/1640.aspx
Sample programs using MS .Net API -- http://blogs.msdn.com/erikaehrli/archive/2007/06/04/announcing-t he-new-open-xml-object-model.aspx
One more OOXML sample -- http://www.infoq.com/articles/cracking-office-2007-with-java
Super code for iterating over a document and examining each para and its portions --http://wiki.services.openoffice.org/wiki/API/Samples/Java/Writer/TextDocumentS tructure
Samples for different Writer API -- http://wiki.services.openoffice.org/wiki/Category:Writer/API
Code for setting table's column width -- http://www.oooforum.org/forum/viewtopic.phtml?t=14213&highli ght=table+column+width
API call to get height of a table row -- http://api.openoffice.org/docs/common/ref/com/sun/star/table/Tab leRow.html
Back to top
View user's profile Send private message Send e-mail
Corfy
Moderator
Moderator


Joined: 14 Jun 2005
Posts: 1117
Location: Near Indianapolis, IN, USA

PostPosted: Thu Jun 10, 2010 5:34 am    Post subject: Reply with quote

This post has a lot of great information, and despite all the links, is not a spam post, so as promised, I won't delete it this time. Embarassed

Thanks for re-posting. And I apologize again for deleting it the first time.
_________________
Laugh at life or life will laugh at you.
Back to top
View user's profile Send private message Visit poster's website
hanland
General User
General User


Joined: 01 Jul 2009
Posts: 6

PostPosted: Sun Aug 22, 2010 5:30 am    Post subject: Reply with quote

I have a problem where I have a template document which contains a table. Using java on a server instance of open office i want to make a copy of the table and paste it into the template a veriable number of times.

Do you have any ideas on this, or any pointers to examples etc.

Thanks in advance
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 Code Snippets 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