File is damaged could not be repaired!

File is damaged could not be repaired!

Forum member · Jan 18, 2007
I am using your example code to test generation of a pdf, as since upgrading with new build and installing Adobe acrobat 8 my code doesnt work! I get the following dialog box error: File damaged could not be repaired Code I am using: 'Create a MyDocument and set it's properties Dim MyDocument As ceTe.DynamicPDF.Document = New ceTe.DynamicPDF.Document MyDocument.Creator = "HelloWorld.aspx" MyDocument.Author = "Your Name" MyDocument.Title = "Hello World" 'Create a MyPage to add to the MyDocument Dim MyPage As ceTe.DynamicPDF.Page = New ceTe.DynamicPDF.Page(PageSize.Letter, PageOrientation.Portrait, 54.0F) 'Uncomment the line below to add a layout grid to the MyPage 'MyPage.Elements.Add(New LayoutGrid()) 'Create a label to add to the MyPage Dim Text As String = "Hello ASPX VB.NET World..." & vbCrLf & "From DynamicPDF™ Generator for .NET" & vbCrLf & "DynamicPDF.com" Dim MyLabel As Label = New Label(Text, 0, 0, 504, 100, Font.Helvetica, 18, TextAlign.Center) 'Add label to MyPage MyPage.Elements.Add(MyLabel) 'Add MyPage to MyDocument MyDocument.Pages.Add(MyPage) 'Outputs the MyDocument to the current web MyPage MyDocument.DrawToWeb("HelloWorld.pdf")

Re: File is damaged could not be repaired!

Support · Jan 18, 2007
Hello, You are getting this error most probably because of some extra HTML tags getting outputted before or after the PDF stream. Please try adding the below line of code right after the DrawToWeb method of the document object and it may solve your problem. Visible = false; Thanks, ceTe Software Support Team.

Re: File is damaged could not be repaired!

Forum member · Jan 18, 2007
Hi, Thanks this corrects the problem of viewing the demo script. However, when I re-look at my code (too large to insert here) whereby I save the pdf direct to disk produces the same error. I know you dont have a lot to go on, but can you hazard a guess what is going wrong here?

Re: File is damaged could not be repaired!

Support · Jan 18, 2007
Hello, The likely reason you get the error when saving the PDF to disk is likely because you have some stray HTML being added before the PDF is getting written. Remove any extra HTML from the aspx page and that should likely solve your problem. Thanks, ceTe Software Support Team