OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

options for draw_html_export filter

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
moptop99
General User
General User


Joined: 05 Jan 2004
Posts: 36

PostPosted: Mon Sep 27, 2004 7:02 am    Post subject: options for draw_html_export filter Reply with quote

Hi folks,

A macro I run automatically from the command line to convert large numbers of documents to various formats (pdf, html, & ms office) is producing lousy jpg/html images of draw documents. I've tried converting manually (from within openoffice) & I get very nice output -- but I have to set a bunch of options first, in the user interface that opens up when I click on "export" in the file menu. I would like to be able to set these parameters when converting automatically, but I don't know what the names and posible values of the relevant parameters. How do I find this out? I remember having seen some discussion of this in this forum, but I can't find the relevant page now (though I have found the excellent list of filters that Danny b posted some time ago).
Pointers appreciated! thanks,

Matt

ps, changed the header, sorry about the initial typos.
Back to top
View user's profile Send private message
moptop99
General User
General User


Joined: 05 Jan 2004
Posts: 36

PostPosted: Fri Oct 01, 2004 1:37 pm    Post subject: need helpwith python conversion Reply with quote

I got a great reply on the api list, from stephan wunderlich:
Quote:

All you have to do is to set the FilterData, which is an Array of
Property Values ... the names of the properties can be found at
"sd/source/filter/html/htmlex.cxx"

(this is great! I guess in general when dealing with filters you look in the source code for
s(d/c/i/w)/source/filter/... for the options. In my version of the code, the relevant code starts ca. line 557, with:

/** get common export parameters from item set */
void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams )
)

Quote:


so something like the following should work attached to a draw document
with an image :
Code:

dim filterdata(1) as new com.sun.star.beans.PropertyValue

filterdata(0).Name="Compression"
filterdata(0).Value="100%"
filterdata(1).Name="Width"
filterdata(1).Value="1024"

dim saveargs(1) as new com.sun.star.beans.PropertyValue
saveargs(0).Name="FilterName"
saveargs(0).Value="draw_html_export"
saveargs(1).Name="FilterData"
saveargs(1).Value=filterdata()

thiscomponent.storetourl("file:///<wherever>/withpicture.html",saveargs())



So, this is great! but I have two more issues now:

1) when I try to add a third PropertyValue to filterdata, like this
Code:

filterdata(2).Name="IsExportContentsPage"
filterdata(2).Value="True"


I get an out-of-range error. So I guess there's a limit on the number of values you can list in a propertyvalue. so what do I do when I want more than 2?

And finally, I'm having trouble translating the above code into python. I've tried the following, but it doesn't seem to work:

Code:

        filterName = filterTable[docType][output]
        filterProperty = PropertyValue()
        filterProperty.Name="FilterName" ; filterProperty.Value=filterName
        saveargs = [filterProperty,]
        filterData = []
-----snip------
            filterOptions = [ ("Compression", "100%"),
                              ("Width", "1024"),
                              #("ContentsPage", True),
                              ("Mode", "PUBLISH_FRAMES")
                            ]                   
                filterData=tuple(filterData)
                options = PropertyValue()
                options.Name = "FilterData"
                options.Value=filterData
                saveargs=(filterProperty, options)
                oDoc.storeToURL( cTargetURL, saveargs )

            for option in filterOptions:
                property = createPropertyValue(option[0], option[1])
                filterData.append(property)




would love some help! thanks.
matt
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Sat Oct 02, 2004 8:42 am    Post subject: Reply with quote

Quote:

I get an out-of-range error. So I guess there's a limit on the number of values you can list in a propertyvalue. so what do I do when I want more than 2?


You have only to change :
Code:

dim filterdata(1) as new com.sun.star.beans.PropertyValue

as
Code:

dim filterdata(2) as new com.sun.star.beans.PropertyValue

if you want to write :
Code:

filterdata(2).Name="IsExportContentsPage"
filterdata(2).Value="True"

_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sat Oct 02, 2004 11:39 am    Post subject: Reply with quote

Can the source code be read / inspected online without having to download the entire source code and unpack it?
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Sat Oct 02, 2004 2:31 pm    Post subject: Reply with quote

Hi Danny,
what do you mean and "unpack" it?
Source code can be read online with ximians lxr engine (http://ooo.ximian.com)

Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sat Oct 02, 2004 2:36 pm    Post subject: Reply with quote

I would assume that if you download the source, it comes in either a huge zip or .tar.gz file to be "unpacked".
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group