Welcome! Log In Create A New Profile

Advanced

[WB24] Opening the default PDF Reader with a PDF document

Posted by DarrenF 
[WB24] Opening the default PDF Reader with a PDF document
February 13, 2020 12:28PM
Hi guys,

I've created a PDF document in WB24 and it's sitting on the server. Now, by programming, I need to open it in the user's default PDF software (I say "default PDF software" because it might not necessarily be a PDF reader).

I've also looked at FileDisplay, which opens it in a browser (which is fine), but I also need the ability to open multiple PDF documents in separate browser tabs which I don't think FileDisplay can accommodate.

Does anyone have a neat way of doing it?

Regards,
Darren.
filedisplay is the right way... just set the target of your button/link to 'new browser'...
Re: [WB24] Opening the default PDF Reader with a PDF document
February 13, 2020 03:53PM
Thanks Argus,

Every day is a school day! I'll persevere with FileDisplay… thumbs up

Regards,
Darren.
Re: [WB24] Opening the default PDF Reader with a PDF document
February 15, 2020 08:21PM
Hi,

Nothing seems to work!

Tried every combination of parameters with FileDisplay, but it seems FileDisplay cannot work when called from a Dialog Page? ...or maybe it thinks something is in Ajax mode as the Help states it can't be used with Ajax

I've even changed my solution so that I can call the FileDisplay from a button that is a Browser only button... still no luck! sad smiley

What am I doing wrong? I've tried adding the following variations to a Browser button and all are run in "GO" test mode:

FileDisplay(sFileToDisplay)
FileDisplay(sFileToDisplay,"_blank")
FileDisplay(sFileToDisplay,NewBrowser)
FileDisplay(sFileToDisplay,"application/pdf")
FileDisplay(sFileToDisplay,NewBrowser,"Window Name")

I even tried hard coding the path/filename and it still doesn't work:

FileDisplay("C:\WB24 Projects\ProjectFolder\Project_WEB\PDFDocument.pdf",NewBrowser)

None of them work - it's driving me up the wall as we say in the UK!!

Does anyone have some example code? Or maybe this can be done via the Advanced tab on the properties window of the Push Button?

Regards,
Darren.



Edited 1 time(s). Last edit at 02/16/2020 02:02PM by DarrenF.
Re: [WB24] Opening the default PDF Reader with a PDF document
February 16, 2020 07:57PM
After much trial and error, I have found the resultion to my problems - the Help isn't very Helpful in this instance.

The example I gave:

FileDisplay("C:\WB24 Projects\ProjectFolder\Project_WEB\PDFDocument.pdf",NewBrowser)

...only works if the command is issued as the following:

FileDisplay("/Project_WEB/PDFDocument.pdf",NewBrowser)

Oh, and don't rely on the Position function with the "FromEnd" option to try to extract the filename and 1st folder name (as above), because the Position function doesn't work in WB Browser mode ...I had to write my own Proc using "While" and the Middle function!

Regards,
Darren.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: