[Solved] Script export document property

The Application Programming Interface and the OASIS Open Document Format

[Solved] Script export document property

Postby lfrohman » Fri Sep 21, 2012 11:41 pm

I need to batch convert about 500 ppt files to html. I found a script at:

http://www.oooforum.org/forum/viewtopic.phtml?t=9437

but the resolution is low - 640x480. When you export manually, there is a
high resolution option. What is the script property for setting the output resolution?
Also, is there a property for setting the button style?

Is there a way to change the default values for these, if I can't do it in the script?

thanks,
Lance
Last edited by RoryOF on Fri Sep 28, 2012 7:37 am, edited 2 times in total.
Reason: Added green tick (RoryOF, moderator)
OpenOffice 3.4.0 - Wndows 7
lfrohman
 
Posts: 4
Joined: Fri Sep 21, 2012 8:56 pm

Re: script export document property

Postby hanya » Sat Sep 22, 2012 10:46 am

Hi, welcome to the forum.

If there is option dialog for the target filter, it provides information about options that generates when it is executed.
Here is an example for impress_html_Export filter.
Code: Select all   Expand viewCollapse view
Sub SdHtmlOptionsDialog
  dialog = CreateUnoService("com.sun.star.comp.draw.SdHtmlOptionsDialog")
  dialog.execute()
  props = dialog.getPropertyValues()
  fd = props(0).Value
  s = ""
  for i = 0 to ubound(fd) step 1
    s = s & fd(i).Name & ": " & CStr(fd(i).Value) & chr(10)
  next
  msgbox s
End Sub

The name of the implementation of the option dialog can be found in com.sun.star.document.FilterFactory service.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
hanya
Volunteer
 
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Script export document property

Postby lfrohman » Tue Sep 25, 2012 6:55 pm

thank you,
I tried your code, and the option for dimensions is "Width",
but no matter what I set the width to, it ends up being
the default value.
OpenOffice 3.4.0 - Wndows 7
lfrohman
 
Posts: 4
Joined: Fri Sep 21, 2012 8:56 pm

Re: Script export document property

Postby hanya » Wed Sep 26, 2012 2:47 pm

Try to pass the result of the option dialog that is shown by the above code, I mean props in it. It is sequence of com.sun.star.beans.PropertyValue that contains FilterData and it can be passed directory to storeToURL or storeAsURL method as filtering parameters. If you can see good result with it, try to mimic these value in your code.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
hanya
Volunteer
 
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Script export document property

Postby lfrohman » Thu Sep 27, 2012 12:10 am

thank you, the code that I used (referenced above) has the line

oDoc.storeToURL( cURL, Array(_
MakePropertyValue( "URL", cURL ),_
MakePropertyValue( "FilterName", "impress_html_Export" ),_
)

I modified this to:

oDoc.storeToURL( cURL, Array(_
MakePropertyValue( "URL", cURL ),_
MakePropertyValue( "Width", 800 ),_
MakePropertyValue( "FilterName", "impress_html_Export" ),_
)

I also tried MakePropertyValue( "Width", "800" ),_

neither results in the exported html having other than the default (640x480) resolution.
OpenOffice 3.4.0 - Wndows 7
lfrohman
 
Posts: 4
Joined: Fri Sep 21, 2012 8:56 pm

Re: Script export document property

Postby hanya » Thu Sep 27, 2012 3:45 am

Second parameter of storeToURL method is specified by elemtns of css.document.MediaDescriptor service. And FilterData element contains options for the filter that is choosen to export the file:
http://www.openoffice.org/api/docs/comm ... FilterData
You have to put Width element in sequence value of FilterData, see values in "props" using the watching window of the Basic IDE.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
hanya
Volunteer
 
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Script export document property

Postby lfrohman » Fri Sep 28, 2012 12:31 am

I got it to work, thank you very much!
OpenOffice 3.4.0 - Wndows 7
lfrohman
 
Posts: 4
Joined: Fri Sep 21, 2012 8:56 pm


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 1 guest