Path cannot be the empty string or all whitespace error when implementing Conversion tool

I receive the following error when I tried to implement the conversion dll:


“Path cannot be the empty string or all whitespace.“

I have reviewed the demo code and have set up the reference to the Groupdocs.Web.UI.Conversion.dll. When running my .net console application and trying to convert a PDF to Tiff it throws the error.

Here is a sample of my code:

GroupdocsConversion.SetRootStoragePath(path);
GroupdocsConversion.Init();
//get conversion instance
var conversion = GroupdocsConversion.Instance();
if (format.Equals(“TIF”))
{
outputFile = fileName.ToLower().Replace(”.pdf”, “.tiff”);
var convertResult = conversion.Convert(fileName, outputFile, FileType.Tiff);
if (convertResult.State == ConversionState.Failed)
{
Console.WriteLine(“Error message is: ‘{0}’”, convertResult.ErrorMessage);
}
}

where “path” is the image path and is a string.

I have tried to debug this code to see if it is setting the path correctly but can not find the correct property.

Thanks for any help in this matter,

Scott

Hello Scott,


We are sorry to hear that you have such issue. In the GroupdocsConversion.SetRootStoragePath() you should specify a path for the folder which will be used as root storage, in this folder you will store documents for conversion and converted files will be stored in it. Since that you can’t set a “path” as you specified in the request that the value of the “path” is image path.

Also please note that the “fileName” and “outputFile” should be in the folder which you will set as a root storage.