Skip to main content
Participant
April 13, 2017
Question

Why can't I embed the pdf in my web page anymore

  • April 13, 2017
  • 1 reply
  • 7794 views

For weeks I have been using:

        pdfParam = "search="" + searchString + ""&toolbar=0&messages=0&navpanes=0&view=Fit";        

        url = url + "#" + Server.UrlPathEncode( pdfParam );                 

         if ( openType == "OpenOnPage" )           

         {           

             var x = GetPDF( GetPDFDiv() );           

             x.Text = "<object " +                       

                           "class=\"Object\" " +                       

                           "width=\"100%\" " +                       

                           "height=\"980x\" " + 

                          "type=\"application/x-pdf\" " +                       

                          "data=\"" + url + "\" " +                       

                          "> " +                      "

                         This browser does not support embedded PDFs. Click here to view it.         couldn't figure out to put html text in here

              ShowPDF();           

         }

Today, the PDF showed for a moment, and then an error from PDF said the "Adobe PDF Reader DC stopped working".  I was able to remove the pdfParams and then it showed ok, but the main thing I was trying to accomplish was search for a string so that the pdf was positioned to it.

So then I uninstalled the Reader and downloaded and installed the latest one.  Now I get the "This browser doesn't support..." message and it doesn't show in the page at all.  If I switch it to using an iframe, it shows, but I don't know how to use the parameters with an iframe.

This is on

   Windows 10 - Creators Update

   IE 11.0.15063.0   update versions 11.40

   Adobe Acrobat Reader DC 17.009.20044

    This topic has been closed for replies.

    1 reply

    ~graffiti
    Legend
    April 13, 2017

    Embedding a pdf on-page is a bad idea these days. Many (going on most) browsers do not even use the Adobe Reader plug-in any more. They use their own viewer. Your success may vary from one person and pdf to the other.

    Participant
    April 13, 2017

    I'm aware of all that.  It wasn't my choice to do it.  It is my job to make it work.  Which is why I asked the question.

    Participant
    April 14, 2017

    We're seeing the same issue here with our application that uses a frameset to embed a pdf document. If I remove the #Search parameter it works fine. Note that Page still works in the embedded case so only Search (that I've tested) seems to be broken.

    The ChangeLog for this version doesn't have any information if this change is intentional. I assume it isn't since it results in a crash instead of just ignoring the parameter.

    A direct display of the file using the same link works so the problem only affects attempts to embed the document. I can't use a meta refresh to show the file or a javascript call to change the window as both disrupt the browser history. The files I'm displaying and the search terms are generated on the fly so I can't provide direct links to the files.

    Anyone see any responses from Adobe on this?


    I've spent a day so far just trying to get my embedded pdf to work AT ALL.  I've been reading on the web, but I have no idea why it stopped working (and yet does work from REAL IIS rather than IIS Express in Visual Studio.