1. Steve Mason
  2. PowerServer Mobile (Obsolete)
  3. Tuesday, 5 December 2017 22:41 PM UTC

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

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 6 December 2017 02:15 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 1

Hi Steve;

  Note that this command will only work on iOS. So if you are on an Android device, I would use the iNET object instead.

Regards ... Chris

Comment
  1. Steve Mason
  2. Thursday, 7 December 2017 21:00 PM UTC
I am getting this error on an IOS device.

  1. Helpful
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Wednesday, 6 December 2017 08:49 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 2

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

Comment
There are no comments made yet.
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Friday, 8 December 2017 07:48 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 3

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

Comment
There are no comments made yet.
Heino Hellmers Accepted Answer Pending Moderation
  1. Friday, 8 December 2017 20:03 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 4

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

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.