Q: New v6.4.7 - Can macro export PDF?

Hi!

6.4.7 with Macro support is a piece of good news indeed.

From the “Limitations for Macros in Collabora Online” topic I have not understood - can macro (written in LibreOffice Basic, embedded into documents) for example export certain calc sheets in separate PDF files? I could try it out but there are no reasons to waste a time if this is not possible at the moment.

Additionally, even a very basic implementation of form controls like push buttons would be very helpful. For ordinary users, macros are much more convenient and intuitive to invoke with pushbuttons rather than a separate menu.

PS. “Save as” in Collabora CODE exports ALL sheets from ODF, with no option to select particular.

Thanks.

Fun question :slight_smile:
From my understanding and knowledge of UNO/LibreOffice Basic, setting a PDF export descriptor is in the memory, as is the export itself. No setting of user interface, nor access to other files involved.
So I would say: insert a module with the code in a file, import it in the online instance, and push the button :slight_smile: !

The slight downer here is that we trap each document in a very tight cage; so - if you want to do this - we need to think about where to put those documents, and how to get them to a client. If your script can up-load them / push them to a database somewhere - should work, but if you expect to see them on your local file-system through the browser :wink: then that’s much tougher.

If you want to do scripted conversion of files to PDF you’re much better off to use (and help us improve / extend) the REST convert-to API that we use for thumbnailing I guess; would it suit you to be able to pass in a chunk of JSON to your script, and get it to operate on the document, then get the result back via a post ?

and

Thanks.

Generated PDFs should appear in the same NextCloud directory as original ODF documents. OK, from what written by mmeeks I assume it would be better to use custom Flow scripts.

PS. “Save as” in Collabora Code currently saves PDF in same NextCloud directory, but it converts into PDF all sheets found in ODF. I don’t know if its possible to change this behavior with loolwsd.xml for example.

PS. “Save as” in Collabora Code currently saves PDF in same NextCloud directory, but it converts into PDF all sheets found in ODF. I don’t know if its possible to change this behavior with loolwsd.xml for example.

There is, to my best knowledge, no option in loolwsd.xml to change that. But, as written in my earlier reply, this is one thing I would definetly expect to work with a macro.