I’m trying to display a file preview with a PDF returned in binary or base64 by an API.
(Why? Because PDFs are generated temporarily and not stored on the server).
I tried @capacitor-community/file-opener but this package requires a filePath and is not compatible for base64 string.
I also tried opening the PDF in the in-app browser or in an HTML element such as or but that doesn’t work either.
I also tried to save the file locally and than get the path to the local file but the method writeFile of the package @capacitor/filesystem seems to only accept url as value in native devices.
Could you tell me if this is possible and if it is, how I can achieve this?
That depends on your use case. If the file can be embedded in the webview, then this is not necessary (e.g. for an image). But if the file should be opened natively, then it must also be available on the native file system.