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

Free Support Forum - aspose.com

PDFExtractor ExtractAttachment method errors

I recently upgraded to version 5.2 from 4.8.


Unfortunately the latest version does not seem to work at all with regards to extracting attachments from PDFs. I get the error “Source array type cannot be assigned to destination array type.” every time I run the ExtractAttachment method, and GetAttachNames and GetAttachment won’t work.

I’ve attached a sample PDF file with an attachment that extracts fine in 4.8 but errors on 5.2.

Thanks

Doug

Hi Doug,

I have tested the attached file with the latest version (5.2.0), but couldn’t find any problem; the attachment was extracted fine. Could you please share which OS and .NET Framework you’re working with, so we could test the issue using your particular scenario?

We’re sorry for the inconvenience.
Regards,

I am running Windows XP Professional, SP3 .NET Framework 3.5. I have tested it on multiple machines and get the same error.


Thanks

Doug

Hi Doug,

I have again tested this issue using your particular scenario but couldn’t reproduce it at my end. First of all, can you please make sure that the version you’re using at your end is 5.2.0 and you’re using the DLL from bin\net35 folder. Secondly, if you still find the same problem then please share a sample project which can help us reproduce the same issue over here. We’ll further investigate this issue and you’ll be updated accordingly.

We’re sorry for the inconvenience.
Regards,

Hi Shahzad,


I was able to determine that the error described only occurs when binding via a stream as opposed to a path. For now I have changed my program to use BindPDF(Path) instead and it works fine.

I’ve attached a sample project but the code to reproduce the error is simple:

Imports Aspose.Pdf.Kit
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim PKLic As New License
Dim PKExt As New PdfExtractor
Dim FStream As System.IO.FileStream
Try
PKLic.SetLicense(“C:\Program Files\Aspose\Aspose.Total.lic”)
FStream = New System.IO.FileStream(Application.StartupPath & “\AA0213-PDF Proxy card (FINAL).pdf”, IO.FileMode.Open)
PKExt.BindPdf(FStream)
PKExt.ExtractAttachment()

MsgBox(“success”)
Catch ex As Exception
MsgBox("Error - " & ex.Message)
Finally
If Not FStream Is Nothing Then FStream.Close()

End Try
End Sub
End Class

Thanks,

Doug

Hi Doug,

First of all, I’m glad to know that using file path instead of stream works fine at your end and can help you move forward.

Secondly, I’m very much thankful to you for sharing further details regarding the cause of this issue. I have also reproduced the same issue at my end using stream instead of file path and logged it as PDFKITNET-23905 in our issue tracking system. Our team will look into this issue and you’ll be notified via this forum thread once it is resolved.

We’re sorry for the inconvenience.
Regards,

Hi,

My company has strict I/O requirements, and we would like to be able to use the ‘stream’ version of the ExtractAttachments() function. Has any progress been made with regard to this fix? Is there an ETA?

Thanks,
Daniel

Hi Daniel,

I’m sorry to share with you that this issue is not yet resolved. However, I have asked our team to share the ETA of this issue and you’ll be updated via this forum thread as soon as the response is received.

We’re sorry for the inconvenience.
Regards,

Hi Daniel,

Our team has looked into this issue in detail and I would like to share with you that the fix for this issue will be available at the end of May 2011. You’ll be notified via this forum thread once it is resolved.

We’re sorry for the inconvenience. If you have any further questions, please do let us know.
Regards,

Thanks for looking into this and getting back to me!

Hi,

I do not see the release notes referencing this issue in the latest release (5.6.0.0), but I retried anway, with no luck. Is there an ETA on this fix (end of May was the initial ETA, as per above).

Thanks,
Daniel

Hi Daniel,

I have contacted our development team for the details regarding the current status of this issue. You’ll be updated with the status shortly.

We’re sorry for the inconvenience.
Regards,

Hi Daniel,

This issue is resolved in our upcoming monthly release. The release will be available at the end of next week.

Regards,

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


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

Thanks.

While the newest build (5.8.0.0) solves this problem for some PDFs, there are still some that cause the API to fail in the same way. I've attached a PDF that shows this.

Thanks,
Daniel

Hi Daniel,

I have reproduced this problem at my end and logged it as PDFKITNET-29592 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is resolved.

We’re sorry for the inconvenience.
Regards,