SSRS PDF Export. There was an error opening this document. This file is damaged and could not be repaired

Hello,
I just experienced this problem, and was able to successfully mitigate.  I wanted to share my experience and Solution. 
The problem started with the following error after succesfully exporting a PDF Document.  "There was an error opening this document. This file is damaged and could not be repaired."
This is only applicable if you can still export and open SSRS Reports to other formats. Go to the Log files of the SQL Instance. In my particular case I used the Default MSSQL instance:   C:\ Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting
Services\LogFiles  
The Folder will begin with MSRS (SRS is for SQL Reporting Services)
Sort the files by date modified and check for the most recent log file: ex.  SQLDmpr0000.log  The 0000 will be the incremental amount of errors you have experienced in SRS. Check for the following error:
"System.DllNotFoundException: Unable to load DLL 'T2Embed': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
Below is a sample from the log. 
reportrendering!ReportServer_0-1!1b78!02/07/2012-11:56:03:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: , Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException:
An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.DllNotFoundException: Unable to load DLL 'T2Embed': Access
is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at Microsoft.ReportingServices.Rendering.ImageRenderer.FontPackage.TTGetEmbeddingType(Win32DCSafeHandle hdc, UInt32& status)
   at Microsoft.ReportingServices.Rendering.ImageRenderer.FontPackage.CheckEmbeddingRights(Win32DCSafeHandle hdc)
   at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.ProcessFontForFontEmbedding(PDFFont pdfFont, Dictionary`2 embeddedFonts)
   at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.EndReport()
   at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream
createAndRegisterStream)
   at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo,
NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
   --- End of inner exception stack trace ---
   at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo,
NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderFromOdpSnapshot(IRenderingExtension newRenderer, String streamName, ProcessingContext
pc, RenderingContext rc)
   --- End of inner exception stack trace ---;
If you notice the error states that T2Embed.dll access is denied. In my case this due to a hotfix installed by Microsoft: 
 MS11-087: Vulnerability in Windows kernel-mode drivers could allow remote code execution: December 13, 2011
Be advised, in order to fix your problem and render pdf's, a vulnerability shall be created.
 To fix this issue and allow the export to PDF work correctly, you must give the system Read/Execute Permissions, and Built-in\Administrators Full Control. 
Go to Windows\System32 and find the T2Embed.dll Go to Security and modify the permissions as listed above. Do the same to the T2Embed.dll in the SysWow64 folder.
Restart Reporting Services and you will be able to export to PDF. 
Best Wishes! 
Mariano
www.lucontech.com 

I'm not convinced this is the exact cause of the issue.  I will check my log files to see if I find anything like what you described.  However, I get this error when a particular user tries to do a "print preview" from a custom button.  The
code builds a ReportViewer object, sets the ReportPath, etc.
The reason I'm not convinced is because we have a separate reports page that has the report viewer embedded into it.  If the user generates the report that way and exports to PDF, Word, etc...the user can generate the file and be on their way.  As
soon as the user clicks our "Print" button on the page without the ReportViewer embedded, the above mentioned error occurs.  
UPDATE: Perhaps we have a different problem since my issue is from a custom button.  I found the solution
here and confirmed the solution with the customer.  It had to do with the code using Response.Flush() instead of Response.End().
One thing I noticed before I implemented the change: When you would close the PDF, it would ask you to save changes to the PDF.  After implementing Response.End() instead, that prompt went away.  No doubt it has to do with the differences between
how Response.Flush() and Response.End() handle the stream returned.
Anyway, posting in case someone has the same issue.

Similar Messages

  • Acrobat 11 there was an error opening this document. the file is damaged and could not be repaired

    we are receiving an error when opening certain pdfs saying "there was an error opening this document. the file is damaged and could not be repaired"
    i've tried a few things to fix this issue with no luck
    tried on a brand new windows 7 install without any added software like anti-virus software, etc
    tried on my home pc (I forwarded the document from my work pc to my home pc and still receiving the same error)
    don't think it's anything related to the computers, thinking it's more an issue with the pdf. i've tried the basics like deleting temp files from IE, going to %temp% and deleting that out, doing an acrobat repair, trying in reader instead of acrobat, updating users from acrobat 10 to 11, and still receiving the same issue. the odd thing is, some people can open this document and some receive the error. the other thing is i've tried alternative pdf programs with no avail, same errors from those as well
    i work on the helpdesk with one other person  for the company and not sure what else we can try
    don't think this is a pc issue - tried on pcs in the company, home pcs, personal pcs and all get this error
    got to be an issue with either the pdf, or the way its being sent
    i did reach out to OUR e-mail team here (lotus notes admin) and they've ruled out anything as far as an encryption causing the conflict may go, so notes isn't the issue either
    would it be possible it's on the persons end that's sending the file?

    Unfortunately, CR 10.5 is not supported on WIN 2012 Server. See this wiki for more details. In order to work in a supported environment you will have to upgrade to CR 2008 Service pack 7, or SAP Crystal Reports, developer version for Microsoft Visual Studio (2010 / 2012 / 2013).
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • How to deal with "There was an error opening this document, the file is damaged and could not be"

    Hello, everyone:
    I open one pdf document with Adobe Reader 9.3, but it appeared that "There was an error opening this document, the file is damaged and could not be repaired".. and I found that another several pdf document in the same folder that I have not opened for a long time is also "damaged and could not be repaired".
    But in the same folder, other documents of different types are ok, does that mean there is something wrong with my hard drive?
    Has anyone else run into this issue or have any suggestions?
    Thank you very much

    It could be that the directory is damaged. It could be that at one time you had a virus that did damage, it is hard to say. Do you have a good backup?

  • Which version doesn't produce this error: "there was an error opening this document. the file is damanged and could not be repaired"?

    This error message occasionally occurs with Acrobat 5 on XP 2.  However the same files can be opened with Acrobat 6.0.4 on Win98(se2).
         "There was an error opening this document. the file is damanged and could not be repaired."
    I'd like ot upgrade 5 on my XP system, but have read many posts complaining about the same error with newer versions.
    Is there a version that never produces this error on files that aren't actually damaged? And has anyone figured out what produces this error? (The posts I've seen suggest solutions that don't seem to work.)
    Thanks.
    Ellen

    Thanks, Prasanth.
    I've read posts about this problem happening on all versions, and wanted to see if it was least likely to happen in one version.
    I just need the basic function - the ability to read a pdf file.
    Of course, it seems to be a problem only for some, and there's no way of knowing the extent, so I will try an upgrade or two.
    Ellen

  • There was an error opening this document. the file is damaged and could not

    Dear all, I am simpley reading pdf file & producing to browser with this servlet
    ( which i got this from same forum)
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class Isotest2 extends HttpServlet
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException
    //String file = request.getParameter("file");
    String file = new String("d:/xyz.pdf");
    if (file != null)
    File f = new File(file);
    if (f.isDirectory())
    //Do something that identifies the file as a directory...
    } else
    //otherwise, open a stram, and begin the download...
    InputStream input = new FileInputStream(f);
    response.setContentType("application/pdf");
    response.setBufferSize(8192);
    response.setHeader("Content-Disposition","attachment; filename=\"" + f.getName() + "\"");
    OutputStream output = response.getOutputStream();
    int count = -1;
    byte[] buffer = new byte[8192];
    while((count=input.read(buffer))!= -1)
    output.write(buffer, 0, count-1);
    output.close();
    input.close();
    but it is unable to open pdf file giving error
    "There was an error opening this document. the file is damaged and could not be reapired"
    what is the problem? [ PDF  file is not damaged !]
    pls help me out
    thanks

    Probably because you aren't writing the last byte read every time through the while loop.

  • File is damaged and could not be repaired, when emailed the PDF Document

    Hi i have the same problem , that what you have resolved, but it doesn't work for me...
    i.e, when i sent a mail from the below code , mail sent but when open it shows "**There was an error in opening this document. the file is damaged and could not be repaired."**
    can u please suggest to over come this problem.. and i m using IBM Websphere 8.
    please advice ....
    thanks alot in advance...
    here is the code :
    AstLogger logger = AstLogger.getInstance();
    logger.info(this.getClass(),"ReportBuilderUtils.sendMail Start....");
    boolean flag = false;
    try {
    javax.naming.InitialContext ctx = new javax.naming.InitialContext();
    javax.mail.Session session = (javax.mail.Session) ctx.lookup(AstProps.getInstance().getWebCollectLoginMailSession());
    Message msg = new MimeMessage(session);
    InternetAddress addressFrom = new InternetAddress(from);
    logger.info(this.getClass(), "Report Builder Utils - Email From :" + from);
    msg.setFrom(addressFrom);
    String log = "";
    double tempFilesize=0;
    for(String emailId : recipients) {
    InternetAddress addressTo = new InternetAddress(emailId);
    msg.addRecipient(Message.RecipientType.TO, addressTo);
    log += emailId + ",";
    logger.info(this.getClass(), "Report Builder Utils - Email Recipients :" + log);
    // Setting the Subject and Content Type
    msg.setSubject(subject);
    logger.info(this.getClass(), "Report Builder Utils - Email Subject :" + subject);
    msg.setContent(message, "text/plain");
    msg.setHeader("Content-Type", "multipart/mixed");
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setText(message);
    logger.info(this.getClass(), "Report Builder Utils - Email Message :" + message);
    mbp1.setDataHandler(new DataHandler(new HTMLDataSource(message)));
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    // constants to handle the large files
    if(tempFile.exists()){
    tempFilesize = tempFile.length();
    logger.info(this.getClass(), "Report Builder Utils - File Size :" +((tempFilesize/(1024*1024))) +"MB.");
    System.out.println("ATTACHMENT_SIZE ==>" +ATTACHMENT_SIZE);
    if(tempFilesize > ATTACHMENT_SIZE){
    flag = false;
    return flag;
    MimeBodyPart mbp_file = new MimeBodyPart();
    mbp_file.setHeader("Content-Type", "application/pdf");
    mbp_file.setHeader("Content-Transfer-Encoding", "Base64");
    mbp_file.setFileName(fileName);
    mbp_file.setDisposition(Part.ATTACHMENT);
    mbp_file.setDataHandler(new DataHandler(new FileDataSource(tempFile)));
    mp.addBodyPart(mbp_file);
    System.out.println("Mail Successfully sent to :"+recipients);
    msg.saveChanges();
    msg.setContent(mp);
    // even tried by placing here
    // mbp_file.setHeader("Content-Transfer-Encoding", "base64"); base64 is not case-sensitive i hope , i read out on some books
    Transport.send(msg);
    logger.info(this.getClass(), "Report Builder Utils - Email Send successfully...");
    flag = true;
    }catch (Exception e) {
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    e.printStackTrace(pw);
    logger.error(this.getClass(), sw.toString());
    AstLogger.getInstance().info(this.getClass(),"ReportBuilderUtils.sendMailAsAttachment End.");
    return flag;
    Edited by: 992445 on Mar 7, 2013 4:05 AM

    You need to get a new copy of the PDF.

  • Some pdf files wont open error "this file is damaged and could not be repaired"

    just recently this error has occured on a number of email pdf attachments
    "there was an error oping this document. the file is damaged and could not be reapiared"
    I am using Mozilla thunderbird and adobe reader 10.1.2.
    I have forwarded the attachments to other edress's and get the same error
    whn i download the attachment to my pc and check the properties
    the general tab gives the file size etc but the PDF tab is empty except for
    Fast Web View NO and Pdf version 0.0
    i am running winxp professional

    What can you see when you open the file with a text editor?

  • Exporting PDF files from SSRS 2012 - "There was an error opening this document. The file is damaged and could not be repaired"

    Good day
    I have the situation where we are exporting PDF files from reporting services in our website. 
    When dividing the data into sections, the report exports perfectly, but when exporting the entire set and trying to open the file, we get the following error in Adobe Reader:
    "There was an error opening this document.  The file is damaged and could not be repaired"
    We tried to repair the file, no luck.  We tried to use different PDF readers, no luck
    We then checked the file sizes.  When exporting the subsections, each section exports a file of about 2mb. 
    When exporting the entire set, the file is about 1.3mb. 
    Adding all the sections together gives me a rough estimate of 40mb.
    Exporting to TIFF works beautifully and returns a file of 41.5mb. Word and Excel formats also work well, only issue there is the page numbering and formatting.
     The problem we have is the clients are adamant about having it in PDF format.
    Any advice please?

    This was one of the temporary suggestions I gave the client...
    Unfortunately they do not like this as the page numbering and formatting in Word does not appear right.  We are talking about over 1300 pages.  I can't expect them to change the formatting with each export.  Additionally,  the data is
    constantly changing and each client has their own data.  The clients export the reports randomly.  I therefore can't post the reports back onto the server.
    Thanks for the speedy response though

  • When I attempt to open a PDF file I saved from a website, I get the message "There was an error opening this document. The file is damaged and could not be repaired." Is there any way to correct this problem?

    When I attempt to open a PDF file I saved from a website using Safari, I get the message "There was an error opening this document. The file is damaged and could not be repaired." When I save the same PDF file using FireFox it opens up immediately. Is there any way to correct this problem with Safari?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • With OSX10.7.5 and Adobe Reader 11.0.02 when I try to open a PDF downloaded from the web I get 'There was an error opening this document. This file is damaged and could not be repaired. Preview will not open either. Older PDFs OK.

    I am running OS X 10.7.5 and Adobe Reader 11.0.02. In the last few days I have been unable to open PDF's downloaded from the web. Reader gives the error message 'There was an error opening this document. The file is damaged and could not be repaired'. Removing Reader and trying to use Preview to open these files give the error 'Preview cannot open this file. It may be damaged or use a file format that Preview doesn't recognise' (or something like that). Downloading the same files with Reader removed from my Mac Preview opens the files OK.
    I was recently prompted to update Adobe software but did not note exactly what the update was nor when it was done.
    Reader and Preview will both open PDFs I downloaded a week ago. Reader will also open files downloaded on another Mac running OS X 10.0.0 and copied to my Mac. Any ideas?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • Trouble opening pdf's - I have received several pdf's from a friend via e-mail (Thunderbird). Some of them open just fine but others give me the message: "There was an error opening this document. The file is damaged and could not be repaired."

    Trouble opening pdf's - I have received several pdf's from a friend via e-mail (Thunderbird). Some of them open just fine but others give me the message: "There was an error opening this document. The file is damaged and could not be repaired." My friend made sure that the files in question opened without issue on his computer (a PC). Further, I was able to open one of these "damaged" files on my Android phone, but I cannot open them on the Macbook Air. Any help would be greatly appreciated.

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • When I try to open a pdf file I get an error message stating "There was an error opening the document.  The file is damaged and could not be repaired."  Other pdf files open fine.

    When I try to open a pdf file I get an error message stating "There was an error opening the document.  The file is damaged and could not be repaired."  Other pdf files open fine.

    You need to get a new copy of the PDF.

  • My PDFs with form fields get "There was an error opening this document. The file is damaged and could not be repaired." on anothers computer, PC and MAC

    Im creating PDFs through InDesign and using Acrobat Pro 9 to add fields.  I save them to allow ADobe Reader people to use them.  Everything works fine on Pro and Reader on my end with a PC as well as someone elses PC.  But one person using Mac said some forms work and some dont.  Those that dont get the error "There was an error opening this document. The file is damaged and could not be repaired."  Ive resaved them and made sure they work and same problem.  There is nothing overly coplex about the PDFs either, a date field at the most.  They are using Reader 9.1.
    I found out the other day that one person who can open them adds info to them saves them and send over to that other person and cannot open any of them after they have been edited, same error.  He even tried on a PC and still gets it.
    I dont know what to do.  I know it has to be on his end and not mine.  What else can I suggest to him??

    It sounds like they are using an earlier version of Acrobat or Reader, though you said Reader 9.1. If you add some features in AA9 that are new, it appears that earlier versions see the new features as damaged files. At least that is my guess. Try using Reduce File Size or PDF Optimize to save to an earlier version and see if that helps. The other option is that you are getting them messed up in e-mail because many client look at PDF files as ascii and do not encrypt them. In that case force the encryption. You can also send them in ZIP form.

  • Adobe pdf problem; the message comes up:- There was an error opening this document. The file is damaged and could not be repaired.

    Dear all
    I have got  3 mac computers. 2011 13 inch air, 27 inch mac and 2010 pro. latest softwares. all of them have a problem in opening pdf files;esp older files. the error message comes up 'There was an error opening this document. The file is damaged and could not be repaired.'
    I have reinstalled reader, checked software updates etc.
    Any help will be appreciated

    It isn't likely to be a problem with the software. You have two different applications which have no interaction between them, neither of which can open the same group of files on three different systems. It's possible that one application has a problem, but not both or that one system has a problem, but not all three. Typically if there were software corruption, it would not show as a failure to open a specific type of file, but in opening and running the application itself.
    I realise that that doesn't really help you since it doesn't resolve the poblem, but I think you need to start with a known-good pdf, preferably one you can download from an internet source, and see whether that opens. If it does, then it would confirm that the software is working properly.
    For a known-good PDF to download, try one of the manuals from the support site here.

  • There was an error opening this document.  The file is damaged and could not be repaired.

    Good Day all
    When busy doing internet banking on www.absa.co.za and I try to print a confirmation, I get the following error message: "C:\Documents and Settings\%user profile%\Local Settings\Temporary Internet Files\Content.IE5\%folder name%\%file name%.pdf
    Could not open file.
    File not found."
    I've managed to locate the actual file that it's looking for, but when I try and open the file using either Adobe or Foxit Reader, I get the following error message: "There was an error opening this document. The file is damaged and could not be repaired."
    I've un-installed Adobe and installed version 9.1 for this particular user. This happened a while ago and then an un-installation and re-installation of Adobe solved the issue. This time, unfortunately, it didn't. I then un-installed Adobe and tried again, UNSUCCESSFULLY. So I loaded Foxit Reader, also without any success.
    If there's anyone out there who could possibly help, please do so... It's extremely urgent.
    Please find the errors attached as well.
    Regards,
    ME

    I contacted the company and they asked me to try using another browser, which I did... and using FireFox worked
    thanks for the help ʇɐb ɹəuəllıʍ
    cheers!

Maybe you are looking for

  • A website asked I wanted to automatically tell them my geographic location. Firefox popped up a screen with the option. How do I get back to this option?.

    A newspaper website asked if I wanted to tell them my location. Firfox popped up and asked if I wanted to automatically tell sites that ask my geographic location. I clicked and got more information. There was a section that gave instructions to perm

  • What do ICI and IMS stand for?

    On MSI's FTP site there seem to be two kinds of BIOS's, some with IMS in the name, others with ICI in the name. The IMS's seem to be the ones that are publicly available via their website. The ICI's are typically the ones that are suggested to try if

  • Spanish Language Installation in 4.6C

    Dear All, We have installed spanish language in our sap R/3 4.6C system in addition to english and german. We are facing an issue regarding that. We used supplement language as English. So, when we tried to fill the gaps using report RSTLAN_SUPPLEMEN

  • How Long....?

    I spoke to an Apple employee on the phone this morning about re-downloading songs lost to a hard drive crash. She said she would e-mail instructions to me. How long does it usually take to receive the instructions? It's been 20 minutes since I got of

  • User exitr for VA01

    hi all.. In the transaction VA01, i need to use a user exit  to reset the value of Order Reason Code at the time of order entry( when enter is pressed). Which user exit should i use for the same ?