Opening Document Library PDF in a New Window (Sharepoint 2013)

Hello,
I have numerous PDF's in a document library. When the PDF opens in the browser, the PDF's contain links to various other sites; however, when the user clicks the link on the PDF from the document library, the link opens in the same window as the PDF. I would
like the link to open the PDF in a new browser window.
I have searched Google but cannot find anything for SharePoint 2013. We are hosting our SharePoint on the Office 365 package.  I found one solution that is repeated on many forums, but I do not see the "Convert to XSLT data view" anywhere
in SharePoint designer 2013. The solution states:
"Edit the document library in SharePoint Designer.
1. Open the site in SharePoint Designer and then open the document library allitems.aspx.
2. Right-click the document library web part and select “Convert to XSLT data view”.
3. Locate the name column, you will see this tag “<A onfocus="OnLink(this)" HREF="{@FileRef}"….. ”, add “target=”_blank”” in tag.
4. After this, the documents will be opened in a new window."
I do  see my allitems.aspx and can open that with a text editor. The contents of that file are:
<%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=16.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="ApplicationPages" Namespace="Microsoft.SharePoint.ApplicationPages.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server"><SharePoint:ListProperty Property="TitleOrFolder" runat="server"/> - <SharePoint:ListProperty Property="CurrentViewTitle" runat="server"/></asp:Content>
<asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
<SharePoint:RssLink runat="server" />
</asp:content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server"><SharePoint:ViewIcon Width="145" Height="54" runat="server" /></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server">
<SharePoint:RecentChangesMenu runat="server" id="RecentChanges"/>
<SharePoint:ModifySettingsLink runat="server" />
</asp:Content>
<asp:Content ContentPlaceHolderId ="PlaceHolderBodyLeftBorder" runat="server">
<div height="100%" class="ms-pagemargin"><img src="/_layouts/15/images/blank.gif?rev=32" width='6' height='1' alt="" data-accessibility-nocheck="true"/></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main" />
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">
<SharePoint:ListProperty CssClass="ms-listdescription" Property="Description" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderCalendarNavigator" runat="server">
<SharePoint:SPCalendarNavigator id="CalendarNavigatorId" runat="server"/>
<ApplicationPages:CalendarAggregationPanel id="AggregationPanel" runat="server"/>
</asp:Content>

did you try this one?
http://social.technet.microsoft.com/Forums/sharepoint/en-US/71b24f4b-570a-48fa-9ec3-91073eafaebd/open-pdfs-in-new-window?forum=sharepointadminprevious
or trying to use the content editor web part...
http://social.technet.microsoft.com/Forums/sharepoint/en-US/9db08c4a-b53c-419a-84f8-001c194d1311/how-to-open-sharepoint-document-library-pdf-file-in-new-window?forum=sharepointadminlegacy
try this solution...check the column which having the clickable link.
http://social.technet.microsoft.com/Forums/sharepoint/en-US/99e9559a-da76-4722-982c-882b3e4181c7/hyperlink-column-type-open-in-new-window
Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

