You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you guys still have an issue concerning the file path and the pdf not getting created in the appropriate folder.
I have found a work around.
Go directly to the source code in your node module
react-native-html-pdf -> android -> com -> christopherdro -> htmltopdf -> RNHTMLtoPDFModule.java
In the convert() function change this code block
File path = (Environment.MEDIA_MOUNTED.equals(state)) ?
new File(mReactContext.getExternalFilesDir(null), options.getString(DIRECTORY)) :
new File(mReactContext.getFilesDir(), options.getString(DIRECTORY));
with
File path = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), options.getString(DIRECTORY));
And that should change the file path to the appropriate location inside your emulator/device.
I have found a work around.
Go directly to the source code in your node module
react-native-html-pdf -> android -> com -> christopherdro -> htmltopdf -> RNHTMLtoPDFModule.java
In the convert() function change this code block
with
File path = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), options.getString(DIRECTORY));
And that should change the file path to the appropriate location inside your emulator/device.
Originally posted by @Allstern in #261 (comment)
The text was updated successfully, but these errors were encountered: