the test pdf is very large, i uploaded it on a website and the access link is in the attachment sent to you, you can download the attachment here for 7 days
How to identify the page where the attachment is located, is it possible?
- Code: Select all
public void test2()
{
string location = @"C:\pdf\test_page17498.pdf";
Spire.Pdf.PdfDocument pdf = new Spire.Pdf.PdfDocument(location);
Spire.Pdf.Attachments.PdfAttachmentCollection collection = pdf.Attachments;
string attExtPath = @"C:\PDFReader\Extract\";
if (!Directory.Exists(attExtPath))
Directory.CreateDirectory(attExtPath);
foreach (Spire.Pdf.Attachments.PdfAttachment att in collection.List)
{
System.IO.File.WriteAllBytes(attExtPath + att.FileName, att.Data);
}
}