Similar Messages

  • Open a generated pdf file in new window

    Dear all,
    I'm using JDev ADF 11.1.1.4.0
    I use the command button method to generate pdf file with JasperReports and I store it into the public folder /reports/test5.pdf. To open this file I can use goLink or goButton with target frame _blank, but how can I open this file automatically after generation?
    I was reading about fileDownloadActionListener, but it's not what I need, I just want to open the file in new window browser.
    Any help will be appreciated.
    Regards,
    Wojtek.

    try this
    HttpServletResponse response = (HttpServletResponse) FacesContext
                                      .getCurrentInstance().getExternalContext().getResponse();
                       ServletOutputStream servletOutputStream;
                       servletOutputStream = response.getOutputStream();
                       byte[] bytes = null;
                       JasperDesign jasperDesign;
                                try {
                                        jasperDesign = JRXmlLoader.load(ios);
                                        jasperReport = JasperCompileManager.compileReport(jasperDesign);                
                                        JRPdfExporter exporter = new JRPdfExporter();
                                        JasperPrint jasperPrint;
                                        jasperPrint =
                                                JasperFillManager.fillReport( jasperReport, parameters, connection );
                                    } catch (JRException e) {
                                            e.printStackTrace();
                                bytes =
                                JasperRunManager.runReportToPdf(jasperReport,parameters, connection);
                       response.addHeader("Content-disposition", 
                       "attachment;filename=sale.pdf"); 
                       response.setContentType("application/pdf");
                       response.setContentLength(bytes.length);
                       servletOutputStream.write(bytes, 0, bytes.length);
                       servletOutputStream.flush();
                       servletOutputStream.close();
                       context.responseComplete();
                            } catch (IOException e) {
                        e.printStackTrace();
                    } catch (JRException e) {
                         e.printStackTrace();
                    }

  • Open PDF's in new window in document library when using "Find a file" search

    I need to be able to open PDF's in a new window from a document library when using the "Find a file" search built into the document library "All documents" view. I currently have the following javascript on the page:
    _spBodyOnLoadFunctionNames.push("setTargetBlank()");
    function setTargetBlank()
    { $("a[href$='.pdf']").removeAttr('onclick').attr("target", "_blank");
    This works great when going to the document library and navigating through the folders then clicking on a link.
    The problem is when someone goes to the document library then uses the "Find a file" search and then they click on a link. The "Find a file" search does not do a postback (reload) of the page, therefore my javascript to find the PDF links
    and make them open in a new window does not run for the links on the page.
    I have read the following article but this does not seem to offer a solution that will work in this situation for SharePoint 2013 (Office 365): http://social.technet.microsoft.com/Forums/sharepoint/en-US/7ad3224c-3165-47ae-95bc-4f3928e2f9a8/opening-document-library-pdf-in-a-new-window-sharepoint-2013?forum=sharepointgeneral
    I suppose the idea solution would be to somehow tap into the event that is fired when using "Find a file" search to run my javascript and update the links for the search results.
    Can anyone offer any solutions to this issue?

    Hi,
    According to your description, my understanding is that you want to open PDF files in a new window from a document library when using the "Find a file" search.
    As you said, the "Find a file" search does not do a postback (reload) of the page, therefore JavaScript to find the PDF links and make them open in a new window does not run for the links on the page.
    I recommend to use JS link to achieve the goal. Create a JavaScript override file and upload the JavaScript file to the Master Page Gallery, and then set the JS Link property of the document library web part to point to the JavaScript file.
    Here are some links about the JS link in SharePoint 2013 for you to take a look:
    http://www.idubbs.com/blog/2012/js-link-for-sharepoint-2013-web-partsa-quick-functional-primer/
    http://www.learningsharepoint.com/2013/04/13/sharepoint-2013-js-link-tutorial/
    http://zimmergren.net/technical/sp-2013-using-the-spfield-jslink-property-to-change-the-way-your-field-is-rendered-in-sharepoint-2013
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • File Open Issues - document library pdf file to open in new browser window

    Hi
    I have a requirement to open the document library containing pdf file to open in new browser window. So far I have tried following steps but could not get it to work.
    1. Changing Document library advance setting to open the document in browser (have tried others as well).
    2. SharePoint web application setting changed as Permissive instead of Strict. Here the pdf file opens in browser but redirect from document library instead of new window(Also tried adding Target=”_blank” and no change).
    3. Executed the powershell script to adding MIME type to see if it works but no change.
    $webApp = Get-SPWebApplication http://SharePointSite
    If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains "application/pdf")
    Write-Host -ForegroundColor White "Adding PDF MIME Type..."
    $webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")
    $webApp.Update()
    Write-Host -ForegroundColor White "Added and saved."
    Else
    Write-Host -ForegroundColor White "PDF MIME type is already added."
    4. Open the Doc library and modified ALLItems.aspx to add Target= “_blank”
    5. I have already tried solutions suggested in the link:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/9db08c4a-b53c-419a-84f8-001c194d1311/how-to-open-sharepoint-document-library-pdf-file-in-new-window?forum=sharepointadminlegacy
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/530e2ea1-d77d-491c-935f-04f536e439a5/open-a-pdf-document-to-a-new-browser-in-the-document-library-web-part?forum=sharepointadminlegacy
    http://mindsharpblogs.com/todd/archive/2005/08/16/654.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/7b6091df-4657-4799-ba02-259ebd7e4b7c/pdf-doesnt-open-in-document-library?forum=sharepointadminlegacy
    Appreciate if there are any working solution from any of you. Many Thanks

    I found a solution which works only in the development. No idea when I compared, Browser MIME type is enabled, STRICT browser type is configured for web application. on the document library advance setting, default to open in new browser. Both configurations
    are identical but I am able to open pdf file in new window in my developing using jquery script
    http://blog.ithinksharepoint.com/2011/02/21/open-pdf-files-from-a-document-library-in-a-new-window/ but the same does not work on production server :(
    Any help experts?
    Thanks

  • Open a document in a new tab or browser window Sharepoint 2013

    Customer requirement states that a doc must be opened in the browser, but requires that it open in a new window or tab.  I know that this is bad practice, but customer is the customer.  Please provide the best course of action.  95% of docs
    will be PDFs and can not use client application as the means of opening.  Appreciate your help and easiest, simplest solution.

    Hi,
         Similar question has been asked in the forum, hope it will help:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/9db08c4a-b53c-419a-84f8-001c194d1311/how-to-open-sharepoint-document-library-pdf-file-in-new-window?forum=sharepointadminlegacy
    Take a look to the articles given in below link too.
    http://office.microsoft.com/en-in/sharepoint-server-help/change-how-to-open-a-document-in-a-library-with-one-click-HA101729873.aspx
    http://www.benramey.com/2011/04/25/opening-all-sharepoint-2010-documents-in-a-new-window/
    Regards,
    MS

  • Opening Document Library Files in New Tab

    Hi,
    Is there any setting to enable so that all the files saved in the document library (PDF, WORD etc) gets opened in a new tab.
    Now its opening in the same tab. I need all other links to open in the same tab, only documents to a different tab.
    I am using SharePoint 2010 Enterprise.
    Any Help?
    Thanks.

    A little JavaScript employing jQuery does the job just perfectly.
    $(document).ready(
    function ()
    // has to be on an interval for grouped doc libraries
    // where the actual links are loaded only once a group
    // is expanded
    setInterval(
    function ()
    $("a[onclick*='return DispEx'][target!='_blank']")
    .attr("target", "_blank")
    .removeAttr("onclick");
    // document type icons
    $("td.ms-vb-icon>img[onclick]:not([documentUrl])")
    .click(function (e)
    window.open($(this).attr("documentUrl"), "_blank");
    e.stopPropagation();
    e.preventDefault();
    return false;
    .each(function ()
    $(this).attr(
    "documentUrl",
    $.trim(String($(this).attr("onclick"))
    .split("=")[1]
    .replace(/["'{}]/g, "")
    .split(";")[0])
    this.onclick = null;
    500
    For other options you can also check:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/9db08c4a-b53c-419a-84f8-001c194d1311/how-to-open-sharepoint-document-library-pdf-file-in-new-window?forum=sharepointadminlegacy
    http://www.codeproject.com/Tips/722356/Open-Links-in-a-New-Window-in-SharePoint
    http://www.benramey.com/2011/04/25/opening-all-sharepoint-2010-documents-in-a-new-window/

  • Opening PDFs in a New Window

    Is there a good way to code a link to a PDF on a web page that would ensure that the PDF opens in Reader or in a new browser window/tab instead of in the same window/tab?
    Even though modern browsers allow users to configure their setup to allow PDFs to be opened within the same browser window (this might even be the default behavior nowadays), I've found that many customers end up closing the entire browser by accident after they finish reading the PDF. Then they have to open the browser back up again, sign in again, and navigate back to where they were. In order to reduce the chance of this happening, and to provide a better customer experience, I would like to force the PDF to open in Reader or in a new window/tab.
    However, when I have tried to do this in the past, I have run into many types of errors based on the different browser/platform/version combos that exist out there. Examples:
    Two browser windows are opened -- one blank and one with the PDF.
    The PDF opens in Reader, but a blank window/tab is also opened.
    The PDF won't close. I have to close the window that spawned it first.
    Many of these errors seem to occur on computers where the user has already set up their computer to not allow PDFs to open in the same window/tab. So that when I do something to force the PDF to open elsewhere, it kind of happens twice.
    Is there a nice, clean way to do this?
    Thanks,
    David Ashleydale

    Welcome to the Apple Discussions. To get the pdf file to open in a new browser window you will need to first upload the pdf file to the server and then create a text or image hyperlink to an external page and use the URL to the pdf file. If you have a MobileMe account and put the pdf file in the Web/Sites folder the URL you would use in the Inspector/Links pane would be:
    http://web.me.com/yourMMe_accountname/filename.pdf
    If you were to add a folder to the Sites folder titled PDFs and put the file in it the link would be:
    http://web.me.com/yourMMe_accountname/PDFs/filename.pdf
    OT

  • Opening A BI Publisher PDF In A New Window

    I have a process in Apex were the user clicks on a button to open a BI Publisher in a new window.
    The user clicks the button, the new window appears (blank), then the adobe file download window appears and they have to click open. Then the adobe file download disappears and the report appears in another new window.
    javascript:popupURL('&BI_URL.Guest/TEST/TEST/TEST_414/MER_FORM_414A/MER_FORM_414A.xdo?_xpf=&_xpt=1&P_FORM414_ID=&PXX_FORM_414_ID.&_xt=MER_FORM_414A&_xf=pdf')When they close the report window, the blank window is still there and they have to close that aswell
    The users are complaining that there are too many clicks. Is there a way so that the adobe file download window does not appear and the report opens automatically.
    Help appreciated
    Gus
    Edited by: Gus C on Nov 11, 2010 2:29 AM

    Sorted
    Gus

  • Display pdf in a new Window in a JSPDynPage

    I need to display the pdf in a new window on click of a button in the iview. The pdf is fetched as an array of bytes from an RFC. It displays correctly, but in the same window. Pls see the extract of the code:
    To Write
    writeText(IPortalComponentRequest request, IPortalComponentResponse response, byte[] pdfResult)
    try{
    Document doc = new Document(PageSize.A4);
    javax.servlet.http.HttpServletResponse myResponse = request.getServletResponse(true);
    myResponse.setHeader ("ContentDisposition", "inline;filename=\"ShortCV.pdf\"");
    myResponse.setContentType("application/pdf");
    OutputStream os = myResponse.getOutputStream();
    os.write(pdfResult);
    PdfWriter.getInstance(doc,os);
    catch(Exception Ex){
    OnView(Event evt){
    JCO.Field Table1 = m_function.getExportParameterList().getField("PDF_STRING");
    client.execute(m_function);
    writeText(request, response, Table1.getByteArray());
    onView is called on
    Button myButton11 = new Button("myButton11");
    myButton11.setText("View");
    myButton11.setOnClick("View");
    myButton11.render(rendererContext);
    Pls advice

    Detlev .....
    I am still not able to implement your suggested solution.
    If I call javascript written in JSP, will I be able to pass a bean to it. Pls see the code that I hv in addition to the one posted ...
    In ICellRenderer ....
    if ( column == 11 )
    Button myButton11 = new Button("myButton11");
    myButton11.setText("View");
    myButton11.setOnClientClick("Test("beantv2")");
    In JSP
    <script>
    function Test(zBean)
    popAssetWinSpecs = "left=250,top=250,width=300,height=300,scrollbars=no,toolbar=no,menubar=no,resizable=no,status=no,titlebar=no,location=no";
    htmlfile="/irj/servlet/prt/portal/prtroot/AIPLetters.HersheyTeamViewerAIPPDF?zBean="+zBean;
    window.open(htmlfile,"editWindow",popAssetWinSpecs);
    return false;
    </script>
    in the doInitialization of the second comp
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentContext compcontext = request.getComponentContext();
    AIPBean = new HersheyTeamViewerAIPBean();
    HttpServletRequest zHttpRequest = request.getServletRequest();
    AIPBean = (HersheyTeamViewerAIPBean)zHttpRequest.getAttribute("zBean");
    nothing gets executed ....
    I am not sure whether I am passing the bean correctly
    Thanks for your help,
    Devina

  • Display pdf in a new window

    I need to display the pdf in a new window on click of a button in the iview. The pdf is fetched as an array of bytes from an RFC. It displays correctly, but in the same window. Pls see the extract of the code:
    To Write
    writeText(IPortalComponentRequest request, IPortalComponentResponse response, byte[] pdfResult)
    try{
    Document doc = new Document(PageSize.A4);
    javax.servlet.http.HttpServletResponse myResponse = request.getServletResponse(true);
    myResponse.setHeader ("ContentDisposition", "inline;filename=\"ShortCV.pdf\"");
    myResponse.setContentType("application/pdf");
    OutputStream os = myResponse.getOutputStream();
    os.write(pdfResult);
    PdfWriter.getInstance(doc,os);
    catch(Exception Ex){
    OnView(Event evt){
    JCO.Field Table1 = m_function.getExportParameterList().getField("PDF_STRING");
    client.execute(m_function);
    writeText(request, response, Table1.getByteArray());
    onView is called on
    Button myButton11 = new Button("myButton11");
    myButton11.setText("View");
    myButton11.setOnClick("View");
    myButton11.render(rendererContext);
    Pls advice

    See Display pdf in a new Window in a JSPDynPage

  • How to open a entity form in a new window using openEntityForm() method.

     How to open a entity form in a new window using openEntityForm() method.

    As far as I'm aware, there isn't a supported way to do this in the client-side API. You could use window.open instead
    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

  • I recently updated to version 5.0, however, when I open up a link in a new window, there is no address in the new window's address bar, just a blank box.

    I recently updated to version 5.0, however, when I open up a link in a new window, there is no address in the new window's address bar, just a blank box.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • How can I open a customized report in a new window?

    I am trying to create printable views for my reports that are published as portlets. In specific, I would like a link to open the report up in a new window where the user can print at. I have figured out how to do this with the default report created. However, after a user has customized the report, is there a way to open the customized report in a new window?

    Hi
    I do not think it matters whether your reports portlet is a default one or a customize one. I think whne you place the portlet, you can specify in the property to open up the result in new window. I think it is common feature of Portal.
    Thanks
    Rohit

  • Open a bsp page in a new window?

    Hi All,
    I am creating a BSP application wherein i have a htmlb button for "help".
    I want to open this help page in a new window, so that alongwith the help page the user can
    view other pages also simultaneously.
    Is there any way by which i can open this BSP page into a new window without loosing
    the contents of the current page on which the help button is present.
    A sample code for opening page in new window will be of great help.
    Thanks in Advance for your help.

    Hi,
    Pls try the below logic :
    <htmlb:button id = "help"
    text = "Help"
    design = "standard"
    onClientClick = "window.open('http://www.sap.com')"
    tooltip = "Help"
    />
    This will work for you.
    Regards
    CSM Reddy

  • HT6074 How do I open a page in a separate (new) window?

    How do I open a page in a separate (new) window?

    For a link to a page, control-click the link and choose to do so.
    For an already-opened page, control-click the tab and choose to open it in a new window.
    (120482)

Maybe you are looking for

  • My safari won't switch off - what can i do?

    i opened a page which should have allowed me to download a mock TOCFL exam (that's the standardized chinese exam in taiwan), but instead i just got a page of gibberish and since then skype won't let me close it, also while closing tabs there's no lon

  • Need help with coding for HTML5 Video with Flash fallback

    Hello, need help with my coding in Dreamweaver CS5.5 for HTML5 video with Flash fallback. Not sure if the coding is correct. Do I need anything else Javascipt etc?

  • How can I restore full webpages being shown when I run my mouse over the Mozilla icon on the toolbar?la

    Prior to today, when I ran my mouse over the Firefox icon on the tool bar I would get an image of whatever web page I had opened. Now, all I get is text. For example, if I had the BBC open, I could see the open web page by touching the Firefox icon w

  • Plz have a look to it..

    Hello friends, i've to make a final yr project... so i have decided to make a mail server in JAVA w/o using any mail server APIs.. do u people think its a good project to work on...??? my profs r saying that these softwares r already in the market..

  • Lightroom 5 opening problem

    I just downloaded lightroom 5 and it wont open. Flag says: Application unable to start correctly. (0xc000007b) What is the problem?