ErrorCodeIOException thrown within storeAsURL and storeToURL

Hi there,

I am using the LibreOffice SDK (version 5) within .NET, basically I am converting a .docx document to a PDF but when I try to use the storeAsURL or storeToUrl methods an ErrorCodeIOException is being thrown (SfxBaseModel::impl_store file:///C:\Users\demo\Documents\test.pdf failed: 0×507), does anyone know why this might be? The code I am using is shown below:

        Dim fileName As String = "file:///C:\Users\demo\Documents\test.docx"

        ' get the remote office component context
        Dim xContext As XComponentContext
        xContext = Bootstrap.bootstrap()

        ' get the remote office service manager
        Dim xFactory As XMultiServiceFactory
        xFactory = DirectCast(xContext.getServiceManager(),  _

        'Create the Desktop
        Dim xComponentLoader As
        xComponentLoader = DirectCast(xFactory.createInstance(""),  _

        Dim propertyValues(1) As
        propertyValues(0) = New
        propertyValues(0).Name = "Hidden"
        propertyValues(0).Value = New uno.Any(True)

        oDocToStore = xComponentLoader.loadComponentFromURL(fileName, "_blank", 0, propertyValues)

        Dim xStorable As
        xStorable = DirectCast(oDocToStore,  _

        ' Setting the flag for overwriting
        propertyValues(0) = New
        propertyValues(0).Name = "Overwrite"
        propertyValues(0).Value = New uno.Any(True)
        ' Setting the filter name
        propertyValues(1) = New
        propertyValues(1).Name = "FilterName"
        propertyValues(1).Value = New uno.Any("writer_pdf_Export")

        Dim index1 = fileName.LastIndexOf("/")
        Dim index2 = fileName.LastIndexOf(".")
        Dim storeUrl As String = "file:///C:\Users\demo\Documents\test.pdf"

        ' Storing and converting the document
        xStorable.storeToURL(storeUrl, propertyValues)