CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009
    Location
    BC, Canada
    Posts
    9

    Question PDF Document Title in Browser

    I'm not sure where this question might fit, so I'll try it here.

    I'm loading a pdf file into a browser from a javascript function [x=window.open("myfile.pdf", etc)]. When the document loads, the title that appears at the top of the pdf page is the file name (ie) or name + path (firefox). What I would like to be able to do is change this title.

    I tried the obvious javascript commands without success. I also tried in Adobe Acrobat Pro 9 to cause the document title rather than file name to appear - all without success.

    Does anyone know if I can change the title of a pdf page as it appears in the browser - either through javascript or through tweaking the pdf in Acrobat?

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: PDF Document Title in Browser

    The browser handles the title based on what type of document it is loading. Since you are loading a PDF file straight up, the browser will give the file's path as the window title. You cannot change this in any way. That is just how the browser does it.

    Your other option is to load the PDF into some embedded object which will display the PDF document.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Nov 2009
    Location
    BC, Canada
    Posts
    9

    Re: PDF Document Title in Browser

    Thanks for your feedback on this, PA.

    After way too much googling, tinkering, and page-flipping, I'd pretty much come to this conclusion - but it is helpful to hear it straight up.

    Pity, though, that the powers that be haven't made it easy to set the browser title in something so ubiquitous as a pdf file. Ah well, I will look at wrapping the pdf in some HTML.

    Thanks Again.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured