| View previous topic :: View next topic |
| Author |
Message |
moptop99 General User

Joined: 05 Jan 2004 Posts: 36
|
Posted: Mon Sep 27, 2004 7:02 am Post subject: options for draw_html_export filter |
|
|
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 |
|
 |
moptop99 General User

Joined: 05 Jan 2004 Posts: 36
|
Posted: Fri Oct 01, 2004 1:37 pm Post subject: need helpwith python conversion |
|
|
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 |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
Cybb20 Super User


Joined: 02 Mar 2004 Posts: 1569 Location: Frankfurt, Germany
|
Posted: Sat Oct 02, 2004 2:31 pm Post subject: |
|
|
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 |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
|
|
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
|