I received a question that I could not answer.
We use Aspose to convert Word documents to PDF or TIFF, and the question was if an infected Word document could affect the system from that conversion. Assuming anti-malware software doesn’t automatically quarantine these files, is this a potential concern?
Here is my code for the conversion:
public static string FromWord(string file, int dpi = 300, ConversionType targetType = ConversionType.Pdf)
{
Util.SetAsposeLicensing();
var dstPath = Path.ChangeExtension(file, targetType == ConversionType.Pdf ? ".pdf" : ".tif");
var doc = new Aspose.Words.Document(file);
if (targetType == ConversionType.Pdf)
{
doc.Save(dstPath);
}
else
{
var options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Tiff);
options.ImageColorMode = Aspose.Words.Saving.ImageColorMode.None;
options.TiffCompression = Aspose.Words.Saving.TiffCompression.Lzw;
options.Resolution = dpi;
options.PrettyFormat = true;
doc.Save(dstPath, options);
}
return dstPath;
}