Open PDF in New External Window

Hi
how to open a PDF Report(File) in new IE Window from WebdynproJava
Regards
Dhinakar

Hi,
         If the PDF document is in the server then we can show that in the external window onClick of the button.
Write this code in the onAction button event.
try
byte[] content =this.getByteArrayFromResourcePath("<server path>\Guide.pdf");
String stResourcePath = new String("<server path>\Guide.pdf");
IWDCachedWebResource resource = WDWebResource.getWebResource(content, WDWebResourceType.PDF);
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getAbsoluteURL()," document");
window.removeWindowFeature(WDWindowFeature.TOOL_BAR);
window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
window.removeWindowFeature(WDWindowFeature.STATUS_BAR);
window.open();
catch(WDURLException ex)
catch(IOException ex)
Paste this code here:
//@@begin others
private byte[] getByteArrayFromResourcePath(String resourcePath) throws FileNotFoundException, IOException
       FileInputStream in = new FileInputStream(new File(resourcePath));
     ByteArrayOutputStream out = new ByteArrayOutputStream();
     int len;
     byte[] part = new byte[10 * 1024];
     while ((len = in.read(part)) != -1)
               out.write(part, 0, len);
               in.close();
               return out.toByteArray();
   //@@end
Regards,
Vijai

Similar Messages

  • Add button to open PDF in new browser window CS3

    I'm trying to add a button that says "Go" that will open a PDF in a new browser window.
    I've looked at the following article but don't see the "Select Action" pull-down.
    http://www.acrobatusers.com/blogs/tedpadova/opening-pdfs-new-browser-windows
    Using Dreamweaver CS3.
    Thanks in advance.

    Hi,
    I hope I understood your question correctly, if so my suggestion may be helpful. Otherwise I think it's nearly the same what paul writes, I only made clear my proposal in a website for you, first a photo:
    and here is the link: http://www.goldschmiede-blumberg.de/pdf/adob_pdf.php.
    Note 1: "Ausgabe 9" und "ein Mausklick hier genügt" are links!!
    Note 2: " Um pdf-Dateien ...." Means: To read pdf files, you need the free Adobe Reader. The current version you can download from the Adobe website.
    Look at it's source code.
    Viel Erfolg
    Hans-G.

  • Generate PDF into New External window

    Hi All,
    I have developped an application.In that I am getting the data from R/3.In my application first View displays table of data and the table row contain some invoice information when I click that Row that information would be displayed as PDFform(created using interactiveforms) in an External window.
    Any body have done same or any suggessions please.
    Advance Thanks
    Mandapati.

    Hi Mandapati,
    I am afraid, the InteractiveFrom ui element can only be used to display a pdf on the view is resides. It is not possible to display the same view of the same session within another browser at the same time.
    Therefore, you cannot use InteractiveForm ui element, but you could generate a PDF using the API Heidi refers to. The pdf can be stored inside of the cache of the application server or could be retrieved by special self-implemented handler in ICF. If I am not mistaken, there exists some information on doing something like this inside of the BSP forum as I know that it is part of Brian McKellar's und Thomas Jung's BSP book. My advise would be to search for a weblog or inside of the BSP forum (or to buy the book g). Of course, all the above only applies if you use Web Dynpro ABAP.
    Best regards,
    Thomas

  • Forcing link in one web based PDF to open link to another PDF in new browser window

    We have created a form using LiveCycle Designer ES2.  The form is found on our website and is used by faculty to submit proposal information to our office.  Depending upon the answers to questions in the form if they say yes we had a link to another form that we would like them to complete and submit with the original PDF that they are working on.  The problem that we are having is that when they click on the form it opens the new PDF and all the data that they had entered in the original PDF is gone once the new form opens up.  Is there a way to force the new PDF via the use of some scripting that can go along with the link, or via the use of a button that can force the new form to open in a new browser window?  It is impractical for us to expect 1500 faculty members to change their browser settings to open new PDF's in a new window.  We have removed the links for now and have just put in text that says if they select yes they need to go out and complete the additional form.
    The form we are using can be found here: http://spo.usu.edu/files/uploads/SP-01.pdf
    The first three questions on page two where we reference the other forms is where we would like to be able to add the links to the new forms and have them open in a new browser window.  When the form is downloaded and opened in Adobe Acrobat/Reader the links functioned correctly, it just did not function properly when it opens in a browser.
    Thank you in advance for any assistance you can offer in regards to this issue.

    I used a button, removed the border/fill properties and underlined the caption to look like a URL.
    The click event is...
    // form1.page1.subform1.urlBtn::click - (JavaScript, client)
    app.launchURL("http://spo.usu.edu/files/uploads/SP-01.pdf",true);
    The PDF will open in a new window or tab, depending upon the browser configuration.
    Steve

  • Open an image in new external window...

    Hi all,
    I have an image in the server, say "c:\hai.jpg", through my application i want to open this image in a new external window on click of a button.
    I used the following code,
              String file ="C:\images\p.JPG";
              final byte[] content = this.getByteArrayFromResourcePath(file);
              final IWDCachedWebResource resource = WDWebResource.getWebResource(content, WDWebResourceType.JPG_IMAGE);
              resource.setResourceName("p."+resource.getResourceType().getFileExtension());
              try
                   final IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(resource.getAbsoluteURL(), "WD_Filedownload", true);
                   window.open();
              catch(Exception e){
                   wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(e), false);
    This code opens a new Internet Explorer, but not the image. When i printed the AbsoluteURL of the resource, its printing null. Where am i going wrong?
    Thanks in advance,
    Pravin

    Hi Armin,
    I am using this byte array code
         private byte[] getByteArrayFromResourcePath(String resourcePath)throws FileNotFoundException, IOException
               FileInputStream in = new FileInputStream(new File(resourcePath));
               ByteArrayOutputStream out = new ByteArrayOutputStream();
               int length;
               byte[] part = new byte[10 * 1024];
               while ((length = in.read(part)) != -1) {
                 out.write(part, 0, length);
               in.close();
               return out.toByteArray();
    Thanks
    Pravin

  • Create new external window and displays the viewdata as pdf?

    Hi,
    I have developped an application that will display some textviews and one table that displays 5 records,
    for this I want display as new External window and dispay in PDF the data what we have in view.
    advise me how to approach for external window and diplay as PDF.
    Thanks,
    Lohi.
    Message was edited by:
            Lohitha M

    Thanks for your reply,
    Here my problem is now I am getting the table values as output in the Jsp.
    In Jsp I want to create Button when I click that button I need to display an external window and display the table data what ever is available that will display new external pdf.
    I have developped the applcation by using of the three files table.java,tablebean.java,table.jsp and in portalapp.xml cretated the component.
    Now  how can I perform my action in that existed Jsp page and how to display extenal window i that how to generate the PDF.
    I am in learning stage in this.
    please elobarate with atleast some snippests.
    Thanks,
    Lohi.
    Message was edited by:
            Lohitha M

  • Webdynpro application can't display a URL iView in a new External window

    Fellow developer:
    In my WD4A application, I called the method 'navigate_absolute' to display a URL iView in a new External window.
    The code is as follows:
    data lo_portal_manager type ref to if_wd_portal_integration.
    call method lo_portal_manager->navigate_absolute
    exporting
      navigation_target = 'ROLES://u2026'
      navigation_mode = '1'.            ('0' - Displayed in the Same Window, " '1' - Displayed in a new External Window)
    The application can display the iView in the same Window (navigation_mode = '0'), but cannot in a new External window (navigation_mode = '1').
    In the iView properties, the following attributes are set to:
    1. Launch in New Window - Dipslay in Separate Window
    2. Open iView Links in New Window - Yes
    If you know the answer, please advise.
    Thanks
    Bac Quan

    hi,
    i have the same problem. Did you solve it?. Please let me know...
    regards,
    MC

  • Call selected report in new External window

    Hi ,
    I have a dropdown with 10 reports. say exaploe Report1, Report2......etc
    Now when i selct a Report1 from the drop down and click on PintReport button , I would like call a new External Window. This exteral window should display the data in a table from executed related reportRFC1.
    Please can you give some advice what is the best approach to achieve this.
    Thanks
    Krish

    Hi,
    if you have the output of your reports as HTML, you can easily use this:
    html = htmlheader + htmlBody + htmlfooter;
    final IWDCachedWebResource resource = WDWebResource.getPublicCachedWebResource(html.getBytes("UTF-8"), WDWebResourceType.HTML, WDScopeType.APPLICATION_SCOPE, wdComponentAPI.getDeployableObjectPart(), "Title");
    resource.setResourceName("HTML_inline.html");
    resource.setAttachment(false);
    resource.setReadOnce(false);
    resource.setMakeCopy(true);
    IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getAbsoluteURL(), "New Window Name");
    window.show();
    Maybe you can use wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getAbsoluteURL(), "New Window Name"); In an other way. It's a method, that opens a new Browser Window.
    Best regards,
    Christian

  • I am running Vista and Windows Mail, I can not open PDF files when in Windows Mail, I must save to Desktop first, this has changes recently and I do not know why or how to fix

    I am running Vista and Windows Mail, I can not open PDF files when in Windows Mail, I must save to Desktop first, this has changes recently and I do not know why or how to fix.
    Why after 6 year's this has changed?
    I would like to open PDF's straight from Window Mail.

    Good day Jeff.
    I am running most current Adobe Reader X.
    Tks Mark

  • Invalid URL Exception while opening a file using external window in webdynp

    I am trying open an URL ythru external window on click of button in my webdynpro.
    This is the URl I am trying to open
    File://mww/Documents/Attachments/2008/10/56254/{FD803B0D-157F-47F9-A5A8-C687E1DC6B96}_break.JPG
    if I try to open from a from the browser it works fine but thru webdynpro it is throwing the error.
    mww is another system where the file is residing.
    But I am using the same techniue in other component where I am able to open file from an external window.
    File://mww/Documents/Attachments/2008/10/56254/some.jpg
    The only difference in  the URL is {FD803B0D-157F-47F9-A5A8-C687E1DC6B96}Since this URL is generated by another system I do not have any other aletrnative but I have live with this URL.
    can some body please give some idea how to fix this
    if I use java.net.URLEncoder.encode() then I am not getting any error , buit file is not opening in the browser( external window)
    below is the error stack I am getting.  
    com.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=File://mww/Documents/Attachments/2008/10/56254/{FD803B0D-157F-47F9-A5A8-C687E1DC6B96}_break.JPG
    at com.sap.tc.webdynpro.serverimpl.core.url.AbstractURLGenerator.checkURL(AbstractURLGenerator.java:699)
    at com.sap.tc.webdynpro.services.sal.url.core.URLGeneratorInternal.checkURL(URLGeneratorInternal.java:390)
    at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createNonModalExternalWindow(ClientComponent.java:1037)
    at com.gis.dcww.findsrch.AttachmentView.onActionOpen_Attachement(AttachmentView.java:179)
    at com.gis.dcww.findsrch.wdp.InternalAttachmentView.wdInvokeEventHandler(InternalAttachmentView.java:203)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
    at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
    at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
    at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
    at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
    at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    thanks
    PK

    Hi Armin, Josue
    Thanks for the reply
    Please note I am able to open an external window( browser ) thru my code with "File" protocol.
    I have no issue opening an external window or using File protocol.
    I am able to open an image/doc with a normal URL as follows
    File://mww/documents/image.jpg
    or
    File://mww/document/temp.csv
    But My URL has some system( thru Other applications ) generated charaters in it , I need get the path from DB( which I have done ) and pass this URL to the ExternalNonModalWindow as paramter.
    MY code is opening successfully the external  window for any URL .
    but for URL which has these character { }  is throwing the invalid URL error 
    for the below URL, I am getting the error
    File://mww/Documents/Attachments/2008/10/56254/{FD803B0D-157F-47F9-A5A8-C687E1DC6B96}_break.JPG
    thanks
    PK
    because of the flower bracket it is throwing the error.
    thansk
    PK

  • How to force weblinks to open in a new Safari window

    Hi,
    This morning, I just upgraded Lion from 10.7.3 to 10.7.4, and I upgraded Safari to Version 5.1.7 (7534.57.2).  Since then, when I click on web links in messages in Mail, they seem to open in a tab in an existing Safari window, where they used to open in a new Safari window, which is what I want.  It also appears that these pages load, they are loading in an existing tab and flushing the history, so tabbed pages end up disappearing with no way to determine exactly what they once were.  My Safari tab preferences are "Open pages in tabs instead of windows:  Never", and the checkboxes below this option are both unchecked.  Any help would be much appreciated, as I usually have multiple Safari windows open, each with 2-4 tabs active, and this current behaviour is quite destructive.
    Thanks,
    Ken

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this exercise is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login. Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, you can’t boot in safe mode.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • How to open pdf document in other window by using java script

    Hello All,
    I am working in R12 Application.
    My jdeveloper version is 10.1.3.3.0.3
    I want to open pdf document in other window on clicking the button
    for that i have written following code in process request of the controller:
    pageContext.putJavaScriptFunction("doFilterSwitch", "function doFilterSwitch(){window.open('/t01/oracle/TEST/inst/apps/TEST_appsdev2/logs/appl/conc/out/545042.pdf'); }");
    OAButtonBean moHelp =(OAButtonBean)webBean.findChildRecursive("Download");
    moHelp.setOnClick("doFilterSwitch()");
    but when i hit download button it gives me the below error:
    The webpage cannot be found
    HTTP 404
    Most likely causes:
    There might be a typing error in the address.
    If you clicked on a link, it may be out of date.
    What you can try:
    Retype the address.
    Go back to the previous page.
    Go to and look for the information you want.
    More information
    please help me out
    Regards,
    sheetal

    Instead of giving the link in Process form request, give the link directly in Destination URI property of the button and in target property write _blank.
    Note : use normal button not submit button

  • Tree Structure - Is it possible to Open a Pop up/external window on select

    Is it possible to Open a Pop up/external window on select of any Leafe node or a parent node?
    My requirement is to create a webdynpro screen which depicts the transaction :
    ooqa in sap R/3.
    Is it possible to do that in tree structure?
    Thanks & Regards,
    Sirisha.RS

    Hi Ayyaparaj,
    Thanks for ur reply.
    but i cant use a table here. I just need a tree structure..
    I guess Its posible by writing a code for a external window open in the onselect method itself.
    Thanks & regards,
    Sirisha.Rs

  • Problem: Ctrl+Shift+P does not work to toggle private browsing. It opens up a new private window, but no longer will toggle back to regular mode.

    Opening private browsing w/ Ctrl+Shift+P works fine. But when I try to toggle back, it just opens up a new private window.
    Is this a bug? Or an intentional change in the newest version?
    Those of us who depend on keyboard shortcuts are often overlooked in software revisions. Users like me want to keep working without leaving the keyboard to grab a mouse...
    Any suggestions or advice?
    Thanks.

    thanks. hard to lose an old keystroke habit....

  • Can I have links open in a new browser window?

    Is it possible to have links to pages outside of my website to open in a new browser window?
    I've created a podcast for my students to listen to.
    I've also created a kind of fill-in-the-blank activity to go along with that podcast, but that activity requires a different window.
    I want my students to listen to the podcast and do the fill-in at the same time.
    So, I'd like for the students to open the link to the fill-in and then click on the podcast on the original page.
    Advice?

    changing podcast links is a bit difficult - but here is a general link of how to open windows in a new window:
    http://www.rowan-cottage.co.uk/Site/Target_Blank.html
    max

Maybe you are looking for

  • How do you unlock an External drive?

    I've used this drive on my macbook pro and now want to use it on my new imac. I can open previous saved stuff on it and work on it but not re save what I've done. The icon does not have a locked symbol on it and can access permissions from "get info"

  • How do I set a PDF Export Preset to force a minimum line weight on output?

    How do I set a PDF Export Preset to force a minimum line weight on output?  I'm currently using one that came from a printer that works great - but I can't seem to find the option when creating one myself.  I have some placed Illustrator line art tha

  • SAFARI FULL SCREEN WITHOUT OLD TABS

    Sorry for my english i'm french!! How can I open a new windows of safari in full screen without the old tabs. Because when I open a new windows of safari in full screen I have my old tabs open. Thx and I hope u understand me =) and u can found a solu

  • Does anyone know what Error: 5 mean when trying to open up InDesign CS4

    Does anyone know what Error: 5 mean when trying to open up InDesign CS4?

  • Block Pages in digital publishing

       hello, I wanted to know if it is possible to lock the pages of an application of digital publishing in such a way that the transition from one page to another occurs only with buttons and not through the horizontal scroll. thanks Paolo