Alpha Video Training
Results 1 to 5 of 5

Thread: Easy way to display PDF file in web browser per file location listed in grid

  1. #1
    Member
    Real Name
    Carsell Lankford
    Join Date
    Aug 2015
    Location
    Fontana, CA
    Posts
    94

    Default Easy way to display PDF file in web browser per file location listed in grid

    Hello,

    I'm hoping someone can post an easy way to display a PDF image in a new web browser or window per a file location provided in a field called {ImageCode}.

    In particular I'm trying to display the PDF without actually having to utilize a file location hyperlink. The reason being is because I had the hyperlink working perfectly in IE, however when trying to utillize the exact same hyperlink in Chrome it did not work. I know this is very well documented that for security reasons Chrome cannot resolve a file-location hyperlink due to "Security" reasons.

    So, at this point I'm trying to devise a more "universal" way to display my library of 400k+ PDF documents that are currently not stored in the A5W root folder.

    Any suggestions? Even open to finding a way to tweak Chrome to be able to resolve these type of hyperlinks, however I have downloaded a few apps/extensions in Chrome including Local Links, but still does not work.

    Please help.

    Thanks.

    -Casey

  2. #2
    Member
    Real Name
    Carsell Lankford
    Join Date
    Aug 2015
    Location
    Fontana, CA
    Posts
    94

    Default Re: Easy way to display PDF file in web browser per file location listed in grid

    Hopefully someone can post the most simple code (no security or messages required) to simply display a PDF image within an a5w page? Or even advise of a "universal" way to hyperlink to a file location not stored in the root? This is only for company users signed in with VPN??

  3. #3
    Member
    Real Name
    Clint
    Join Date
    Oct 2012
    Posts
    95

    Default Re: Easy way to display PDF file in web browser per file location listed in grid

    Quote Originally Posted by clankford View Post
    Hopefully someone can post the most simple code (no security or messages required) to simply display a PDF image within an a5w page? Or even advise of a "universal" way to hyperlink to a file location not stored in the root? This is only for company users signed in with VPN??
    Maybe you could try the following.

    Create a table that contains at least 3 fields, KEYID INT field (SQL next number unique that kind of thing), pretty name to show, url location of the pdf (this assumes you don't already have a table)

    Create a grid that uses that table. In the fields, change the URL to be a hyperlink that shows pretty name but launches the url found in the url location field.

    You can specify that it opens in a new window, panel, etc rather than in the same window of your grid.

    Once you have this working you can add other fields to limit access (group rights, audience, private, etc) and then use the built in search options to give them access to the data that's most useful to them. This could be done in a list but the grid will be easier and faster to build I believe.

  4. #4
    Member
    Real Name
    Frank Harrison
    Join Date
    Apr 2010
    Location
    Dallas, TX
    Posts
    22

    Default Re: Easy way to display PDF file in web browser per file location listed in grid

    In a UX add a list in a panel.
    in the List Properties onclick event copy and paste this code below.
    In this example, the attacheddocumenturl field stores the location(URL) of the file in a database.
    Using the Google Docs viewer will allow you to view the PDF on many devices.

    var fn = 'https://docs.google.com/viewer?embedded=true&url=' + this.selectionData[0].attacheddocumenturl;
    showPdf(fn);
    -----------------------------------------------------------------------------------------------
    Add this code below to the Javascript Functions of the UX.
    note:PANELCARD_6 is a panel card with nothing in it.
    -----------------------------------------------------------------------------------------------

    function showPdf (fn){
    {dialog.object}.panelSetActive('PANELCARD_6');
    var id = {dialog.object}.panelGetId('PANELCARD_6','body');
    var ele =$(id);
    ele.src = fn;

    {dialog.object}.panelSetActive('PANELCARD_6');

    }


    For a better explanation, view these videos:
    http://www.ajaxvideotutorials.com/V1...InaPanel_1.swf
    http://www.ajaxvideotutorials.com/V1...InaPanel_2.swf

  5. #5
    "Certified" Alphaholic kkfin's Avatar
    Real Name
    Kenneth
    Join Date
    Dec 2006
    Location
    EU
    Posts
    1,520

    Default Re: Easy way to display PDF file in web browser per file location listed in grid

    Maybe Node solution would work here also.

    So if a xbasic pointer variable has the location nodestatic.myfile =""\\server\c$\data\pdf.pdf" you can then use xbasic script to start an separate node server to serve this pdf-file in a browser window for example in port 8125. Sounds complicated but it is not. If you are interested let me know.

Similar Threads

  1. unable to download a PDF file from Android browser
    By sofist2010 in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 02-13-2013, 05:10 PM
  2. display image reference file images in a pdf report for web application
    By lemandras in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 03-24-2011, 11:15 AM
  3. Display a PDF file
    By GarthMc in forum Application Server Version 10 - Web/Browser Applications
    Replies: 9
    Last Post: 11-29-2010, 11:18 PM
  4. Display text file in browser
    By Bill Parker in forum Application Server Version 8
    Replies: 5
    Last Post: 05-09-2007, 12:20 PM
  5. Replies: 1
    Last Post: 03-28-2007, 02:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •