LoadLocalFile Question

1
0
-1

I am attempting to save and display a pdf file in a mobile app using the following code.  of_loadlocalfile returns -1 and the code displays the following message:

loadlocalfile error: "rc: -1 file: /var/mobile/Containers/Data/Application/7BC99...490/Documents/17574048/plugin/Leads.pdf error:"

What am I doing wrong?

////////////////////////////////////////////////////////////////////////////////////////////////

int  li_rc
string ls_filename = 'Leads.pdf'
string ls_filepath
eon_mobile_webviewex luo_webview

li_rc = dw_prospect_admin.saveas(ls_filename, PDF!, true)
if li_rc <> 1 then
    messagebox('saveas error', 'rc: ' + string(li_rc))
    return
end if

if gs_clienttype = 'MOBILE' THEN
    ls_filepath = appeongetcachedir() + '/plugin/' + ls_filename
    if not fileexists(ls_filepath) then
        messagebox('file does not exist', ' file: ' + ls_filepath)
        return
    end if
    luo_webview = create eon_mobile_webviewex
    li_rc = luo_webview.of_loadlocalfile (ls_filepath)
    if li_rc = 1 then
        messagebox('loadlocalfile success', 'file: ' + ls_filepath)
    else
        messagebox('loadlocalfile error', 'rc: ' + string(li_rc) + ' file: ' + ls_filepath + ' error: ' + luo_webview.is_errortext)
    end if
    destroy luo_webview
end if

Question Tags: 

Answers

Marco Meoni answered LoadLocalFile Question

1
0
-1

Hi Steve,

1) use iNet, see method 1 on Appeon knowledgbase:

https://www.appeon.com/developers/get-help/knowledgebase/how-display-pdf-files-mobile-devices.html

2) use Google Docs:

https://www.appeon.com/support/documents/appeon_online_help/2017/workarounds_and_api_guide/ch01s04s16.html#d0e25241

Cheers,
Marco

Mark Lee answered LoadLocalFile Question

1
0
-1

Hi Steve,

This eon_mobile_webviewex object is a visual object. You need to put this object onto the window in order to call it and you must use the Appeon Workarounds PBL or it won’t work.

You may find it in the default directory C:\inetpub\wwwroot\appeon\developTempFile\appeon_workarounds\appeon_workarounds.pbl after you installed PowerServer Mobile (PB Edition)

 

Regards,

Mark Lee

Heino Hellmers answered LoadLocalFile Question

1
0
-1

Hi,

 

For ios:

as already told by Chris WebView only works for ios and also the object it is a visual  userobject and has to be used as in pb.. Put the WebView Control onto a Window ...

for Android:

just use the run function on the pdf file. Android will open the pdf file by a PDF Reader installed onto your system.

We are using  both solutions dependent on the platform in our on mpbile apps and it works fine for us.

Best Regards

Heino