We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Malware-infected source files

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;
}

@James_Daughtry

It is better to use virus free documents. Aspose.Words reads the document and import it into its DOM. When you convert infected document to PDF or TIFF, it should not affect the system. You convert the document and check it with anti-malware software.