Export multiple pages via the JPG filter

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
aroxo
Posts: 2
Joined: Sun Sep 09, 2012 10:51 pm

Export multiple pages via the JPG filter

Post by aroxo »

Hey All,

I am using Open Office on a Debian set-up through the Uno API using Unoconv. I'm trying to export all slides from a pptx into JPGs, but the export only outputs a JPG of the first slide, not all slides.

I can do it fine with the HTML export and the PDF export.

Is there a command I can pass through to the filter to control what is exported?

Also there is an error in the export for cropped images in pptxs (but not in ppt), it's no biggie for me, but might be something someone would like to be aware of.

Cheers,

Matt.
OpenOffice 3.1 Headless / Debian
FJCC
Moderator
Posts: 9281
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Export multiple pages via the JPG filter

Post by FJCC »

From what I can see in the Developer's Guide under Exporting Drawing and Presentation documents, the export method will only handle one Draw Page (one slide) at a time.
The method name setSourceDocument() may be confusing. Actually, the method
would allow exporting entire documents, however, it is only possible to export draw
pages, single shapes or shape collections from a drawing document.
The filter options can affect the format of the export, but I don't see a way to change the limitation on what can be exported.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
aroxo
Posts: 2
Joined: Sun Sep 09, 2012 10:51 pm

Re: Export multiple pages via the JPG filter

Post by aroxo »

Hi - thanks for the response. Do you know if there a way to control which page it exports?
OpenOffice 3.1 Headless / Debian
FJCC
Moderator
Posts: 9281
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Export multiple pages via the JPG filter

Post by FJCC »

In OO Basic it looks like this:

Code: Select all

Dim Props(1) as New com.sun.star.beans.PropertyValue
oSM = GetProcessServiceManager
ExportSrv = oSM.createInstance("com.sun.star.drawing.GraphicExportFilter")

oDPages = ThisComponent.getDrawPages()
oPage = oDPages.getByIndex(3)

ExportSrv.setSourceDocument(oPage)
Props(0).Name = "MediaType"
Props(0).Value = "image/jpeg"
Props(1).Name = "URL"
Props(1).Value = "file:///C:/Exported.jpg"
ExportSrv.filter(Props)
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Post Reply