openoffice-writer

How to add/insert a xml node into text

痞子三分冷 提交于 2021-02-10 11:55:36
问题 I am generating a text document in the open document format (odt) which is based on XML. But I have a problem when adding a tabulator in a text passage. When I create it in the Open Office application and save the document the passage has the internal XML representation as: <text:p text:style-name="P5">Prepared by: <text:tab/>Tim Test</text:p> When generating it automatically I come to this part in my source code: Node, Node1: IXMLNode; ... Node := Node1.AddChild('text:p'); Node.Attributes[

How to format text in pdf template with iText

好久不见. 提交于 2021-02-08 08:45:24
问题 I have created a pdf template with 'open office writer' and filled the fields with iText. In pseudo code like this: PdfReader reader = new PdfReader("C:/temp/Template.pdf"); FileOutputStream fileOutputStream = new FileOutputStream("C:/temp/TemplateTest.pdf"); PdfStamper stamper = new PdfStamper(reader, fileOutputStream); stamper.setFormFlattening(true); stamper.getAcroFields().setField("description", "This is a important description."); stamper.close(); Now I just want the word 'important' in

HTML to ODT – XSLT?

拥有回忆 提交于 2021-01-29 13:41:58
问题 I'm trying to convert single pieces of HTML code to the XML Format the *.odt format (Open Office) is using. For example, <p>This is some text</p> should be translated to <text:p>This is some text</text:p> . Of course, this should also work with lists etc. I'm not sure whether the best way to go would be using a XSLT processor (and if so, which one for Java?) and create the stylesheet myself – isn't there a Java library out there that can already do this? I'm using jodconverter to go from ODT-

openoffice: duplicating rows of a table in writer

北战南征 提交于 2020-01-14 03:26:05
问题 I need to programmatically duplicate rows of a Table in openoffice writer. It's not difficult to add rows via table.Rows.insertByIndex(idx, count) , that adds empty rows and it's easy to add text in that row assigning DataArray to the CellRange . Doing this way you loose control on the style of the cells and specifically if a cell has words with different style (bold/italic) they get flattened to the same face. What I need is to duplicate a row in a way that preserves the style of each word

How do I read a text file of about 2 GB? [duplicate]

岁酱吖の 提交于 2019-12-29 02:21:14
问题 This question already has answers here : Text editor to open big (giant, huge, large) text files [closed] (2 answers) Closed 4 years ago . I have a .txt file whose memory is more than 2 GB. The problem is I cannot open it with Notepad, Notepad++ or any other editor programs. Any solutions? 回答1: Try Glogg. the fast, smart log explorer. I have opened log file of size around 2 GB , and the search is also very fast . 回答2: WordPad will open any text file no matter the size. However, it has limited

Is there a way to programmatically construct an Open Office document from two existing documents?

六月ゝ 毕业季﹏ 提交于 2019-12-25 17:00:13
问题 I have two documents, one in Spanish and one in English (the English is a translated version of the original in Spanish). I am creating a third document from the two, which includes the Spanish on each evenly numbered page, and the corresponding English translation on the opposite odd-numbered page. I am using up the entire page on both sides except at the end of a chapter (each new chapter gets a page break, so it can start at the top of the page). Admittedly, in order to use up the entire

openoffice template startup get directory macro

☆樱花仙子☆ 提交于 2019-12-25 04:18:12
问题 I like to start a openoffice template (.ott) via my command prompt. Once my template.ott has opened it is called Untitled 1.odt What I need is way to get the location of the template.ott (the path to the directory of the template that made Untitled 1.odt). I want to use that path in a macro in Untitled 1.odt The question summarized: So when I have a macro in Untitled 1.odt, how do I get the location of the template.ott? I use OpenOffice Writer. EDIT: I write macros in Openoffice Basic. 回答1:

OpenOffice with .NET: how to iterate throught all paragraphs and read text

对着背影说爱祢 提交于 2019-12-23 16:17:57
问题 How to iterate through all paragraphs in OpenOffice Writer document and output text. I have Java examples, but don't know how to convert code to C#. Java example could be found here: http://wiki.services.openoffice.org/wiki/API/Samples/Java/Writer/TextDocumentStructure My C# code: InitOpenOfficeEnvironment(); XMultiServiceFactory multiServiceFactory = connect(); XComponentLoader componentLoader = XComponentLoader)multiServiceFactory.createInstance("com.sun.star.frame.Desktop"); //set the