Open a local pdf file from Delphi Firemonkey Code for Android App -
this question has answer here:
note: delphi xe8, firemonkey app android 4.4.2
i trying open pdf document android app made firemonkey , open adobe acrobat, file doesn't, have found online in several webpages , have tried every 1 of them, no 1 works.
the error message
adobe can't find document open
but document in public folder, , have moved differents folder , nothing happend.
i have opened images other folders without problem, don't understand.
can give me solution please?.
procedure tform1.bttnabrirclick(sender: tobject); var nombrefichero, rutaraiz, ruta_fichero, ruta_fichero2 : string; begin // nombrefichero := 'doc1.pdf'; // rutaraiz := 'file:///storage/emulated/0/tabletbigger/images/articulos'; // rutaraiz := '/storage/emulated/0/tabletbigger/images/articulos'; // rutaraiz := '/storage/sdcard0/tabletbigger/images/articulos'; // en mi tablet // ruta_fichero := system.ioutils.tpath.combine(rutaraiz, nombrefichero); // ruta_fichero := system.ioutils.tpath.combine(system.ioutils.tpath.getdownloadspath, nombrefichero); // ruta_fichero := system.ioutils.tpath.combine(system.ioutils.tpath.getshareddownloadspath, rutaraiz); nombrefichero := 'introduccion.pdf'; ruta_fichero2 := '/storage/emulated/0/tabletbigger/images/articulos/introduccion.pdf'; ruta_fichero := system.ioutils.tpath.combine(system.ioutils.tpath.getpublicpath, nombrefichero); showtext.text := ruta_fichero; open(ruta_fichero); // ruta_fichero := stringreplace(stringreplace( ruta_fichero, '\', '\\', [rfreplaceall]), '"', '\"', [rfreplaceall]) + '"'; //_system(pansichar('open ' + ansistring(ruta_fichero))) end; procedure tform1.open(ruta_fichero : string); var intent: jintent; begin if fileexists(ruta_fichero) begin intent := tjintent.create; intent.setaction(tjintent.javaclass.action_view); intent.setdataandtype(strtojuri(ruta_fichero), stringtojstring('application/pdf')); intent.setflags(tjintent.javaclass.flag_activity_clear_top); try sharedactivity.startactivity(intent); except end; end else _messagedlg('el fichero no existe', mssinf); end;
¡solve !
the answer founded at: delphi open pdf ios/android local storage
by afzalali15.
i'll try upload whole code .
thanks anyway.
Comments
Post a Comment