Joaquin ,

have you also tryed "StoreToStream" ?

Greetz

Fernand
Hi Bernard,

in Python when you do:

def foo(**args):
  for k, v in args.items():
    print "%s: %s" % (k, v)

foo(arg1='val1', arg2='val2')
arg1: val1
arg2: val2

The **args part means "collect all the named arguments passed to this
function in a dictionary named args".

I do have the right values for the load & store properties, otherwise
it will not be working when I convert from .doc to .txt. It's only
failing when I try to convert to .pdf (and maybe when I save to other
formats, but so far I've only tried .txt and .pdf).

If I do this saving to a file:// url, instead of using private:stream,
then it works beautifully. Any other ideas?

Thanks!

On Thu, Jul 29, 2010 at 3:46 PM, Bernard Marcelly
<marce...@club-internet.fr> wrote:
Message de Joaquin Cuenca Abela  date 2010-07-29 11:58 :

Any other ideas?
Thanks!

For what's worth (I am not fluent in Python), I do not understand this code
(and similar for output) :

self._toProperties(
 InputStream=inputStream,
 FilterName='writer8',
 ReadOnly=True)

which calls this :

def _toProperties(self, **args):
 props = []
 for key in args:
  prop = PropertyValue()
  prop.Name = key
  prop.Value = args[key]
  props.append(prop)
 return tuple(props)

I can't see how you will get a correct .Name and .Value for each
propertyValue. Check that you have:
props[0].Name = 'InputStream'
props[0].Value = inputStream
props[1].Name = 'FilterName'
props[1].Value = 'writer8'
props[2].Name = 'ReadOnly'
props[2].Value = True

In the original code, function _toProperties receives a dictionnary as
argument, and this I can understand.

Regards
 Bernard


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org









---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to