54 lines
1.4 KiB
Text
54 lines
1.4 KiB
Text
' Gambas class file
|
|
|
|
Public TipoSalida As String = "odt"
|
|
|
|
Public Sub Form_Open()
|
|
System.Shell = "/bin/bash"
|
|
labelVersion.Text = "Version " & Application.Version
|
|
fichSeleccionPDF.Filter = ["*.pdf", "Ficheros PDF"]
|
|
'Ruta exportacion
|
|
Shell "mkdir -p " & User.Home & "/PDF-Export"
|
|
End
|
|
|
|
Public Sub botonExportar_Click()
|
|
'Extraemos la ruta del fichero
|
|
Dim RutaPDF As String
|
|
Dim RutaSalida As String
|
|
RutaPDF = fichSeleccionPDF.SelectedPath
|
|
If IsNull(RutaPDF)
|
|
Message.Title = "PDF-Export"
|
|
Message.Warning("Debe de seleccionar un PDF")
|
|
Return
|
|
Endif
|
|
botonExportar.Text = "E X P O R T A N D O ..."
|
|
botonExportar.Enabled = False
|
|
Wait 0.1
|
|
botonExportar.Refresh
|
|
RutaSalida = User.Home & "/PDF-Export"
|
|
RutaPDF = Shell$(RutaPDF)
|
|
Shell "libreoffice --infilter='writer_pdf_import' --convert-to " & TipoSalida & " " & RutaPDF & " --outdir " & RutaSalida Wait
|
|
Message.Title = "PDF-Export - Conversión realizada"
|
|
Message.Info("Puede encontrar su fichero convertido en:" & gb.CrLf & RutaSalida)
|
|
botonExportar.Enabled = True
|
|
botonExportar.Text = "Exportar"
|
|
botonExportar.Refresh
|
|
End
|
|
|
|
Public Sub PictureLOGO_MouseDown()
|
|
Message.Title = "PDF-Export"
|
|
Message.Info("Autor: luisgulo@soloconlinux.org.es")
|
|
End
|
|
|
|
|
|
|
|
Public Sub opcionODT_Click()
|
|
TipoSalida = "odt"
|
|
End
|
|
|
|
Public Sub opcionDOC_Click()
|
|
TipoSalida = "doc"
|
|
End
|
|
|
|
Public Sub opcionDOCX_Click()
|
|
TipoSalida = "docx"
|
|
End
|