We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

open failed: ENOENT (No such file or directory) exception while creating pdf

Hi,

I am trying to create a pdf from my XAML, and followed the exact same instructions in the following link:

https://www.syncfusion.com/kb/9174/how-to-create-a-pdf-file-in-xamarin

but problem is that it doesn't create anything,! tried to debug the code and realized that in SaveAndroid class on the line  'FileOutputStream outs = new FileOutputStream(file);' it throws an exception, and here is the message: "/storage/emulated/0/Syncfusion/Output.pdf: open failed: ENOENT (No such file or directory)"

so, can you please help me with this issue?
I also had the same issue when I tried to run this sample:

Thanks in advance

3 Replies

KC Karthikeyan Chandrasekar Syncfusion Team November 19, 2018 12:24 PM UTC

Hi Reihaneh, 

Thank you for contacting Syncfusion support. 

The ENOENT (No such file or directory) error may occur in application, If the application do not have storage permission. We suggest you to ensure whether the application has storage permission to read and write file in storage location. We have modified sample to provide storage permission at run time. Please find the sample below for your reference. 


Kindly refer below Xamarin link to provide permission for android application. 

Please let us know if you need further assistance in this. 
Regards, 
Karthikeyan  




RK Reihaneh Khaksaran November 19, 2018 04:19 PM UTC

Hi,

Oh, you're right, sorry, problem solved, thank you so much
oh and one more question, where is the file saved? I searched my all the directories on my phone but couldn't find the generated pdf!! I'm just able to open it from whithin the application!

Best Regards,
Reihaneh


KC Karthikeyan Chandrasekar Syncfusion Team November 20, 2018 10:17 AM UTC

Hi Reihaneh, 
The PDF file is saved in android platform using SaveTextAsync method from SaveAndroid class and it is included in Android project. In the SaveTextAsync method we are creating folder name with Syncfusion and inside the folder the PDF file is created.  You can find the output PDF file “/storage/emulated/0/Syncfusion/Output.pdf” in this location. 
 
Please let us know if you need further assistance on this. 

Regards,
 
Karthikeyan 


Loader.
Live Chat Icon For mobile
Up arrow icon