Opening a PDF/Excel/Word Doc/etc file in an iView

Hello everyone,
I'd like to open an Excel or PDF or etc file in an iView.
Ideally i'd just create a URL iview (by the way i'm on EP5 SP6) and then just use that to link to a static file.
However, the issue i'm having is that we need to open the
file that was last created within a directory. So i created the code to detect the most recent file. Now i have the RID of the most recent file but i dont know how to display it. response.write() only takes a String. How do i get the file represented by the RID i have and open it in the iView?
Thanks alot,
Ale

Hi,
Here's the code i'm using that prints 208 to the screen:
IResource ir = ResourceFactory.getInstance().getResource(RID.getRID(theFile), rContext);
                              String ext = theFile.substring(theFile.length() - 4);
                              String contentType = "";
                              if(ext == ".xls")
                                   contentType = "application/vnd.ms-excel";
                              else if(ext == ".doc")
                                   contentType = "application/vnd.ms-word";
                              else if(ext == ".pdf")
                                   contentType = "application/pdf";
                              HttpServletResponse response = request.getServletResponse(true);
                              response.setContentType(contentType);
                              response.setHeader("Content-Disposition", "inline; filename=DownloadReport" + ext);
                              java.io.InputStream is = ir.getContent().getInputStream();
                              java.io.PrintWriter out = response.getWriter();
                              out.println(theFile);
                              out.println(new InputStreamReader(is).read());
                              out.close();
Any idea what is not working correctly?
Thanks a lot,
Alessandro

