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

Free Support Forum - aspose.com

Get attachment information

Hi,

I am trying to obtain the information in the attachment in the below PDF.
input_test.pdf (209.7 KB)

The PDF has an attachment in it, but it seems that the following codes cannot get the information of the attachment. Is there any way to access the attachment in this PDF? Thanks

Document pdfDocument = new Document(“input_test.pdf”);
FileSpecification fileSpecification = pdfDocument.getEmbeddedFiles().get_Item(1);
System.out.printf("Name: - " + fileSpecification.getName());

Exception: Invalid index: index should be in the range [1…n] where n equals to the embedded files count

@aabbccdddd

We were able to reproduce the issue in our environment while using Apsose.PDF for Java 20.2 and logged it as PDFJAVA-39219 in our issue tracking system. We will further look into details of it and keep you updated with its resolution status. Please be patient and spare us some time.

We are sorry for the inconvenience.