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

Free Support Forum - aspose.com

com.aspose.slides.exceptions.ArgumentException: Directory does not exist

Hello Aspose-Team,

i´ve tried to update to the newest aspose Version 17.7, which is currently not possible.

When i try to create a Presentation object with this Piece of code:

com.aspose.slides.Presentation p1 = new com.aspose.slides.Presentation();

iam getting the follwoing exception:
(same behaviour with all other constructors)

class com.aspose.slides.exceptions.ArgumentException: Directory does not exist
Parameter name: rootPath
com.aspose.slides.p6a2feef8.pbdb106a0.j.(Unknown Source)
com.aspose.slides.p6a2feef8.pbdb106a0.k.(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.(Unknown Source)

What´s wrong ?
Thanks in advance for yout help.

Best Regards

@matthias.frenzel,

I have observed your comments. Can you please check make sure your directory exist and you are using right directory. If there is still an issue than please share sample project so that we may further investigate to help you out.

Hello Adnan,

which Directory do you mean and should exist ?
Which path ?

When i use the old aspose library 16.4.0 everything works fine.
If i just update to the aspose library version 17.7 i will get the exception regarding “Directory does not exist”.
The Source-code/Project has not been changed. I´ve just changed the library Version…

Best Regards

Matthias

@matthias.frenzel,

I have observed your comments. Can you please share sample project so that we can further investigate to help you out.

Hello Adnan,

I can not publish the complete source code.
Because this is an Aspose Expetion (package: com.aspose.slides.p6a2feef8.pbdb106a0.j):
Which directory does Aspose expect? Or. Which directory must exist?
Could you please give me an answer for theses questions ? This might help me.
Thanks in advance!

What is the differences in the 2 library versions for a non-existent Directory (Version 16.4 works…)?

Best Regards

Matthias

Matthias

@matthias.frenzel,

I have observed your response and like to share that ArgumentException is thrown generally on loading presentation decks. Moreover, you have also mentioned that for older version the presentation deck works fine. Unfortunately, we may not be in position to help you further unless the requested source presentation and working sample code is shared. Please provide the requested information so that I may help you further in this regard.

Hello Mudassir,

i´ve created a simple web-project that shows the error:
maven-test-webapp.zip (102.6 KB)
Unfortunately, I can not upload the war files and lib files. The package would otherwise have a size of 100MB.
Therefore, you must create the war files yourself.
Tomcat version that i have used is: 8.5.11

Best Regards

Matthias

The source-code (a simple servlet) that reproduces the error is:

public class LoadAspose extends GenericServlet {

private static final long serialVersionUID = -6972797894923523726L;

/* (non-Javadoc)
 * @see javax.servlet.GenericServlet#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
 */
@Override
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {       
    
    System.out.println("### START");
    
    // --> Version 17.7: Exception: ArgumentException: Directory does not exist
    // --> Version 16.6: Works
    com.aspose.slides.Presentation p1 = new com.aspose.slides.Presentation(); 
    
    System.out.println("Presentation p1: " + p1);
}

}

@matthias.frenzel,

I have worked with source code and presentation file shared by you using Aspose.Slides for Java 17.7 and have been able to observe the issue. A ticket with ID SLIDESJAVA-36562 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be automatically notified once issue will be fixed.

We are sorry for your inconvenience,

I am facing the same issue for Aspose Slides in .NET. Has this been resolved ?

@matthias.frenzel,

Our product team has investigated the issue on their end. As you have stated that there is no issue when you use Aspose.Slides for Java 16.4 but have issue when using Aspose.Slides for Java 17.7. This seems related with access to TMPDIR.

Can you please run following simple servlet and share results:

public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {       
	
	System.out.println(System.getProperty("java.io.tmpdir"));
	System.out.println(File.createTempFile("tmpfile", "path").getAbsolutePath());
	System.out.println(getServletContext().getAttribute("javax.servlet.context.tempdir"));
}

By default Aspose.Slides 17.7 uses TMPDIR for managing the BLOBs and the you should provide RW access to this folder or use the following code snippet to set TMPDIR for Aspose.Slides:

LoadOptions loadOptions = new LoadOptions();
loadOptions.getBlobManagementOptions().setTempFilesRootPath("path_to_folder");
Presentation pres = new Presentation(loadOptions);

@atigoyal, I also suggest you to verify the same for .NET related environment as well. You can please try using following alternate on your end.

Aspose.Slides.LoadOptions loadOptions = new Aspose.Slides.LoadOptions();
loadOptions.BlobManagementOptions.TempFilesRootPath=@"path_to_folder";
Presentation pres = new Presentation(loadOptions);

@mudassir.fayyaz, I tried the solution given by you, but its still giving the same error. on creating Presentation object.

@atigoyal,

Have you given read write access permissions for your user to temp folder? Please grant the permissions as well and if there is still an issue then please provide the working sample project reproducing issue on your end.

@mudassir.fayyaz

I checked and the user already had permissions to that folder. I am uploading the working sample projectAsposeTest.zip (53.2 KB)
.
I cannot add Aspose dll file as it would increase the size of the project. Kindly add it at your end before testing. The version used by me was Aspose.Slides.dll, v17.7.0.0.

@atigoyal,

We are investigating the issue shared by you and will get back to you with a feedback as soon as possible.

@atigoyal,

I have worked with sample project shared by you using Aspose.Slides for .NET 17.8 on my end. I have observed that instead to giving path TempFilesRootPath, you are giving presentation name, which is wrong. You need to give absolute path to temp folder. Can you please try using attached sample code on your end and please make sure to change the path folder as per your machine.

AsposeTest.zip (55.3 KB)

@mudassir.fayyaz

I am not able to download the sample project given by you.

It gives me an error saying Sorry, this file is private. Only visible to topic owner and staff members.

@atigoyal,

Please try using following sample code to serve the purpose on your end.

try
{
    Aspose.Slides.LoadOptions loadOptions = new Aspose.Slides.LoadOptions();
    Console.WriteLine(File.Exists("Pres1.pptx"));
    //     loadOptions.BlobManagementOptions.TempFilesRootPath = "Pres1.pptx";
    loadOptions.BlobManagementOptions.TempFilesRootPath = @"C:\Aspose Data\";

    Presentation pres = new Presentation("Pres1.pptx",loadOptions);
         
    Console.WriteLine(pres.Slides.Count);
    Console.ReadKey();
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
    Console.ReadKey();
}

@mudassir.fayyaz

Thanks for your reply und your help in that case.

  1. If the temp dir exists and with your code, the creating of presentation object works - console log.:
    C:\Projects\XXXX\Tomcat\apache-tomcat-8.5.11\temp
    C:\Projects\XXXX\Tomcat\apache-tomcat-8.5.11\temp\tmpfile6556135635035564941path
    C:\Projects\XXXX\Tomcat\apache-tomcat-8.5.11\work\Catalina\localhost\slides
    Presentation p1: com.aspose.slides.Presentation@642d21b0

  2. If temp dir doesn´t exist i got the "com.aspose.slides.exceptions.ArgumentException: Directory does not exist "
    exception. But when the temp folder is created manually it works. In my opinion it should not be the case that every
    aspose-slide user has to check and create the tmp folder manually.

After the conversion (slides for Java) works now, I had to notice at the first PowerPoint test that the result has worsened (e.g. Incorrectly scaled images, blurry images, flowcharts moved,…) against the version 16.6.I will open a new thread as soon as I have created a sample document. The original document is unfortunately confidential and can not be published.

Best Regards

Matthias

@matthias.frenzel,

Its good to know that things have worked on your end by setting path to temp folder. Aspose.Slides gives you a valid exception in case of folder is not existing and therefore giving user a choice to add the temp folder by himself. This has been implemented this way and I feel it is OK.

As far your question concerning to rendering of slides is concerned, please feel free to share the source presentation, generated output from Aspose.Slides 16.6 and Aspose.Slides 17.8, and used sample code. We will investigate that further to help you out.