[SOLVED] Convert a selection to curves (Draw)

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
luispa
Posts: 5
Joined: Mon Nov 12, 2018 11:04 pm

[SOLVED] Convert a selection to curves (Draw)

Post by luispa »

Hi,
This is my first post here, I'm a newcomer. I'm looking to find out how to write a macro for converting a selection of shapes and text fields in curves (Draw Document). I already wrote a macro for creating and selecting the elements. I was not able to find information about how to make the conversion. I need this because I need to export to PDF and I'm using non common fonts. Thank you very much in advance.
Last edited by robleyd on Tue Nov 27, 2018 5:56 am, edited 2 times in total.
Reason: Add green tick [robleyd, Moderator]
Libreoffice on Fedora 29
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Convert a selection to curves (Draw)

Post by Zizi64 »

I need this because I need to export to PDF and I'm using non common fonts. Thank you very much in advance.
You can embed the used fonts into the pdf file. (If the licence of the font allows that.)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
luispa
Posts: 5
Joined: Mon Nov 12, 2018 11:04 pm

Re: Convert a selection to curves (Draw)

Post by luispa »

Thank you very much for your reply, it would be great but I never found how to do it with OpenOffice/LibreOffice even when using application menus and options. Do you know how could I do it in both application menus and macro?
Libreoffice on Fedora 29
luispa
Posts: 5
Joined: Mon Nov 12, 2018 11:04 pm

Re: Convert a selection to curves (Draw)

Post by luispa »

Well, I found how to embed fonts by modifying the document properties. I'll try to find out how to do it with macros. Thank you very much again.
Libreoffice on Fedora 29
luispa
Posts: 5
Joined: Mon Nov 12, 2018 11:04 pm

Re: Convert a selection to curves (Draw)

Post by luispa »

Hi,
This is partially solved. I found how to export PDF Format 1 which includes font information. However I'm still wondering how to convert a selection in curves, is this possible?
Thank you very much in advance
Libreoffice on Fedora 29
hubert lambert
Posts: 145
Joined: Mon Jun 13, 2016 10:50 am

Re: Convert a selection to curves (Draw)

Post by hubert lambert »

Hi,

You can do this using the dispatcher.
An example, that groups and converts the selection to curves:

Code: Select all

    doc = thiscomponent
    frame = doc.CurrentController.Frame
    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    dispatcher.executeDispatch(frame, ".uno:FormatGroup", "", 0, array())
    dispatcher.executeDispatch(frame, ".uno:ChangeBezier", "", 0, array())
Regards.
AOOo 4.1.2 on Win7 | LibreOffice on various Linux systems
luispa
Posts: 5
Joined: Mon Nov 12, 2018 11:04 pm

Re: Convert a selection to curves (Draw)

Post by luispa »

Thank you very much! It worked like a charm.
Libreoffice on Fedora 29
Post Reply