Aspose words compliance property

I installed aspose.words version 21.6.0.0. The reference documentation says that this version includes the compliance property. However, it is not being exposed. My code look like:
Dim pso As New PdfSaveOptions()
pso.compliance= <no intellisense, not exposed>
Please advise. Thank you

@mbulwa

The Aspose.Words for .NET contains the PdfCompliance enumeration. You need to set the value of PdfSaveOptions.Compliance property with PdfCompliance enumeration.

Please check the detail from here:

Please read my topic. I said that the property is not being exposed, so I get a syntax error if I do what you instructed me to do.

Tahir,

I got it solved. It was a conflict with another namespace. Case closed.

Thank you

@mbulwa

It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

Tahir

One new question, please: I know Aspose has a method to detect the file types (DetectFileFormat) inside the namespaces for WORD, CELLS, EMAIL, etc. However, I need to detect the file type for filenames without extension and they can be of any type. How does Aspose recommend doing that? (I don’t think tring them all is safe).
Thank you

@mbulwa

You can use the same FileFormatUtil.DetectFileFormat method to achieve your requirement.

Aspose.Words.FileFormatInfo info = FileFormatUtil.DetectFileFormat("DocumentWithoutExtenstion");

Console.WriteLine(FileFormatUtil.LoadFormatToExtension(info.LoadFormat));

I believe I tried that, but did not work for image files or msg files.
I am curious, if the Word method is meant to work on spreadsheets, images and email, why does Aspose have it separately on each namespace?

Thank you

@mbulwa

With Aspose.Words, you can detect file formats of supported documents by Aspose.Words. We are moving this forum thread to Aspose.Total forum where you will be guided appropriately.

Tahir

We are circling back to my original question: I did not ask to detect only supporting documents by Aspose Words. I asked how to detect any document without knowing if it is WORD or Excel or image, or msg.

@mbulwa,
There is no single API call that can detect all file types. You have to use different products to detect the file types like for Word files above call is shared by @tahir.manzoor. Similarly if file type is not a Word file, then you may check for Excel file using the sample code given in the following article:
How to Detect a File Format and Check if the File is Encrypted

I have checked the documentation but could not find any option to detect image or msg type. For these types, you may please device own logic based on meta data/MIME type available for these file types.

Ahsan,
Thank you for your reply. I already tried using one namespace method after another hoping that one of them would accurately detect the format, but it did not work well. The problem is the false positives and false negatives produced. For example, an .msg file will be detected by Word as a text file.

Thank you

@mbulwa,
We are afraid that no complete solution is available in this regard. You may try some mixed solutions to achieve this.