Error opening PDF using webdynpro

Hello All,
I created a webdynpro application that opens a pdf document using the code described in the following link.
Open PDF in New External Window
I am getting the following error:
"There was an error opening this document. The file is damaged and could not be repaired"
But I am able to open the same file using another ASP application.
Am I missing anything?
Thanks in advance.

Nikhil and Vinod,
Thanks for your response. I used this code but it is not working. I am still getting the same error.
In my application, I am not reading the pdf from a file. Instead, it is stored in the database as a blob. I am reading the data using the following code:
Blob pdfBlob = resultSet.getBlob(COLUMNNAME)
byte[] pdf = new byte[1024]
pdf = pdfBlob.getBytes(1,(int)blob.length());
I am storing this value in a context and then displaying it as a pdf. I am using the following code to get bytes
byte[] pdfBytes = wdContext.currentElement().getBLOB(); (BLOB - name of the context attribute where bytes are stored)
and using the following code to open the pdf document (as suggested)
IWDResource pdfResource = WDResourceFactory.createResource(pdfBytes,"test.pdf",WDWebResourceType.PDF);
*                    wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getUrl(0),"test.pdf").show();*
Am I missing anything here?
How can I force the pdf document to open in a browser window instead of Adobe?
Thanks in advance.

Similar Messages

  • Hi, i'm using 10.6.8 and cant open pdf using safari  Ive tried deleting the adobe plugin in the library option..

    hi, i'm using 10.6.8 and cant open pdf using safari on "my vodafone" web site. when i click on the pdf icon nothing happens?? Ive tried deleting the adobe plugin in the library option...but no luck...driving me crazy! cause it opens in my 8yr old desktop
    please help

    Go to /Library/Internet Plug-Ins.
    If you see the PDF Browser Plug-in, move it to the Trash.

  • Error opening PDF file, using Windows Vista

    When I first purchased my new pc, regrettably, I was given Windows Vista. There have been a lot of problems. Of late, Adobe Reader gives me an error message when I try to open a downloaded file. I uninstalled and reinstalled Adobe Reader but with no success. Could this be a Vista security issue? I can download and read the file on my work computer which used Windows XP. Also, this problem getting an error message opening and reading a file just recently occurred. I haven't made any changes to my system except automatic program updates. Can you help me?

    I stumbled on a solution: Download the PDF file and instead of saying yes to open the file (because you know you'll get the error message), simply go to where you saved the file (i.e. AOL downloads) and open it there. I have no idea why I suddenly cannot open PDF files but at least I found a way to still get my information. Hope this helps.

  • Error opening PDF downloaded from Interactive Report

    hi -- I'm getting an error opening a PDF file downloaded from an interactive report.
    I've seen on the forum that this could be related to the size of the file, but I've tried
    this out on 10-row results (1k files) and it's still an issue.
    I save the file to my file system. If I try to open it in Adobe Reader, I get:
    File does not begin with '%PDF-'
    and
    Adobe Reader could not open <filename>.pdf because it is either not a supported
    file type or because the file has been damaged (for example, it was sent as an email
    attachment and wasn't correctly decoded).
    If I try to open in Internet Explorer, I get:
    File does not begin with '%PDF-'
    Other users are having the same problem. Download to csv and open in Excel works fine.
    Do I need to have special print attributes for this? I didn't think so... I'm just using the defaults
    (response header = report settings, content disposition = attachment).
    Ideas?
    Thanks,
    Carol

    Hi,
    I'm having the same problem that was described above, and my site does have BI Publisher installed, and it does successfully produce readable pdfs for many reports.
    But there are other reports, even reports produced using the Apex Wizard and all defaults, that just keep producing the same Adobe Reader error reported above, ie
    "Adobe Reader could not open <filename>.pdf because it is either not a supported
    file type or because the file has been damaged (for example, it was sent as an email
    attachment and wasn't correctly decoded)."
    Any suggestions?
    Cheers,
    Peter

  • Issue when opening pdf using Jasper Report in WLS 9.2

    hi
              I am new to jasper reports and I am using them in Java Page Flow in bea workshop 9.2 Jasper Report 2.0.4
              Created .jasper using iReport
              In one of my action methods
              ServletOutputStream servletOutputStream = getResponse().getOutputStream();
              InputStream reportStream = getServlet().getServletConfig().getServletContext().getResourceAsStream("/classic.jasper");
              JasperRunManager.runReportToPdfStream(reportStream, servletOutputStream, new HashMap() ,connection);
              getResponse().setContentType("application/pdf");
              servletOutputStream.flush();
              servletOutputStream.close();
              connection.close();
              When I invoke this action method from another page on click of submit , the pdf file opens fine for the first time wiht all the data in the pdf ( first submit) , and then I closed the pdf and if I click on submit again, it fails to open the pdf with the error message ,
              There was an error opening this document . This file cannot be found.
              However if I keep any pdf / adobe open it is able to open the pdf for mulitple request (submits )
              if I close the pdf it is able to generate the pdf only for the first time and not the second time.
              Please help me resolve the issue, its urgent.
              thanx in advance
              Madhusudan
              HP

    Hi, I am having the same problem as your user when I try to open a pdf form in acrobat. I also have had a similar problem, still unresolved, described here: http://forums.adobe.com/message/5146964.
    I can't find any solutions. I even tried uninstalling Acrobat X pro and instead gong back to installing Acrobat 9. Same problems persist. Don't know what to do.

  • Help required: Cannot open pdf using Jasper Report in Weblogic workshop 9.2

    This message was accepted by the [email protected] mailing list. Hi ,
    I am new to jasper reports and I am using them in Java Page Flow in bea workshop 9.2
    In one of my action methods
    ServletOutputStream servletOutputStream = getResponse().getOutputStream();
    InputStream reportStream = getServlet().getServletConfig().getServletContext().getResourceAsStream("/classic.jasper");
    JasperRunManager.runReportToPdfStream(reportStream, servletOutputStream, new HashMap() ,connection);
    getResponse().setContentType("application/pdf");
    servletOutputStream.flush();
    servletOutputStream.close();
    connection.close();
    When I invoke this action method from another page on click of submit , the pdf file opens fine for the first time( first submit) , and then if I click on submit again, it fails to open the pdf with the error message ,
    There was an error opening this document . This file cannot be found.
    Please help me resolve the issue, its urgent.
    Thanx in advance

    Thanks for the reply David. The problem we're having is that when you are in Workshop, there is the option, under the "File" menu to "Refresh" (F5) You sometimes need to do this to refresh your workspace. I'm sorry, I'm not a developer, so I don't know the details behind what that actually does, other than it "refreshes the workspace" so we can pick up the changes made and checked into subversion.
    Without performing this step, you don't always build from the latest and greatest code.
    The problem we're facing is that it seems that you need to be in Workshop to perform this step. There is a scripted way to do the refresh, but it requires you to open Workshop and run the script. What we're trying to accomplish is a truly scripted solution. All the other steps in the build process can be performed without opening Workshop, but because we can't figure out a way to do this one piece, we cannot have an automated build process.
    - Brian

  • Error opening pdf file, but then it still opens

    I am having trouble when I open a pdf.I am using the code below to open a pdf.
    on mouseUp me
      acro = bafindapp("pdf")
      if acro = empty then
        acrofile = me.pPDF
        alert "This program was unable to find a suitable program on your system to open a PDF document. It will open www.adobe.com, where you can download a free viewer"
        goToNetPage "http://www.adobe.com"
    else
        open the moviePath & "Resource\" & me.pPDF with acro
      end if
    end
    When this is on a button, adobe reader will open, but gives an error saying "There was an error opening this document. This file cannot be found."
    When I hit the ok button on the error notice, the pdf opens.
    Any ideas why I am getting this message even though the pdf opens after dismissing the message would be appreciated.

    The reason I assumed, or asked, whether it was Windows-only is because of your use of the backslash character as the folder delimiter. To make the script cross-platform try the following:
    on mouseUp me
      acro = baFindApp("pdf")
      if ( acro = EMPTY ) then
        alert "This program was unable to find a suitable program on your system to open a PDF document. It will open www.adobe.com, where you can download a free viewer"
        goToNetPage "http://www.adobe.com"
      else
        mPath = _movie.path
        tFile = mPath & "Resource" & mPath.char[length(mPath)] & me.pPDF
        if baFileExists(tFile) then
          OK = baOpenFile(tFile, "normal")
          if ( OK < 32 ) then
            -- see docs for numbers and their meaning
            alert "Error opening file:" && OK
          end if
        else
          alert "File not found:" &RETURN& tFile
        end if
      end if
    end

  • Error opening PDF files on the network

    I have documents in PDF format on my internal network, but when I open them directly from the network using the Adobe Reader, I get the following message:
    "There was an error opening this document. The network path was not found". But this occurs in only a few users, and possibly users who did not have this error, they have. We found that uninstalling and reinstalling the software solves the problem, but then it returns. Is there any explanation?

    Adobe Reader 11.0.09;
    Microsoft Windows 7 Professional;
    I'm accessing the file from a local network drive. The file is located in one of our servers.

  • Error opening PDF files from search results webpart on anonymous SharePoint 2013SP1 site with IE

    Clicking search results, in the strict sense pdf files, using IE on an anonymous SharePint 2013SP1 site, I received the error: There was an error opening this document. The filename, directory name, or volume label syntax is incorrect.
    I would like to solve this problem on the server side.
    Starting position:
    SharePoint 2013 SP1
    Web Application:
    based on template 'Publishing Portal'
    Anonymous Access enabled
    Claims based authentication: Integrated Windows Authentication NTLM
    Client Integration disabled
    Site Collection:
    Anonymous Access enabled for 'Entire Web site' => group 'Anonymous Users' was created
    added permission to open items: $Web.AnonymousPermMask64 = "ViewListItems, ViewVersions, ViewFormPages, Open, ViewPages, UseClientIntegration, OpenItems"
    Client side solutions:
    c1) Open Link with “Open in new tab” or “Open in new window” => OK
    c2) Disable IE Add-on “Adobe Acrobat Sharepoint OpenDocuments Component” => OK
    c3) Set bDisableSharePointFeatures to 1 in regetit => OK
    Server side solutions:
    S1) Turn off Client Integration => didn't work, still same error
    S2) Modify DOCICON.XML => didn't work, still same error
    I gave these two options a chance:
    first: <Mapping Key="pdf" Value="icpdf.png" OpenControl="SharePoint.OpenDocuments"/>
    then: <Mapping Key="pdf" Value="icpdf.png" OpenControl="AdobeAcrobat.OpenDocuments"/>
    I modified DOCICON.XML on both hives 14 and 15.
    Remarks:
    - After changingparameters I allways did an IISreset.
    - As far as I understood I can only change bDisableSharePointFeatures on Client Side.
    Any help, suggestion, idea wellcome!
    Thanks!

    Hi folks, here's the reason for my problem. I used the oob search result web part. The result items (PDF items) are rendered by the template Item_PDF.html/Item_PDF.js. This template holds a code snippet that assigns a certain OpenControl to the PDF item - that's hard coded. So, no matter what you configure in DOCICON.XML, the PDF item will be opened with the control "PdfFile.OpenDocuments". Solution is e.g. just to leave the OpenControl blank.   
    template:
    /_catalogs/masterpage/Display Templates/Search/Item_PDF.html
    /_catalogs/masterpage/Display Templates/Search/Item_PDF.js
    code before:
    ctx.CurrentItem.csr_OpenControl = "PdfFile.OpenDocuments";
    code after:
    ctx.CurrentItem.csr_OpenControl = "";
    Enjoy
    Harry

  • Error opening PDF files on anonymous SharePoint 2013SP1 site with IE

    Clicking search results, in the strict sense pdf files, using IE on an anonymous SharePint 2013SP1 site, I received the error:
    There was an error opening this document. The filename, directory name, or volume label syntax is incorrect.
    I would like to solve this problem on the server side.
    Starting position:
    - SharePoint 2013 SP1
    - Web Application:
      - based on template 'Publishing Portal'
      - Anonymous Access enabled
      - Claims based authentication: Integrated Windows Authentication NTLM
      - Client Integration disabled
    - Site Collection:
      - Anonymous Access enabled for 'Entire Web site' => group 'Anonymous Users' was created
      - added permission to open items: $Web.AnonymousPermMask64 = "ViewListItems, ViewVersions, ViewFormPages, Open, ViewPages, UseClientIntegration, OpenItems"
      - SC-Feature 'Limited-access user permission lockdown mode' disabled
    Client side solutions:
    c1) Open Link with “Open in new tab” or “Open in new window” => OK
    c2) Disable IE Add-on “Adobe Acrobat Sharepoint OpenDocuments Component” => OK
    c3) Set bDisableSharePointFeatures to 1 in regetit => OK
    Server side solutions:
    S1) Turn off Client Integration => didn't work, still same error
    S2) Modify DOCICON.XML => didn't work, still same error
    I gave these two options a chance:
    first: <Mapping Key="pdf" Value="icpdf.png" OpenControl="SharePoint.OpenDocuments"/>
    then: <Mapping Key="pdf" Value="icpdf.png" OpenControl="AdobeAcrobat.OpenDocuments"/>
    I modified DOCICON.XML on both hives 14 and 15.
    Remarks:
    - After changingparameters I allways did an IISreset.
    - As far as I understood I can only change bDisableSharePointFeatures on Client Side.
    Any help, suggestion, idea wellcome!
    Thanks!

    Hi Harry,
    From your description, I understand you encountered the issue when open PDF documents from search result page.
    Here is a similar thread, please try the piece of code in the page layout for the search results page from Mitch B_83:
    https://social.technet.microsoft.com/Forums/appvirtualization/en-US/545efcc6-b748-4df8-aee0-7f57f778ad1e/sharepoint-2010-opening-pdfs-in-search-results-the-filename-directory-name-or-volume-label?forum=sharepointgeneralprevious
    You could refer to this for search result page layout: Site settings > Web Designer Galleries > Master pages and page layouts > SearchResults.apsx .
    Regards,
    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] .
    Rebecca Tu
    TechNet Community Support

  • Error opening pdf and file can't be found,why

    I received an attachment in my BT emails and opened it,then printed it.When I tried to find it so I could copy it to my Outlook emails it had disappeared. Adobe said there had been an error opening it and the file could not be found.What happened and why?
    Hacien

    I described what had happened when I tried to view a pdf, and said that when I found the pdf and tried to open it again, all I had was a message telling me there had been “an error” and as a result the file could not be found. I don’t know if it was hidden or deleted and asked “why did it happen”
    If Adobe does not give me any more information than that, how am I supposed to give any more information?
    It was the first time I had used the Adobe reader, and I was not expecting someone to be so terse in their reply to my query.  As the song says, “Everybody’s  got to learn some-time.” It would be easier if the ones who DO know could remember the time when they didn’t know.
    To avoid further embarrassment, I will withdraw and not attempt to use your forum again.

  • Error opening PDF in 9.1.0 ("Insufficient Data for image") and 7.0.9

    I generate PDF documents in code (basically converts TIFF images to PDF, using FOP).
    Few of the PDFs can not be viewed on Adobe Reader 9.1.0, and 7.0.9. But, these open fine on 8.0 version.
    With 9.1.0 version I get error as "Insufficient Data for image"
    With 7.0.9  the error is "A drawing error occured"
    8.0 works fine and opens the PDF.
    Is there any issue with 9.1.0 for opening PDFs, I got this version installed recently on my system.
    Appreciate an early help/views on this issue.
    Thanks,
    Umakant

    Try this - from adobe support!
    It worked for me and (as it seems) solved a one year long anoying issue.
    1. Exit Acrobat.
    2. Choose Start > Run, and type: %APPDATA%\Adobe\Acrobat\ into the Open text box. Click OK.
    3. Right-click either the 6.0 or 7.0 folder, and choose Delete.
    I deleted both folders.
    Dont worry these two preferences folders will automatically be renewed by acrobat!

  • Error opening pdf's from PC stored on Mac

    I have been experiencing an error when attempting to open pdf's stored in the public folder on our Mac.
    The message reads:
    "There was an error opening this document. The file is already open or in use by another application."
    It doesn't matter which PC we use to access the pdf's from and happens regardless of which version of Acrobat is being used, the same error occurs.
    The public folder on the Mac has no restrictions.
    Mac 3.2 GHz Quad-Core Intel
    OS 10.9.4
    Adobe Creative Suite 2014
    *Also discovered none of the InDesign, Photoshop or Illustrator files can opened from PC's can be opened while they are stored on the Mac either.
    Thanks,
    Chuck

    Thanks for responding. We do not work using a Windows domain.
    I can open .txt and Microsoft Publisher files, but I get errors on nearly everything else including any Adobe product files and Word files.
    We used to keep files both the PC and Mac had to access on an external network drive, but exporting pdf's from the Mac (as well as opening and saving) took too long. So we moved everything to the Mac. If I have to work on a file I have to drag it to the PC desktop. We can't save directly to the Mac either. Files have to be copied onto the Mac.

  • Error Opening PDF from IE

    When I click on a PDF link in a website in Internet Explorer 6, I receive the following error: "There was an error opening this document. This file cannot be found." I can choose to save the file to disk and then it opens normally from there. All our computers here should be configured the same and this works properly on another computer.
    This originally occurred using Adobe Reader 8.0.0, so I downloaded and installed 8.1.2 and it still is doing the same thing.
    I tried right clicking the link to open in a new window but I am receiving the same message either way.
    Any help would be appreciated.
    Matthew K.

    Check the following registry key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Software\Adobe\Acrobat\Exe
    Here check the default value. On an english machine, it has to be set to:
    "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
    If you installed Adobe reader to a different directory, enter the path where "AcroRd32.exe" is to be found.

  • Error opening PDF

    Hi all,
        I'm having problems opening PDF files. I'm using FM CONVERT_OTFSPOOLJOB_2_PDF to generate the file into the server.
    Then I'm using class/method VIEWER->VIEW_DOCUMENT_FROM_TABLE to open it. The problem is that some files are opened and others don't.
         It appears an error form Adobe Reader 'The file is damaged and can't be repaired ' .All the files are generated in the same way. Any clue what can be?
    Thanks

    Yes, they are all the same. I'm using FM 'gv_func_mod_name' to set printer definitions. All outputs have the same.
    When I open PDF files directly from the server, there are no errors. It only happens when I use the report.

