Search code examples
djangopdfdjango-modelsdjango-viewsxfdf

XFDF pdf opening in same window in IE


I'm working on a project that collects data from the project then displays it using xfdf to populate a .pdf file. Now when I use Chrome or Firefox it opens in a new tab which is exactly what I want, but some of my clients will be using IE, which opens it in the same window and causes some confusion. What area of the code should I be looking at in order to tackle and solve this problem?

I can show code examples, just let me know what I need to show.

Thanks,

Steve

Edit: When I click 'Print Application' button, it asks me to save or open the file. When they click open, it opens in the same tab, I want it to appear in a new tab.


Solution

  • In my experience, the best way to accomplish this is to alter your template linking to the PDF. For example:

    <a href="/path/to/my.pdf" target="_blank">Clicky!</a>
    

    This should work in all browsers.