terça-feira, 8 de setembro de 2015

Windev Mobile - 29/... Pdf - Ler Pdf direto do Aparelho Android













Nessa aula, vou mostrar como eu fiz para achar uma solucao para ler um pdf, direto
no aparelho do android.
Posso usar simplesmente Shellexecute("Arquivo Pdf ")
ou
fazer como esse exemplo . que abre o pdf direto no aparelho.

Nesse outro blog, finalizo essa questao pois tinha me esquecido de acrescentar o zip
que foi mandando no exemplo
Blog Windev-mobile-30-pdf-ler-pdf-direto-do.html

http://repository.windev.com/
http://repository.windev.com/resource.awp?file_id=244;android-lecteur-pdf-autonome-dans-champ-html-url-fichiers-locaux

Video - Windev Mobile - 29/... Pdf - Ler Pdf direto do Aparelho Android





















//Botao do Pdf

strMonpdf est une chaîne ="http://www.matosinformatica.com.br/listaserv.pdf"
mostra_pdf("HTML1",strMonpdf)


// Java - activerjavascript

import android.webkit.WebView;
public static void activerjavascript(String nomchamp)
{
    WebView mywebview=(WebView) getView(nomchamp);
    mywebview.getSettings().setJavaScriptEnabled(true);
}


PROCEDURE mostra_pdf(s_nome_html is string,sNome_pdf is string)
modeSVG is boolean=True
fDelete(CompleteDir(fRepExe())+"TMPPDF_*.pdf") //fSupprime(ComplèteRep(fRepExe())+"TMPPDF_*.pdf")
nomfic is string="TMPPDF_"+DateSys()+HeureSys()+sNome_pdf+".pdf"
tmpPDf is string=CompleteDir(fRepExe())+""+nomfic // est une chaîne
SI EnModeAndroid()  ET PAS EnModeTest ALORS
    //est-ce que les ressources de gestion pdf sont bien présentes ?
    SI PAS fFichierExiste(ComplèteRep(fRepExe())+"viewersvg.html") OU PAS fFichierExiste(ComplèteRep(fRepExe())+"viewersvg.js") ALORS
        fExtraitRessource("WD_pdfjs2.zip",fRepExe())
        SI fFichierExiste(ComplèteRep(fRepExe())+"WD_pdfjs2.zip") ALORS
            //decompactage de la ressource
            myarch est un entier=zipOuvre("archpdf",ComplèteRep(fRepExe())+"WD_pdfjs2.zip")
            SI myarch=0 ALORS
                zipExtraitTout("archpdf",ComplèteRep(fRepExe()))
                zipFerme("archpdf")
            FIN
        FIN
    FIN
    SI PAS fFichierExiste(ComplèteRep(fRepExe())+"viewersvg.html") OU PAS fFichierExiste(ComplèteRep(fRepExe())+"viewersvg.js") ALORS
        //aucun display possible, les ressources sont absentes.
        //retour      
    FIN
    activerjavascript(s_nome_html)
FIN
SI Gauche(sNome_pdf,4)="http" ALORS
    //1 recuperer le fichier en local avant ouverture
    SI HTTPRequête(sNome_pdf) ALORS
        fSauveTexte(tmpPDf,HTTPDonneRésultat(httpRésultat))
    FIN
SINON
    fCopieFichier(sNome_pdf,tmpPDf)
FIN

bLocalDebug est un booléen=Vrai
SI EnModeTest() ALORS
    //{nomchamp,indchamp}=strMonpdf
    //test avec localhost
    //    si localDebug alors
    //        fCopieFichier(ComplèteRep(fRepExe())+"web\viewersvg.html","c:\wamp\www\pdfjstest\web\viewersvg.html")   
    //        fCopieFichier(ComplèteRep(fRepExe())+"web\viewersvg.js","c:\wamp\www\pdfjstest\web\viewersvg.js")   
    //        nomfic est une chaine="test.pdf"+datesys+heuresys
    //       
    //        fCopieFichier(tmpPDf,"c:\wamp\www\pdfjstest\web\"+nomfic)
    //       
    //        testurl est une chaine="http://localhost/pdfjstest/"+"web/viewersvg.html?url="+"./"+nomfic+"&ti="+datesys+heuresys
    //        //{nomchamp,indChamp}=testurl
    //        LanceAppliAssociée(testurl)
    {s_nome_html,indChamp}=sNome_pdf
SINON
   
    myurl est une chaîne
    SI modeSVG ALORS
        myurl="file://"+ComplèteRep(fRepExe)+"viewersvg.html?url="+"./"+nomfic+"&ti="+DateSys+HeureSys
    SINON
        myurl="file://"+ComplèteRep(fRepExe)+"viewer.html?url="+"./"+nomfic+"&ti="+DateSys+HeureSys
    FIN
   
    {s_nome_html,indChamp}=myurl
FIN



Blog - Windev Mobile - Instalaca - Android 1/...
Blog - Windev Mobile - Instalacao - Java 2/...
Blog - windev Mobile - MyExplorer 3/...
Blog - Windev Mobile - Android - Configurar Ansi 5/...
Blog - Windev Mobile - Layout - 6/.... 
Blog - Windev Mobile - Target_Code - 8/...
Blog - Windev Mobile - Agenda Cadastrar - 9/...
Blog - Windev Mobile - Agenda Mostrar - 10/...
Blog - Windev Mobile - Agenda Alterar - 11/...
Blog - Windev Mobile - Agenda Excluir - 12/...
Blog - Windev Mobile - HyperFile Error - 13/...
Blog - Windev Mobile -Tirar Foto - 14/... 
Blog - Windev Mobile - Pegar Foto Album - 15/...
Blog - Windev Mobile - hyperfil server - Acessar Rede/Could - Parte - 16/...
Blog - Windev Mobile - Query - Criar Consulta - Looper - Parte 17/...
Blog - Windev Mobile - Query - Tabela - Parte 18/...
Blog - Windev Mobile - Query - Filtro Acrescentar - Parte 19/...
Blog - Windev Mobile - Email - Parte 20/...
Blog - Windev Mobile - Analise Bolo Receita a/.. - Parte 21/...
Blog - Windev Mobile - Analise Bolo Receita b/... - Parte 22/...
Blog - Windev Mobile - Receita Bolo c/.. - Menu/Layout - Parte 23/...
Blog - Windev Mobile - Receita Bolo d/.. - Categoria - Parte 24/...
Blog - Widnev Mobile - Receita bolo e/.. - Categoria Altera/Exclui - Parte 25/...
Blog - Windev Mobile - 26/... - Receita Bolo - Combox Categoria
Blog - Windev Mobile - 27/.. - Receita Bolo - Tabela Bolo
Blog - Windev Mobile - 28/... - Xml - Retirar Conteudo Blog - Funcao
Blog - Windev Mobile - 29/... - Pdf - Ler Pdf Direto do Aparelho Android 
Blog - Windev Mobile - 30/... - Pdf - Ler Pdf Direto do Aparelho Android - Final 
Blog - Windev Mobile - 31/... - Looper - Criar Manual e Selecionar Informação
Blog - Windev Mobile - 33/.. Xml - Ler turmas e Mostrar Looper  
Blog - Windev Mobile - 35/... - Looper Mostrar Todos Dados Alunos  
Blog - Windev Mobile - 36/... - Looper Turma Mostra direto Alunos 
Blog - Windev Mobile - 37/... - Looper - Pegando Pelo WebService  
Blog - Windev Mobile - 38/... - Windows  - Mudar o Nome doTitulo 
Blog - Windev Mobile - 39/... - Xml - Ler Posicao Inicial/Final - turmar Alunos  
Blog - Windev Mobile - 40/... - Xml - Ler Posicao Inicial/final/Especialidade/Refeito Funcao  

Nenhum comentário:

Postar um comentário

Teste

Teste
teste