[Mono-list] mono and LibreOffice (Ubuntu/Linux)

Wolfgang Mauer wolfgang.mauer at kabelmail.de
Tue Oct 18 12:04:17 UTC 2016


Hi,

i try’d dllimport before and everything works fine.

BUT I like(need) to have methods to fill data in textfields….

 

I know that everything could be made with methods and dllimport, but is this the recommended way?

Have a “easy” code on Windows and complicated on Ubuntu ??? :(

 

        private void FillHeader(IModel row)

        {

            // ReSharper disable SuspiciousTypeConversion.Global

            var xtextfields = ((XTextFieldsSupplier)Document).getTextFields();

            // ReSharper restore SuspiciousTypeConversion.Global

            var xText = Document.getText();

            var enumaration = xtextfields.createEnumeration();

            while (enumaration.hasMoreElements())

            {

                try

                {

                    var field = enumaration.nextElement();

                    if (!(field.Value is XTextField)) continue;

                    var name = (field.Value as XTextField).getAnchor().getString();

                    var value = GetPropertyValue(row, name);

 

                    if (string.IsNullOrEmpty(value))

                    {

                        xText.removeTextContent((XTextField)field.Value);

                    }

                    else

                    {

                        (field.Value as XTextField).getAnchor().setString(value);

                    }

                }

                catch

                {

                    // ReSharper disable RedundantJumpStatement

                    continue;

                    // ReSharper restore RedundantJumpStatement

                }

            }

            var xModel = (Document);

            var xController = xModel.getCurrentController();

            // ReSharper disable SuspiciousTypeConversion.Global

            var xTextViewCursor = ((XTextViewCursorSupplier)xController).getViewCursor();

            // ReSharper restore SuspiciousTypeConversion.Global

            xTextViewCursor.gotoEnd(false);

        }

 

 

Von: Marco Ridoni [mailto:m.ridoni at gmail.com] 
Gesendet: Dienstag, 18. Oktober 2016 11:22
An: Miguel de Icaza <miguel at microsoft.com>
Cc: Wolfgang Mauer <wolfgang.mauer at kabelmail.de>; mono-list at lists.xamarin.com
Betreff: Re: [Mono-list] mono and LibreOffice (Ubuntu/Linux)

 

My use case for my service was very simple:

1) Convert a "whatever" document to PDF

2) Generate a XLS/Calc spreadsheet from XML data (this part was later dealt with using NPOI)

 

I found that using the C# and/or Java bindings the whole thing was quite unstable, so I wrote a small C/C++ wrapper, that in turn is called by Mono or .Net with a standard DLLImport. This works both on Linux and Windows (it's for a ASP.Net MVC web app that is developed and tested under Windows and deployed under Linux).

 

If you wish, code is freely (in any meaning) available, beware that it probably requires some cleaning up.

 

m.

 

2016-10-18 3:06 GMT+02:00 Miguel de Icaza via Mono-list <mono-list at lists.dot.net <mailto:mono-list at lists.dot.net> >:

Sadly, I do not recall the details, and the little information that was available on the net has been gone.

 

But judging from a blog post of mine [1], it looks like Michael Meeks at the time ported the support to run with Mono.   Other than that, I do not have more information.

 

I managed to track down some old Addin for MonoDevelop, and you can maybe use this as a starting point for your investigations:

 

https://github.com/mono/monodevelop/tree/monodevelop-4.0.12-branch/extras/OpenOfficeSamples

 

I suggest you reach out to the open office team.

 

[1] http://tirania.org/blog/archive/2008/Jun-12.html

 

From: Wolfgang Mauer <wolfgang.mauer at kabelmail.de <mailto:wolfgang.mauer at kabelmail.de> >
Date: Monday, October 17, 2016 at 5:40 PM
To: Miguel de Icaza <miguel at microsoft.com <mailto:miguel at microsoft.com> >, "mono-list at lists.xamarin.com <mailto:mono-list at lists.xamarin.com> " <mono-list at lists.xamarin.com <mailto:mono-list at lists.xamarin.com> >
Subject: AW: [Mono-list] mono and LibreOffice (Ubuntu/Linux)

 

Ok, Thanks.

With Ubuntu > 12.04 can’t find “cli-cppuhelper” no more.

Is this a problem within mono or libreoffice?

If you use libreoffice > 3.5 you will see that it will not work.

 

/Wolfgang

 

Von: Miguel de Icaza [mailto:miguel at microsoft.com <mailto:miguel at microsoft.com> ] 
Gesendet: Montag, 17. Oktober 2016 21:13
An: Wolfgang Mauer <wolfgang.mauer at kabelmail.de <mailto:wolfgang.mauer at kabelmail.de> >; mono-list at lists.xamarin.com <mailto:mono-list at lists.xamarin.com> 
Betreff: Re: [Mono-list] mono and LibreOffice (Ubuntu/Linux)

 

Hello,

 

When I last used it, all the work took place on Unix, I do not recall using Windows at all.

 

Miguel.

 

From: Mono-list <mono-list-bounces at lists.dot.net <mailto:mono-list-bounces at lists.dot.net> > on behalf of Wolfgang Mauer <wolfgang.mauer at kabelmail.de <mailto:wolfgang.mauer at kabelmail.de> >
Date: Saturday, October 8, 2016 at 7:22 AM
To: "mono-list at lists.xamarin.com <mailto:mono-list at lists.xamarin.com> " <mono-list at lists.xamarin.com <mailto:mono-list at lists.xamarin.com> >
Subject: [Mono-list] mono and LibreOffice (Ubuntu/Linux)

 

Hi all,

i just restart working on a project that uses LibreOffice(CLI) from mono.

Now I am wondering that the assembly’s (cli_cppuhelper.dll) only run on Windows?

Is there is a way to get this working again?

 

/Regards


_______________________________________________
Mono-list maillist  -  Mono-list at lists.dot.net <mailto:Mono-list at lists.dot.net> 
http://lists.dot.net/mailman/listinfo/mono-list

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20161018/778cbd48/attachment-0001.html>


More information about the Mono-list mailing list