ShowWebPopUp not showing a PDF

I’m about to rip what little hair I have remaining over this, so If somebody knows the solution then please step forward!

I use a native.showWebPopUp to display local PDFs for reading offline. This works fine when they’re downloaded. However, when the user first starts the program I want them to be able to view a “getting started” pdf that is located within the ResourceDirectory.

It doesn’t work :frowning:

Does anybody have any ideas why?

If you need me to put anything up, just ask :slight_smile:

Without seeing your code it is very hard to debug it.

This is the code I use to display a PDF, however I find (no I can actually test it) that it, too, does not show anything on an Android tablet:

local webView = native.newWebView( 0, 0, display.contentWidth, display.contentHeight ) webView:request( "daily.pdf", system.ResourceDirectory )

Yeah, the responses are different for Android and iOS I have found.

local platformInfo = system.getInfo("platformName") local fileToOpen = "Getting Started.pdf" if platformInfo == "iPhone OS" then if fileToOpen == "Getting Started.pdf" then local options = { hasBackground=true, baseUrl=system.ResourceDirectory, urlRequest=listener } webView = native.showWebPopup(0,83, display.contentWidth, display.contentHeight ,fileToOpen, options) end

I have tested for spaces in the file name and it doesn’t seem to be the cause of the problem

How about this code to display  PDF:

public static string FolderName = “c:/”;
private void button1_Click(object sender, EventArgs e)
{
string fileName = FolderName + “Sample.pdf”;

REDocument doc = REFile.OpenDocumentFile(fileName, new PDFDecoder());//use PDFDecoder open a pdf file
BasePage aPage = doc.GetPage(0);//get page from REDocument

REImage img = (REImage)aPage.ToImage();//translate page to image
}

That’s C#, not Lua and as such cannot run in Corona.

Without seeing your code it is very hard to debug it.

This is the code I use to display a PDF, however I find (no I can actually test it) that it, too, does not show anything on an Android tablet:

local webView = native.newWebView( 0, 0, display.contentWidth, display.contentHeight ) webView:request( "daily.pdf", system.ResourceDirectory )

Yeah, the responses are different for Android and iOS I have found.

local platformInfo = system.getInfo("platformName") local fileToOpen = "Getting Started.pdf" if platformInfo == "iPhone OS" then if fileToOpen == "Getting Started.pdf" then local options = { hasBackground=true, baseUrl=system.ResourceDirectory, urlRequest=listener } webView = native.showWebPopup(0,83, display.contentWidth, display.contentHeight ,fileToOpen, options) end

I have tested for spaces in the file name and it doesn’t seem to be the cause of the problem

How about this code to display  PDF:

public static string FolderName = “c:/”;
private void button1_Click(object sender, EventArgs e)
{
string fileName = FolderName + “Sample.pdf”;

REDocument doc = REFile.OpenDocumentFile(fileName, new PDFDecoder());//use PDFDecoder open a pdf file
BasePage aPage = doc.GetPage(0);//get page from REDocument

REImage img = (REImage)aPage.ToImage();//translate page to image
}

That’s C#, not Lua and as such cannot run in Corona.