PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Change DEST URL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change DEST URL

    Hello, I am a web developer using your software and was wondering if there was a way to change the #search="Search_Term". I understand you might have done this so it would open up in Adobe Acrobat, but seeing as IE is the only browser that supports it I believe URLs should be completely editable. I am working with PDFs and would like them to open up in a specific PDF viewer. To do this I need the #search="Search_Term " to be turned into &search=Search_Term. If there is anyway you could direct me where to find this answer, or maybe you have to implement this into your program. Or maybe create your own viewer since you parse the document already. Thanks!

  • #2
    The browser and operating system determine which program is used to open a PDF file not the web site. You can't force the client machine to open PDFs, in for example, Adobe Viewer.

    Comment


    • #3
      Yes, but if a viewer is expecting a certain url to parse and is following their own parsing technique it will be impossible to match thier case if it is not #search="Term". I understand it's an Adobe on open specification, but if edited would help me greatly. I need the param/url to say &search= Term not #search_term="search_term".

      Comment


      • #4
        Hacky solution below.

        $('.result_title a').each(function(){
        var link = $(this).attr('href');

        var breakIndex = link.indexOf("#");

        var searchParam = link.substr(breakIndex);

        var beginning = link.substr(0,breakIndex);

        searchParam = searchParam.replace("#","&");

        searchParam = searchParam.replace(""","");

        searchParam = searchParam.replace(""","");

        var finalOutput = beginning+searchParam;

        $(this).attr('href',finalOutput);

        //console.log(finalOutput);

        });

        Adding the ability to change the file's path is important because parameters like search are not always tied to a #. In the case of PDf.js it is tied to a & and other viewers may use different parsing logic.

        Comment

        Working...
        X