NetTalk Central

Author Topic: Display PDF  (Read 3021 times)

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Display PDF
« on: January 09, 2013, 12:13:18 PM »
In my app, I've set up a procedure to upload and store PDF files. I also want to be able to display them. I set up a view button in the browse and assume using Submit to display it on a new page. My question is how do I load it to the new URL. What do I put in the button's URL field in order to display that file and/or what do I need to do in advance to be sure that Adobe Reader or other viewer is available?

Regards,

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Display PDF
« Reply #1 on: January 09, 2013, 09:05:28 PM »
>> What do I put in the button's URL field in order to display that file and/or what do I need to do in advance to be sure that Adobe Reader or other viewer is available?

let's do this one first. Certainly from the server side there's no way to know off-hand if the PDF-Plugin is available. I suppose you might create some JavaScript to detect it - I don't know if that's possible - but it would be prone to failure as browsers change, as new (possibly mobile) browsers appear and so on.

On the other hand if the plugin is not available the browser will offer to open the file "in the registered program for that file type" - meaning it'd open in a PDF reader outside the browser. If there is no PDF reader on the machine, well, I've not bothered myself to go there. I think PDF is sufficiently wide-spread that people either have a reader, or have someone they can ask about getting a reader.

So in short, personally, this falls into "not my problem" - it's the user's problem, and one I'm guessing in the vast majority of cases has already been solved.

>> My question is how do I load it to the new URL.

there's a URL field for the button which you can set. All you need is the name of the file. (assuming the pdf is in the web folder) or a relative pathname if it's in some sub folder.

cheers
Bruce



markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Display PDF
« Reply #2 on: January 11, 2013, 03:31:24 PM »
I entered the pdf file name in the button's URL field (for example: 'test.pdf' with the single quotes around the file name). I put that file into the web subfolder. After I compile, I go to the browse where the button is located on a browse row. When I click on the button though, the prior screen is reloaded. I have no idea why. My understanding is that the Submit should load a new browser tab with the respective content, in this case the specified pdf file.

Is there any example app with a Submit example?

Mark

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Display PDF
« Reply #3 on: January 13, 2013, 05:29:16 PM »
try the Hyperlinks example.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Display PDF
« Reply #4 on: January 13, 2013, 08:58:28 PM »
>> My understanding is that the Submit should load a new browser tab with the respective content,

no, Submit does something different.
You should have the button type set to "Button" and the target set as '_blank'

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Display PDF
« Reply #5 on: January 15, 2013, 11:11:04 AM »
Got it.

Thanks.