Convert pdf with visual basic OpenOffice Calc
Posted: Mon Dec 10, 2018 6:51 pm
Good afternoon, how are you?
Has anyone used any commands below to convert an open office spreadsheet using visual basic.net? I'm trying to use it but with no success so far. If anyone can help, I'm grateful, thank you.
Has anyone used any commands below to convert an open office spreadsheet using visual basic.net? I'm trying to use it but with no success so far. If anyone can help, I'm grateful, thank you.
Code: Select all
Sub exportaPDF()
' precisamos no mínimo da propriedade Filtro
Dim oDoc As Object
Dim sUrl As String
Dim aProp(0) As New com.sun.star.beans.PropertyValue
oDoc = thisComponent
' adapte para seu sistema
sUrl = "c:\OOOexemplos\tst_PDF.pdf"
sUrl = ConvertToURL(sUrl)
' define o filtro de exportação
aProp(0).Name = "FilterName"
aProp(0).Value = "writer_pdf_Export"
' para exportar use storeToURL
oDoc.storeToURL(sUrl, aProp())
End Sub