Maybe you are looking for

  • How to delete UWL expired Item.

    Hi, One of our user have this expired item(leave request) which he rejected but now the thing is that despite rejecting the leave request it is still present in his UWL. And when he clicks on the UWL item the detail screen that pops up shows blank ta

  • Flash Builder and Flex4 SDK 9731+ issue

    Hello everyone. I've been working with Flash Builder Beta and latest Flex4 SDK nightly builds for some time now and did not have any major obsticles. That was until I downloaded 9731 build. Flash Builder compiled my project without any problem, howev

  • Installing Sol 8 on Proliant 800

    I'm having trouble installing Solaris 8 (01/01) on a Compaq Proliant 800 (P02). The install fails with "no disks found" after loading the kernel. There are no SCSI devices listed in /devices and this has been tried with the cpqncr driver included wit

  • IMac 8,1 memory options

    Deciding on memory upgrade options.  Currently 2 gb on early 2008 iMac 3.06ghz 24 inch.  Crucial 2+2gb is approx 60 bucks.  Is it worth the 135 bucks to go with OWC 2+4.  I plan on upgrading OS to as current as possible.  The mac is mostly for person

  • Is there a min PC Windows requirement for ITunes Match?

    Apart from having the latest version of iTunes downloaded on a PC is there a minimum WIndows software requirement? I'm planning on importing Audio CDs onto my iTunes account using my office PC and then setting up iTunes Match to get the Library to al