Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index




Sent from my Sony Xperia™ smartphone

---- Original Message ----
Subject: Re: Exporting documents as PDF in Android Viewer
Sent: Dec 8, 2016 12:01
From: Michael Meeks <michael.meeks@collabora.com>
To: Mert Tümer <merttumer@outlook.com>
Cc:

Hi Mert,

        Can I CC: the libreoffice@lists.freedesktop.org list here on this one ?
it's prolly best to get wider and quicker input, perhaps you can fwd
this one there as you reply ? =)

On 08/12/16 08:22, Mert Tümer wrote:
I'm trying to add "export as pdf feature" to the Android Viewer. Based
on your comment
in https://bugs.documentfoundation.org/show_bug.cgi?id=89860#c4,
however, i couldn't do that. I couldn't find any pdf conversions bits in
lokandroid.cxx file. There is just one function that i think it can do
the job which is

        Ah - right =) so that file lokandroid.cxx is a (somewhat out of date)
Java wrapper of the LibreOfficeKit API which you can see in C form here:

        include/LibreOfficeKit/LibreOfficeKit.h

extern "C" SAL_JNI_EXPORT void JNICALL
Java_org_libreoffice_kit_Document_postUnoCommand
    (JNIEnv* pEnv, jobject aObject, jstring command, jstring arguments).

        Yep - so this is not the right method =)

I know that you don't work with Android side

        Hey ;-) I've hacked on and around the Android code a fair bit getting
that going ;-)

but is there anyone you can address me to in order to solve this problem?

        The developers list is the best place; this is a very sensible
question, and I'm excited to have you interested in working on Android -
currently almost no-one is, so there is a big opportunity there =) There
is a lot that can be done to accelerate things on Android - particularly
eg. combined tile rendering, and there are lots of hooks we've added for
'Online' that can be mirrored nicely on Android these days - so it
should be easy to improve the editing UI a lot.

        Anyhow ... I think you prolly want to:

extern "C" SAL_JNI_EXPORT jint JNICALL
Java_org_libreoffice_kit_Office_saveAs
    (JNIEnv* pEnv, jobject aObject, jstring sUrl, jstring sFormat,
jstring sOptions)

        And pass in a file-name with a ".pdf" extension which should give you a
temporary file with a PDF in it =)

        That will call to:

        desktop/source/init.cxx:

static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl,
const char* pFormat, const char* pFilterOptions)

        Which you can read to see how it works =) Of course, in terms of a UI
to set paper size and orientation and so on - I think you'll want to use
the new UNO commands exposed for 'online' to add some options for that.

        Hope that helps !

                Michael.

--
michael.meeks@collabora.com <><, Pseudo Engineer, itinerant idiot

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.