Similar Messages

  • IE will not open a pdf or word doc

    IE will not open a pdf or word doc
    I’m trying to make a quick cd for a portfolio
    What I’m having trouble with is I have only 2 buttons
    and one opens a pdf and the other opens a word doc. With firefox
    the buttons work with IE they don’t.
    I used set nav bar image in the behaviors to create the
    button, I even tried just linking it using the properties. Also
    tried linking in fireworks.
    I will be putting the file on cd with a autorun
    Thanks for any help

    Enter the text of the IE error message at this link, to see
    if Microsoft has a fix
    http://search.microsoft.com/search.aspx?mkt=en-US&setlang=en-US

  • When I converted a file from PDF to WORD.DOC it opened as Read Only and I'm unable to alter any of the text.  How can I solve this problem?

    When I tried to convert a file from PDF to WORD.DOC it opened as Read Only and I'm unable to alter any of the text.  How do I solve this problem?  I don't know how to change it from Read Only.

    Dear Sara
    Thank you very much for sending the converted file.  Yes, I am able to edit it - that will be very useful to me and I appreciate your help.
    Referring to your previous message when you said you'd converted via Acrobat and not Acrobat.com, I'm converting via Acrobat.com because that's the only option that is shown (how do I convert via Acrobat? - perhaps that would be more successful).  I'm using the Export PDF website, and the OCR is enabled to "Recognize text in English UK".  However, I've just tried converting a different LPA pdf form, this time for Health & Welfare https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/245571/LPA114_He alth_welfare_LPA.pdf and again I have the same problem as before.  I've altered it from "Read only" and thought I'd then be able to enter text, but "Drawing Tools" is shown in the pane and I'm unable to enter anything onto the form - everything appears to be in images.  Also, the lettering on the heading of' page 1 has become jumbled, with the word "Public" overlaying the word "Guardian."  Any suggestions as to what it is I'm doing wrong would be welcome - I don't like to be beaten!
    Regards,
    Judith.

  • How to open pdf or word doc or notpad file in flex

    hai friends,
           how to open pdf or word doc or notpad file in flex. i am doing flexcoldfusion project. now i reterive data(notpad or worddoc or pdf file path) from database using coldfusion.now i want to open that file content .if i reterive notpad file .that will show in notpad. if it is possible. give example.
    regards,
    welcomecanv

    Hi WelcomeCan,
    Try this...
    var urlRequest:URLRequest = new URLRequest();
        urlRequest.url = "http://www.yourdomain.com/notepad.txt";
        //urlRequest.url = "http://www.yourdomain.com/FlexComp.pdf";
        navigateToURL(urlRequest,_blank);
    Thanks,
    Bhasker Chari

  • I have converted PDF to word doc but cant open because I have word 7. Do I need new word

    I have converted PDF to word doc but cant open because I have word 7. Do I need new word

    I don't know what version of Word that is, it may be very old indeed.
    Apparently, the basic compatibility is
    DOC files - Word 97 onwards
    DOCX files - Word 2007 onwards (add on for Word 2003 available)

  • Cannot open Office 2013 Excel, Word, PPT Files on Network Share

    Cannot open Office 2013 Excel, Word, PPT Files on Network Share
    I am having a problem opening any Office 2013 file when it is located on a network drive. I immediately get the error:  
    "Microsoft Excel cannot open or save any more documents because there is not enough available memory or disk space.
    . To make more memory available, close workbooks or programs you no longer need.
    . To free disk space, delete files you no longer need from the disk you are saving to."
    It only occurs when I try to access the file when it is stored on a network share. I cannot open any word, excel or PPT files located on my file shares.
    I am on Windows 8 (pro), part of a local domain based on Server 2003, and have administrator rights to the domain and the file share where the Excel file resides (and Word files -same problem). If I copy the file locally, I can either open
    it directly, or right-click, go to Properties and 'un-block' the file and then open it. But it is impractical to keep doing this, as I edit different files from the directory tree all day.
    I have bing'd and google'd this extensively, and the only answers I come up with do not work, such as going into the DCOM config system and changing the user from interactive to launching user, or vice versa, or even using a specific user - mine
    with the password. Since the product is so young there aren't a lot of posts on this, and nothing has improved the situation.
    Can you add any insight to this? I really want to use Office 2013, but this is such an obstacle I'm going to have to downgrade if this problem cannot be resolved. Thank you very much for any help you can offer.
    Evan

    Dear Evan,
    If DCOM config solution did not work, I'd suggest narrow down the problem by trying to access another network share on another server, try to open an Office file there, do we still have the error? It could help us determine if the issue is on the client
    machine or the server side.
    Best regards,
    Daisy Cao
    Forum Support
    Please take a moment to "Mark As Answer" if they help.

  • Using Access to store OLE objects like Excel , Word docs and retrieve them

    Hi folks,
    I need a solution for this problem guys.
    The logic is like this : A portable exe file and a database. Database contains files stored ( embedded ) in it like Excel , Word , notepad etc.
    On running the exe file and giving necessary prompts or combo entries, it should display all files related to the selection and On clicking the link the document should open itself.
    Why I use Access : Most of the PC contains MS Office. Otherwise I have to use a lightweight protable database.
    Also it should be able to store files into it. As far as I know , Access can store excel and images etc. Is there any other protable db capable of storing excel and word docs.
    After storing how do I retrieve the file. I have read about displaying images. What about excel files...

    Portable as in the sense every one can cary the file and the MS access database and can access data whenever they want . They can carry it in their flash drive / USB drive. Only the data base would get updated with the data. So in effect , One could access the updated documents by the means of a query.
    This should work in Windows environment

  • Save as pdf or word doc with password

    I can't seem to create a pdf or a word .doc from my (applework) document which has a password.
    That is I want the pdf or word doc to have a password - the same one hopefully as my original but I can't find how to do it!
    Any tips please?
    Gordon

    You may be able to set a password for the file at the system level.
    Open the Disk Utility in the /Applications/Utilities/ folder and create an encrypted disk image without putting the password in your keychain. Move the file to the mounted image, and then throw away the copy directly on the hard disk followed by choosing Secure Empty Trash in the Finder.
    (22615)

  • Viewing/Syncing PDF and Word Docs?

    I read before I bought my iPhone that it would have support for PDF and Word Docs. How do I view and store these docs? Since I can sync music and movie files, can I sync documents too?

    So I can store and view a 700MB movie, but not and 8kb text file? Are you kidding? I've tried emailing myself a PDF, but I can only view it in Mail's tiny vertical window. So far I have been unable to open ANY PDF on the Web. I get an error "Safari can not download this type of file."
    There is no way to sync/view a PDF like I sync/view Photos? Why include PDF support then implement it in the narrowest way imaginable? This phone just became useless in any type of business environment. It is unbelievable that on an 8 gig Phone I can't even store a PDF, Word, or TXT file. Looks like this phone is a $600 toy, not a device for a serious user.

  • Cannot open Videos, PDF-Viewer and Doc.viewer

    When It try to open Videos, PDF-Viewer or Doc.viewer it loads the program but never ends. Always there is only the moving waiting symbol but the loading process never ends. Also, I cannot watch Quicktime movies anymore in the Pixi-Browser which worked before, too.
    I am not really sure, because I have my Pixi just for some days: I guess it worked before and after the last update to webos 1.4.5 it doesn't work anymore. Can there be a relation to the update?
    Has anybody else that problem? Who can help? Thanx for suggestions!!
    Post relates to: Pixi Plus p121ueu (02)

    Thanks Alan,
    for some reasons it works now. I even couldn't install any programs anymore. How it worked again: Before I wanted to restart the phone, I pluged it into my PC (USB-Drive) and backed up my Motion Classic Backups just to make sure I don't lose them. Then, I saw that I had 2 Excel-Sheets and 1 Word-Dokument in the main folder of my pixi. I moved them into a new folder.
    After disconnecting the pixi from my PC it restarted itself and for some reason, now, it installed all programs I tried to install before (and didn't worked). Now, it all works. I can start PDF-Viewer, Doc.viewer and Videos and see all documents. Puhh, I am glad.
    I don't know, why the malfunction happened. My Pixi crashes from time to time because of my Motion Classic. I am very unhappy about the instability of Classic. But that is maybe how some things changed in webOS.
    Anyway, thank you for the webOs Doctor-Link!
    Nick

  • How i can insert or save ( PDF, EXCEL, WORD, JPEG ) in IMAGE ITEM.

    Dear All,
    plz advise how i can save PDF, EXCEL, WORD, JPEG files in IMAGE FILE.
    Thanks in advance
    ASIM.

    Start by creating an Item type of OLE container. Set the following properties:
    - OLE Tenant Types: Embedded
    - Database Item: Yes
    Make that item the last item in the block.
    Create a push button such as 'Insert Document' with similar code:
    DECLARE
      vcFile VARCHAR2(1024);
    BEGIN 
      vcFile := win_api_dialog.Open_File('Select Document File to Insert',NULL,'MS-Word files (*.doc)|*.doc|'||
         'PDF files (*.pdf)|*.pdf|Excel Files (*.xls)|*.xls|Outlook message files (*.msg)|*.msg|All files (*.*)|*.*|',
         TRUE,win_api.OFN_FLAG_DEFAULT,TRUE);
      go_block('<block name>');
      last_record;
      Create_Record;
      initialize_container('<oleitemname>',vcFile);
    EXCEPTION
      WHEN NO_DATA_FOUND Then
         Null;
    END;

  • Can I convert a pdf to word doc with adobe send?

    can i convert a pdf to word doc with adobe send--if so, how?

    Adobe Send is the latest rebranding of Adobe Sendnow. It's a sender for big files, not a converter. Send Large Files Easily - Select, Send, & Confirm & Track| Adobe Send

  • I am trying to convert a PDF to Word doc-- it worked previously but now it won't-?

    Trying to convert PDF to Word doc--- was able to do it  before but now nothing shows up when I click on the downloaded file

    Hi asjoseph,
    It sounds like you're reporting two different problems--is that correct? One, that you're unable to convert using ExportPDF, and another that you're trying to open or convert PDF? Is that correct?
    For the first issue, make sure that you're signed in to the ExportPDF service. You can log in directly at cloud.acrobat.com/exportpdf.
    For the second part of your question, please tell me a bit more about where that error is occurring, and what steps you're taking before the error appears.
    I look forward to hearing back from you.
    Best,
    Sara

  • Pdfs to word docs

    I have an adobe account but a new laptop and cannot convert pdfs to word docs, does anyone know what I should do?

    Hi Amanda,
    I don't find record of an Adobe ExportPDF subscription under the email address that you use here in the forums. Do you have a confirmation email from Adobe? You would need either ExportPDF or Acrobat to convert PDF files to Word format.
    Best,
    Sara

  • WORD doc x files show lettering changed from black to white with black background, colors have black background

    WORD doc x files received open with black lettering changed to white with black backgrounds. Color images have black backgrounds. There is no issue for non MAC users. How can I open the document as sent? Thank you.

    Pages (any version) is not a word clone, and may not digest Word documents as accurately as their native Microsoft application. Pages v5 is also far from feature/functionality complete, and that only compounds this issue.
    Suggest you download/install the free LibreOffice and open the Word documents with it. Do the artifacts persist in LibreOffice?

Maybe you are looking for

  • Adobe reader does not open usage right enabled files in Ubntu 8.0.4

    I have a series of pdf files with the usage right enabled in adobe acrobat. When I try to open them in linux Ubuntu 8.0.4 the adobe windows flashes for a second and the disappears. I tried to run the command in a terminal but it doesn't give me any e

  • How to open RAW files using elements 10 with a pc using windows xp and nikon D3300

    i have an old pc running on windows xp to which i downloaded elements 10. i recently bought a nikon d3300 and am shooting RAW. is there a way to open the RAW files using elements 10?

  • Where to find Win XP drivers for Portege R400

    I need help. Cannot work on Vista - so want to downgrade to WXP. But there are no drivers on official Toshiba site for this OS only for Vista. I cannot find info about compatibility of Toshiba software (that works on Vista) with XP. Can you help me a

  • TUTORIAL UPDATE : STREAMCLIP SETTING (Somewhat more precise)

    For the recommended fast (vs. H264) MPEG-4 recording here are two tips: 1. Leave the quality slider at 100% 2. Go to the Limit Bitrate to box set at 256 KB/sec ( NOT MB/sec) which is just a hair under the 2.5 mbps limit. Then you get as close to the

  • Callout

    Hi, Is Callout used for something like bypassing translation and handling wire data with a Java program? Or can Callout process wire data before and after the translation? What I am thinking about is for Callout to process wire data as some preparati