Table of Contents
1: LibreOffice or OpenOffice with Java, C++, C#, VB.NET, Python, JavaScript, and/or so on |
Via UNO, not Microsoft COM. From inside (macros) and/or outside (external programs). The GUI and/or key bindings augmented. Call 'soffice'? |
2: UNO, Its Essence and Its Relationship to LibreOffice or OpenOffice |
UNO isn't just a peripheral interface for LibreOffice or OpenOffice. A poor understanding of its essence and implications may be confining you. |
3: Basic Elements of UNO |
Slave is anyone who blindly accepts someone's decisions. You make your decisions based on your knowledge. Learning the basics is the starting point. |
4: Deciphering the Official Documents of LibreOffice or OpenOffice |
We may and should admit that they are not well-written. A culprit is the lax terminology used there, which will be disentangled here. |
5: Building an Environment for Developing UNO Programs in Linux |
For developing macros, external UNO programs, and/or UNO extensions in Java, C++, and/or Python. |
6: Building an Environment for Developing UNO Programs in Windows |
For developing macros, external UNO programs, and/or UNO extensions in Java, C++, .NET Framework (usually C# and/or Visual Basic.NET), and/or Python. |
7: Building Any Sample Project of This Site |
Have gotten a sample project from this site? Here is how to build the project. |
8: Making the LibreOffice or Apache OpenOffice Instance a UNO Server |
Start an acceptor of TCP/IP socket or named pipe in order to read/write an office document or handle the instance via UNO from your external program. |
9: 'Hi, Console Java UNO Clients', a Sample |
Connecting your program to the LibreOffice/OpenOffice instance (or any UNO server), in order to read/write an office document or handle the instance. |
10: 'Hi, GUI Java UNO Clients', a Sample |
Connecting your program to the LibreOffice/OpenOffice instance (or any UNO server), and detecting the disconnection. |
11: 'Hi, Console C++ UNO Clients', a Sample |
Connecting your program to the LibreOffice/OpenOffice instance (or any UNO server), in order to read/write an office document or handle the instance. |
12: Execute UNO Dispatch Command and Get All Information in Java |
Your lazy way may be missing some useful information that is available from the execution. |
13: How Any 'soffice' or 'soffice.exe' Execution Works |
Um? Why does this 'soffice' invocation return immediately? Well, why is this invocation so slow? |
14: 'Hi, Console C# UNO Clients', a Sample |
Likewise for VB.NET. Connecting your program to the LibreOffice/OpenOffice instance, in order to read/write an office document or handle the instance. |
15: How to Optimally Use LibreOffice or Apache OpenOffice as a Files Converter, Part 1 (the Concept) |
'soffice --convert-to' from a program is inefficient and restrictive. No need for any 3rd-party tool. A better way. Applicable to also OpenOffice. |
16: Optimally Use LibreOffice as a Files Converter (a Java Implementation) |
Between OpenDocument/Microsoft Office/etc. formats and to the PDF/CSV format, fast and versatile with the document possibly tweaked. A workable sample. |
17: An Attempt to Structurize LibreOffice/OpenOffice Basic Code |
LibreOffice/OpenOffice Basic does not allow creating class. Here is an attempt to structurize one's Basic code nevertheless. |
18: Optimally Use LibreOffice as a Files Converter (a C++ Implementation) |
Between OpenDocument/Microsoft Office/etc. formats and to the PDF/CSV format, fast and versatile with the document possibly tweaked. A workable sample. |
19: Untold or Incorrectly Told Basics of LibreOffice Basic |
I cannot find any document that satisfactorily addresses some of my basic concerns about LibreOffice/OpenOffice Basic. Such concerns are tackled here. |
20: Optimally Use LibreOffice as a Files Converter (a C# Implementation) |
Between OpenDocument/Microsoft Office/etc. formats and to the PDF/CSV format, fast and versatile with the document possibly tweaked. A workable sample |
21: Execute UNO Dispatch Command and Get All Information in C++ |
Your lazy way may be missing some useful information that is available from the execution. |
22: Execute UNO Dispatch Command and Get All Information in C# |
Your lazy way may be missing some useful information that is available from the execution. |
23: Encrypt an Office File with Opening Password from Program |
Encrypt any OpenDocument 'odt', 'ods', or 'odp' file or Microsoft Office 'doc', 'docx', 'xls', 'xlsx', or 'pptx' file from your program. |
24: Execute UNO Dispatch Command and Get All Information in Basic |
In LibreOffice or Apache OpenOffice Basic. Your lazy way may be missing some useful information that is available from the execution. |
25: Creating a LibreOffice or Apache OpenOffice Daemon |
As a files conversion server, etc.. One that doesn't brutally kill the office instance together with the ongoing user requests. With a workable sample |
26: Creating a LibreOffice or Apache OpenOffice Windows Service |
As a files conversion server, etc.. One that doesn't brutally kill the office instance together with the ongoing user requests. With a workable sample |
27: Spread Sheet to CSV File in Any Format from Your Program |
Writing in a 'tab-separated value', 'fixed-length record', 'text-value-quoted', and/or so on format, using LibreOffice or Apache OpenOffice and UNO. |
28: 'Hi, Console Python UNO Clients', a Sample |
Connecting your program to the LibreOffice/OpenOffice instance (or any UNO server), in order to read/write an office document or handle the instance. |
29: Optimally Use LibreOffice as a Files Converter (a Python Implementation) |
Between OpenDocument/Microsoft Office/etc. formats and to the PDF/CSV format, fast and versatile with the document possibly tweaked. A workable sample. |
30: Dismiss 'soffice --convert-to' and Directly Use the UNO API |
'soffice --convert-to' is good for only some limited cases. Why, with some diagrams. Fortunately, we can directly use the UNO API, instead, easily. |
31: Open/Convert Password-Encrypted File with LibreOffice UNO |
Any OpenDocument 'odt'/'ods'/etc. file, any Microsoft Office 'doc'/'docx'/'xls'/'xlsx'/etc. file, or any PDF file. Applicable also to OpenOffice. |
32: Use Any Text Editor Instead of the LibreOffice Basic IDE |
It is not just imagination that the LibreOffice or Apache OpenOffice Basic IDE is not-so-un-clumsy. You do not have to use it. |
33: Optimally Use LibreOffice as a Files Converter (a Basic Implementation) |
Between OpenDocument/Microsoft Office/etc. formats and to the PDF format, fast and versatile. The file can be tweaked. Applicable to also OpenOffice. |
34: Write All the Spreadsheets to CSV Files with LibreOffice UNO |
All the sheets in a spread sheets document, not just the 1st sheet. Applicable also to Apache OpenOffice. |
35: Execute UNO Dispatch Command and Get All Information in Python |
Your lazy way may be missing some useful information that is available from the execution. |
36: Setting Editing Password into an OpenDocument File with UNO |
Using LibreOffice or OpenOffice, for an OpenDocument ('.odt', '.ods', or '.odp') file, from Java, C++, C#, Python, BeanShell, JavaScript, or Basic |
37: Editing Password into a Binary Word/Excel File with UNO |
Using LibreOffice or OpenOffice, for a Microsoft '.doc' or .'xls' file, from Java, C++, C#, Python, BeanShell, JavaScript, or Basic |
38: Set the Size of Any Page of Word Processor Document with UNO |
Any word processor document typically associated with an OpenDocument Text/Office Open XML Document/Microsoft Word file, using LibreOffice |
39: Set the Size of Page of Spread Sheets Document with UNO |
Any spread sheets document typically associated with an OpenDocument Spreadsheet/Office Open XML Workbook/Microsoft Excel file, using LibreOffice |
40: Set Any Page Property of Spread Sheets Document with UNO |
Any spread sheets document typically associated with an OpenDocument Spreadsheet/Office Open XML Workbook/Microsoft Excel file, using LibreOffice |
41: Set Any Page Property of Word Processor Document with UNO |
Any word processor document typically associated with an OpenDocument Text/Office Open XML Document/Microsoft Word file, using LibreOffice |
42: Editing Password into an Office Open XML File with UNO |
Using LibreOffice or OpenOffice, for an Office Open XML .docx, .xlsx, or .pptx file, from Java, C++, C#, Python, BeanShell, JavaScript, or Basic |
43: Export Office Document into a PDF as per Full Specs with UNO |
Exported sections, images quality, watermark, tagging, form fields format, whether bookmarks or comments, encrypting, restrictions, signing, etc. |
44: Defining Any UNO Component in C++ |
Typically in order to create a listener. Some Knowledge on UNO garbage collection, weak pointing, etc. is due and here. |
45: How to Use or Not Use '::com::sun::star::uno::Reference' |
In order to avoid fatal errors (like segmentation fault errors), inadvertent inefficiencies, and tedious coding, in handling local/remote UNO objects |
46: Using an External Python for LibreOffice or OpenOffice |
With a binary LibreOffice/OpenOffice distribution, for this article. Not every version is OK. For using a full and bug-fixed Python. |
47: Using Python Instead of Basic For Your LibreOffice |
If your LibreOffice shows not-so-advisable Basic as the sole macro language option, you can add Python. |
48: Create User/Application-Owned Python Macro for LibreOffice |
Python will be far better than Basic, for many. Creating Python macros is not difficult, suspicious, or nerdish. Also for OpenOffice. |
49: Create In-Document Python Macro for LibreOffice/OpenOffice |
The GUI looks as though you cannot, but actually, you can. So, you do not need to use Basic just in order to locate your macro in-document. |
50: Create LibreOffice Extension That Contains Python Macros |
This technique should work for also your OpenOffice extension. Using the extension, you can distribute your Python macros handily. |
51: Invoke Any LibreOffice or OpenOffice Macro from Your Program |
"Any" means user-owned, application-owned, in-document, or in-extension, and Python or whatever. No, we do not call 'soffice', which is handicapped. |
52: The Common Preparation for Starting Java UNO Programming |
The common preparation is usually enough unless you are going to create a UNO interface. Really, it is simple. |
53: Import Any Module into Your LibreOffice Python Macro, Part 1 |
Or into any module imported by your macro. This part is for except for importing in-document modules. |
54: Import Any Module into Your LibreOffice Python Macro, Part 2 |
Also any in-document module can be imported into your macro or any module imported by your macro. Here is how. |
55: Read and Write Any LibreOffice Document from and to a Stream |
Or any OpenOffice, Microsoft Office, or similar document. In order to store the document in a database, a remote server, or whatever. |
56: Basics of Creating Your LibreOffice or OpenOffice Extension |
For registering macros (Python, Basic, etc.), UNO interfaces, UNO components, UNO services, key bindings, menu items, and/or tool buttons. |
57: Registering Key Bindings for LibreOffice or OpenOffice |
For invoking macros (in Python, Java, JavaScript, BeanShell, or Basic). Via extensions. Per document type. |
58: Register Menu Items/Tool Buttons for LibreOffice/OpenOffice |
For invoking macros (in Python, Java, JavaScript, BeanShell, or Basic). Via extensions. Per document type. |
59: Put Basic Macros into a LibreOffice/OpenOffice Extension |
In order to package them together with key bindings/menu items/tool buttons/UNO interfaces/UNO components/UNO services, and maybe to distribute it. |
60: Create and Register UNO Interface/Generate Mapping Images |
In order to create your own UNO component, in Java, C++, C#, or Python. Generate the Java, C++, C#, and Python mapping images. |
61: Create Any UNO Component in Java |
For example, a listener, a Swing GUI component, a hard-to-be-implemented-in-a-macro-language function component, etc. |
62: Create Any Global UNO Service in Java |
In order to instantiate the UNO component from a remote programming language environment or to create an artifact like a spread sheet cell function. |
63: Create Any UNO Component in C# |
Typically, a listener in a LibreOffice or OpenOffice client, for example for dispatch commands, but not necessarily so. |
64: Create Any UNO Component in Python |
Typically, a listener in a macro or a LibreOffice or OpenOffice client, for example for dispatch commands, but not necessarily so. |
65: Connection-Aware Possibly Remote Python External UNO Client |
To incorporate the LibreOffice/OpenOffice functionality into your independent (non-macro) program, possibly a long-standing one like a Web application |
66: Connection-Aware Possibly Remote C# External UNO Client |
To incorporate the LibreOffice/OpenOffice functionality into your independent (non-macro) program, possibly a long-standing one like a Web application |
67: Connection-Aware Possibly Remote C++ External UNO Client |
To incorporate the LibreOffice/OpenOffice functionality into your independent (non-macro) program, possibly a long-standing one like a Web application |
68: Connection-Aware Possibly Remote Java External UNO Client |
To incorporate the LibreOffice/OpenOffice functionality into your independent (non-macro) program, possibly a long-standing one like a Web application |
69: Creating Any UNO Object Singleton in LibreOffice/OpenOffice |
Creating any 'singleton' UNOIDL entity does not create any singleton, but a singleton getter. Then, how can any singleton be created? Here is how. |
70: Create Any Global UNO Service in C++ |
In order to instantiate the UNO component from a remote programming language environment or to create an artifact like a spread sheet cell function. |
71: Create Any Global UNO Service in Python |
In order to instantiate the UNO component from a remote programming language environment or to create an artifact like a spread sheet cell function. |
72: Use Any Dialog from Non-Basic Macro or Non-Macro for LibreOffice/OpenOffice |
Any dialog can be invoked and handled from non-Basic (Java, C++, C#, Python, etc.) macro or non-macro. Events can be received from the dialog. |
73: Handle Each Type of Dialog Controls from Non-Basic Macro or Non-Macro for LibreOffice/OpenOffice |
Label, Text, Command, Image, Check, Option, List, Combo, Scroll, Progress, Date, Time, Numeric, Formatted, File, Tree, Grid, Hyperlink, Spin, etc. |
| The table of contents of this series | The next article in this series>