PDF to open in app

Is any one familar to whether there is a way to have a button lead to the opening of a PDF or some sort of file? [import]uid: 131530 topic_id: 34824 reply_id: 334824[/import]

Hello,
This thread should answer (some) of your questions:
http://developer.coronalabs.com/forum/2012/11/10/open-pdf-file-newwebview

Best regards,
Brent Sorrentino [import]uid: 200026 topic_id: 34824 reply_id: 138436[/import]

I’ve done something similar and it worked fine for me:

[lua]local function loadURL_Listener(event)
local shouldLoad = true
local url = event.url
if 1 == string.find(url, “corona:close”) then
shouldLoad = false
end

if event.errorCode then
– Error loading page
print( "Error: " … tostring( event.errorMessage ) )
shouldLoad = false
end

return shouldLoad
end

native.showWebPopup( 0, 60, 320, 480, “ThingsToDo.pdf”, {baseUrl=system.ResourceDirectory, autoCancel = true, urlRequest=loadURL_Listener} )[/lua] [import]uid: 64538 topic_id: 34824 reply_id: 138469[/import]

Hi Alex,
That looks like a very good module. Thanks for bringing it to my attention! I’m going to bookmark this for future reference, most certainly.

Best regards,
Brent [import]uid: 200026 topic_id: 34824 reply_id: 138478[/import]

Hello,
This thread should answer (some) of your questions:
http://developer.coronalabs.com/forum/2012/11/10/open-pdf-file-newwebview

Best regards,
Brent Sorrentino [import]uid: 200026 topic_id: 34824 reply_id: 138436[/import]

I’ve done something similar and it worked fine for me:

[lua]local function loadURL_Listener(event)
local shouldLoad = true
local url = event.url
if 1 == string.find(url, “corona:close”) then
shouldLoad = false
end

if event.errorCode then
– Error loading page
print( "Error: " … tostring( event.errorMessage ) )
shouldLoad = false
end

return shouldLoad
end

native.showWebPopup( 0, 60, 320, 480, “ThingsToDo.pdf”, {baseUrl=system.ResourceDirectory, autoCancel = true, urlRequest=loadURL_Listener} )[/lua] [import]uid: 64538 topic_id: 34824 reply_id: 138469[/import]

Hi Alex,
That looks like a very good module. Thanks for bringing it to my attention! I’m going to bookmark this for future reference, most certainly.

Best regards,
Brent [import]uid: 200026 topic_id: 34824 reply_id: 138478[/import]