Android Question Fallo al leer PDFs

JMMF

Member
Licensed User
Longtime User
Hola a todos

Mi intención es ver desde la propia app un PDF creado y guardado anteriormente

Intento verlo así

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    Dim pdfv As PDFViewer               'Trabajos con Pdf(Libreria PDFViewer)
       Dim SMTP As SMTP                'Trabajos con Gmail(Libreria Net)
    Dim GD As GradientDrawable

    Private PnlVerPdf As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
        Activity.AddMenuItem3("Enviar PDF","EnviarGmail",LoadBitmap(File.DirAssets,"enviarPDF.png"),True)
    End If
    ver_Pdf
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub

Sub ver_Pdf
'Titulo de Activity
    GD.Initialize("TL_BR",Array As Int(Colors.DarkGray,Colors.Black))
    Activity.Background=GD
    Activity.Title = Main.NombrePDF
   
'Crea el PnlVerPdf
    PnlVerPdf.Initialize("")
    PnlVerPdf.Background=GD
    Activity.AddView(PnlVerPdf,0,0,100%x,100%y)
    PnlVerPdf.Visible=True

'Crea el pdfv
    'Dim pc As Int = 0
    pdfv.init
    PnlVerPdf.AddView(pdfv,-1,-1,100%x,100%y)
       pdfv.getpdf(File.DirRootExternal & "/" & Main.NombrePDF)
       If pdfv.isValid Then
          pdfv.scrollToPage(0)
          'pc = pdfv.GetPageCount
          pdfv.zoom(2.0)
      Else
          Msgbox("Error pdf file!","Error")
          Activity.Finish
          Return
       End If
End Sub

Pero al poco tiempo la app se cierra.

No lo entiendoooooo.
 

fixit30

Active Member
Licensed User
Longtime User
Sorry, this is the English part of the forum.

Maybe your question is better posted in the Spanish forum.
 
Upvote 0
Top