<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div><br>
<br>
Sent from my Sony Xperia™ smartphone<br>
<br>
---- Original Message ----<br>
Subject: Re: Exporting documents as PDF in Android Viewer<br>
Sent: Dec 8, 2016 12:01<br>
From: Michael Meeks <michael.meeks@collabora.com><br>
To: Mert Tümer <merttumer@outlook.com><br>
Cc: <br>
<br>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi Mert,<br>
<br>
Can I CC: the libreoffice@lists.freedesktop.org list here on this one ?<br>
it's prolly best to get wider and quicker input, perhaps you can fwd<br>
this one there as you reply ? =)<br>
<br>
On 08/12/16 08:22, Mert Tümer wrote:<br>
> I'm trying to add "export as pdf feature" to the Android Viewer. Based<br>
> on your comment<br>
> in <a href="https://bugs.documentfoundation.org/show_bug.cgi?id=89860#c4">https://bugs.documentfoundation.org/show_bug.cgi?id=89860#c4</a>,<br>
> however, i couldn't do that. I couldn't find any pdf conversions bits in<br>
> lokandroid.cxx file. There is just one function that i think it can do<br>
> the job which is<br>
<br>
Ah - right =) so that file lokandroid.cxx is a (somewhat out of date)<br>
Java wrapper of the LibreOfficeKit API which you can see in C form here:<br>
<br>
include/LibreOfficeKit/LibreOfficeKit.h<br>
<br>
> extern "C" SAL_JNI_EXPORT void JNICALL<br>
> Java_org_libreoffice_kit_Document_postUnoCommand<br>
> (JNIEnv* pEnv, jobject aObject, jstring command, jstring arguments).<br>
<br>
Yep - so this is not the right method =)<br>
<br>
> I know that you don't work with Android side<br>
<br>
Hey ;-) I've hacked on and around the Android code a fair bit getting<br>
that going ;-)<br>
<br>
> but is there anyone you can address me to in order to solve this problem?<br>
<br>
The developers list is the best place; this is a very sensible<br>
question, and I'm excited to have you interested in working on Android -<br>
currently almost no-one is, so there is a big opportunity there =) There<br>
is a lot that can be done to accelerate things on Android - particularly<br>
eg. combined tile rendering, and there are lots of hooks we've added for<br>
'Online' that can be mirrored nicely on Android these days - so it<br>
should be easy to improve the editing UI a lot.<br>
<br>
Anyhow ... I think you prolly want to:<br>
<br>
extern "C" SAL_JNI_EXPORT jint JNICALL<br>
Java_org_libreoffice_kit_Office_saveAs<br>
(JNIEnv* pEnv, jobject aObject, jstring sUrl, jstring sFormat,<br>
jstring sOptions)<br>
<br>
And pass in a file-name with a ".pdf" extension which should give you a<br>
temporary file with a PDF in it =)<br>
<br>
That will call to:<br>
<br>
desktop/source/init.cxx:<br>
<br>
static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl,<br>
const char* pFormat, const char* pFilterOptions)<br>
<br>
Which you can read to see how it works =) Of course, in terms of a UI<br>
to set paper size and orientation and so on - I think you'll want to use<br>
the new UNO commands exposed for 'online' to add some options for that.<br>
<br>
Hope that helps !<br>
<br>
Michael.<br>
<br>
-- <br>
michael.meeks@collabora.com <><, Pseudo Engineer, itinerant idiot<br>
</div>
</span></font>
</body>
</html>