The first thing my web application does at startup is to log the versions of various things (.NET version, OS version, components version, etc).
For ASPOSE.Cells, there is a call Aspose.Cells.CellsHelper.GetVersion() that returns the version. How can I do this for Pdf, Pdf.Kit, Slides, Words, etc?
I am a representative from Aspose.Pdf team. I am afraid currently Aspose.Pdf does not support any method which can return the version number information of the component. But, for the sake of correction, I have logged this requirement as PDFNET-15744 under New Features list. We will look into the details of this requirement and will keep you updated on the status implementation.
That's too bad, but thanks for the response. How about with Slides, Words, Network, and Tasks? Do they have methods to return the version (similar to Cells)? Could these be added?
As a workaround for getting the version number information of Aspose.Pdf for .NET .dll, you may try using the following code snippet. You can even use the same code to get the version information of other products as well. In case you face any problem or you have any further query, please feel free to contact.
Thanks for your request. Actually, in .NET you can easily read this information from any of .NET libraries using exactly the same code. You should use Reflection to achieve this. Here is an example:
// Read assembly
Assembly asm = Assembly.LoadFile(@"C:\Temp\Aspose.Words.dll");
// Read name and version of the assembly.
Console.WriteLine("Assembly name: {0}", asm.GetName().Name);
Console.WriteLine("Assembly version: {0}", asm.GetName().Version);
Almost the same technique also works for Java.
In Java, you can use java.util.jar.JarFile to read manifest info of jar file. For example see the following code:
// Read jar file
java.util.jar.JarFile jar = new java.util.jar.JarFile("C:\\Temp\\Aspose.Words.jdk15.jar");
// Get manifest attributes
Map manifestAttributes = jar.getManifest().getMainAttributes();
// Get keys and values of manifest attributes
for (Object key : manifestAttributes.keySet()) {
System.out.printf("%s\t\t%s\n", key, manifestAttributes.get(key));
}
Thanks for all the replies. I am hoping that the components that do not yet have a simple metod to get the version will add them in a future release. The Reflection does work, but it seems like a lot of overhead just to return a version.
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.