Hello, I’m trying to extract all attachments from a zip and store previews under file actual names (e.g. test.pdf becomes test_p_1.html, test_p_2.html etc.), how can I do this? Also, might be useful to specify output directory. I can’t find output path parameter in viewer.View method:
using (Viewer viewer = new Viewer("sample.zip"))
{
var options = HtmlViewOptions.ForEmbeddedResources();
viewer.View(options);
var attachments = viewer.GetAttachments();
Console.WriteLine("\nAttachments:");
foreach (Attachment attachment in attachments)
{
var ms = new MemoryStream();
viewer.SaveAttachment(attachment, ms);
if (attachment.FileType == FileType.Unknown)
continue;
var lo = new LoadOptions() { FileType = attachment.FileType };
using (Viewer viewer1 = new Viewer(ms, lo))
{
viewer1.View(options); //How can I specify output filename here? It just writes everythign in p_1.html
}
Console.WriteLine(attachment);
}
}