new License().SetLicense(GetEmbeddedLicenseFile("Aspose.Total.lic"));
var msoPath = args[0];
Console.WriteLine("Extracting: {0}", msoPath);
using (var stream = File.OpenRead(args[0]))
{
var dict = InlineAttachmentExtractor.EnumerateMsoPackage(stream);
Console.WriteLine(dict.Keys);
foreach (var k in dict.Keys)
{
using (var write = File.OpenWrite(string.Format("c:\\testdata\\dis-4875\\{0}.pdf", k)))
{
write.Write(dict[k], 0, dict[k].Length);
}
}
}
where the args[0] is filepath to the attached oledata.mso file… I was expecting to get a pdf out of it. What it returns has leading and trailing garbage around the pdf. If I remove that the pdf opens fine.
First, are we using this correctly. Currently when iterating over mapi.Attachments we get oledata.mso back instead of the pdf (in outlook it is embedded icon in the body of message). My understanding is we need to then use EnumerateMsoPackage on the mso stream to break it out.
Files like “oleData.mso” refer to Microsoft Compound Document file (MCDF) format and, unfortunately, support for such files is beyond the occupation of Aspose.Email. However, libraries like OpenMCDF library for reading MCDF format in .NET once these are extracted from the message.
We have also noticed that with the latest version of the API, the API extracts PDF attachment fine from the MSG file.
Could you please open the attached PDF file by clicking it from MS Outlook? When we double click it, it gives error and doesn’t open at our end. Regarding our previous statement, it seems there was some confusion for the test and the API doesn’t detect the PDF file at our end as well.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.