We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

File is Damaged aspose.pdf 6.4.2

Hello all. Of course, this is an urgent request...(could it possibly be otherwise??) :)

The code below worked without issue under the Aspose.pdf.kit

after upgrading to aspose.pdf 6.4.2 we get the 'File is Damaged' problem in almost 80% of our pdf documents.

If System.IO.File.Exists(MyPDFUrl) Then

MyPageCount = Me.DetermineNumberOfPages(MyPDFUrl)

MyFileStream = New FileStream(MyPDFUrl, FileMode.Open, FileAccess.Read, FileShare.Read)

MyOutStream = New MemoryStream

MyMender = New Aspose.Pdf.Facades.PdfFileMend(MyFileStream, MyOutStream)

MyPDFText = Me.BuildUserSignature(GuestKeyIn)

For MyPage As Integer = 1 To MyPageCount

MyMender.AddText(MyPDFText, MyPage, MyLowerX, MyLowerY)

Next

Else

Throw New System.IO.FileNotFoundException("File not found", MyPDFUrl)

End If

the above code is used to build the memory stram in one method and is used in another method here:

If MyPDFStream IsNot Nothing Then

ContextIn.Response.AddHeader("content-disposition", If(PDFInSameWindow, "inline;", "attachment") & " filename=" & Me.CreatePDFFileName(MediaItemIn))

ContextIn.Response.ContentType = "application/pdf"

ContextIn.Response.AppendHeader("Accept-Ranges", "none")

ContextIn.Response.BinaryWrite(MyPDFStream.GetBuffer())

MyPDFStream.Flush()

ContextIn.Response.Flush()

HttpContext.Current.ApplicationInstance.CompleteRequest()

Else

Throw New Exception("MediaItemIn did not produce a PDF MemoryStream from BuildWaterMarkedPDFStream")

End If

Hi Ibrahim,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the sample code.

Please share a template file with us to reproduce the issue at our end. This will help us figure out the issue soon.

Sorry for the inconvenience,

attached is a sample pdf.

Hi Ibrahim,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the template file.

I checked your mentioned issue by using your template file and sample code and I am able to reproduce it. I have added the issue in our issue tracking system with issue id: PDFNEWNET-32565 for rectification. We will notify your regarding any update against this issue via this forum thread.

Sorry for the inconvenience,

Hi Nausherwan,

I have inherited this issue from Ibrahim as of today. Will you please let me know the status of issue PDFNEWNET-32565? Has a resolution been found? We are getting close to our release date and have to have this issue resolved soon.

Thanks

Amir

Hi Amir,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I have requested our development team to share an ETA regarding your issue. As soon as I get a reply from their side, I will update you via this forum thread.

Thank you for being patient,

Hi Nausherwan,

Have you been able to get an ETA for this issue from your development team? Our release date is fast approaching and we need to have a solution soon.

Regards,

Amir Jalali

Hi Amir,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

<o:p> </o:p>

Thank you for being patient.<o:p></o:p>

<o:p> </o:p>

Our development team is working on this issue and as per the
current progress the fix is planned to be included in our upcoming monthly
release of Aspose.Pdf for .NET v6.6 (scheduled to be released in early January
2012). We will notify you via this forum thread once the new release is
available for download.<o:p></o:p>

<o:p> </o:p>

Thank You & Best Regards,<o:p></o:p>

Hi Nausherwan,

Do you have an ETA for the release date which includes the fix for our issue?

Regards

Amir-

Hi Amir,

Thank you for being patient.

I am glad to inform you that your issue has been fixed and the fix is included in our upcoming release of Aspose.Pdf for .NET v6.6. The release is in testing at the moment and will be available for download in a few days. You will be notified once the new version is available for download.

Thank You & Best Regards,

The issues you have found earlier (filed as PDFNEWNET-32565) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

This release does not appear to have fixed our issue.

Hi Amir,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please accept our apologies regarding this. I have tested your issue again and I am able to reproduce the issue. I have re-opened your issue and asked the development team to check the issue. Also, I have change the priority to high for a high priority rectification. I will update you via this forum thread regarding any update against your issue.

Sorry for the inconvenience,

Hi Amir,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I got the following feedback from the development team regarding your issue. Please update your code to rectify the problem you are facing now with v6.6. Please replace the GetBuffer() with ToArray() in your code and the code will work fine. The GetBuffer() method gets the buffer with unused zero bytes which breaks Adobe view. Please update the following line in your code and if you still any problem, please do let us know.

Response.BinaryWrite(MyOutStream.ToArray())

Thank You & Best Regards,

Hi Nausherwan,

This release, along with the code modification your team suggested seems to have resolved our problem.

Thank You & Best Regards

Amir