Object objectDocumentToStore =
xcomponentloader.loadComponentFromURL(
stringUrl, "_blank", 0, propertyvalue );
// Getting an object that will offer a simple way to store a document to a URL.
XStorable xstorable =
( XStorable ) UnoRuntime.queryInterface( XStorable.class,
objectDocumentToStore );
// Preparing properties for converting the document
propertyvalue = new PropertyValue[ 2 ];
// Setting the flag for overwriting
propertyvalue[ 0 ] = new PropertyValue();
propertyvalue[ 0 ].Name = "Overwrite";
propertyvalue[ 0 ].Value = new Boolean(true);
// Setting the filter name
propertyvalue[ 1 ] = new PropertyValue();
propertyvalue[ 1 ].Name = "FilterName";
propertyvalue[ 1 ].Value = stringConvertType;
// Appending the favoured extension to the origin document name
int index = stringUrl.lastIndexOf('.');
if ( index >= 0 ) {
stringConvertedFile = stringUrl.substring(0, index) + "." + stringExtension;
} else {
stringConvertedFile = stringUrl + "." + stringExtension;
}
// Storing and converting the document
xstorable.storeAsURL( stringConvertedFile, propertyvalue );
XCloseable xcloseable = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,xstorable );
// Closing the converted document
if ( xcloseable != null )