Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Feb 22, 2018 9:18 am

Hello,

I have noted a problem when working with the Spire.PDF attachments.
On some PDFs the attachments are added properly, but cannot be received afterwards via the Spire.PDF API.

For testing purpose I have created the following simple code example:

Code: Select all
// Load the PDF.
PdfDocument document = new PdfDocument();
document.LoadFromFile("Document.pdf");

// Add png image as attachment.
PdfAttachment attachment = new PdfAttachment("Wikipedia_Science.png");
attachment.MimeType = "image/png";
attachment.Description = "Attached image.";
document.Attachments.Add(attachment);

// Check attachments.
int count = document.Attachments.Count; // Works fine. returns 1.

// Save pdf document.
string fileName = "DocumentWithAttachment.pdf";
document.SaveToFile(fileNameNew);
document.Close();

// Load the saved document and check attachments.
document.LoadFromFile(fileName);
count = document.Attachments.Count; // Does not work. returns 0.
document.Close();


Attaching the png image itself seems to work fine.
I can see and save the attachment, when opening the PDF with Adobe Acrobat DC.
But when I open the saved PDF with Spire.PDF and try to get the attachments, it is returning nothing.

Could you please invastigate what's the problem with this specific PDF.
Is this a known issue and are there any workarounds or fixes?

PS: I have also tested it with the latest hotfix 4.2.4(2018-02-09).

Best regards and thanks in advance
TSE
Last edited by TSE on Thu Feb 22, 2018 10:24 am, edited 1 time in total.

TSE
 
Posts: 9
Joined: Thu Feb 09, 2017 3:32 pm

Thu Feb 22, 2018 10:05 am

Hello,

Thanks for your inquiry.
I have reproduced the issue and referred it to our dev team for a further investigation.
Once there's any update, I will inform you.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Mar 07, 2018 8:29 am

Hello TSE,

Glad to inform that your issue has been resolved and the hotfix(Spire.PDF Pack(Hot Fix) Version:4.3.0) is available now.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Mar 09, 2018 9:42 am

Hi,

Have you tried the hotfix?
Your feedback would be greatly appreciated.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Mar 09, 2018 11:54 am

Hello,

I've tested the hotfix today and can confirm that the error is gone.
Adding and getting attachments works fine now.

Thank you very much!

Sincerely,
TSE

TSE
 
Posts: 9
Joined: Thu Feb 09, 2017 3:32 pm

Mon Mar 12, 2018 6:02 am

Hello TSE,

Thanks for your valuable feedback.
Just feel free to contact us if you need any help.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.PDF

cron