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

Free Support Forum - aspose.com

ImageInfo.File doesn't support root operator (~)

ImageInfo.File doesn’t support the root operator (~) like native .NET classes do. Will this be corrected in the future?

From http://msdn.microsoft.com/en-us/library/ms178116.aspx

Absolute and relative path references in a server control have the following disadvantages:

  • Absolute paths are not portable between applications. If you move the application that the absolute path points to, the links will break.
  • Relative paths in the style of client elements can be difficult to maintain if you move resources or pages to different folders.

To overcome these disadvantages, ASP.NET includes the Web application root operator (~), which you can use when specifying a path in server controls. ASP.NET resolves the ~ operator to the root of the current application. You can use the ~ operator in conjunction with folders to specify a path that is based on the current root.

The following example shows the ~ operator used to specify a root-relative path for an image when using the Image server control In this example, the image file is read from the Images folder that is located directly under the root of the Web application, regardless of where in the Web site the page is located.

You can use the ~ operator in any path-related property in server controls. The ~ operator is recognized only for server controls and in server code. You cannot use the ~ operator for client elements.

Hi David,

I have logged this issue as PDFNET-5593. We will try to support it in the future version.

Great!

-David

Hi David,

Now, we support root operator(~) for ImageInfo.File. Please download our new release Aspose.Pdf 3.8.0.0. Thanks.

Best regards.