I guess it depends on what you're trying to do? Based on your blocks, it seems like you might be trying to render the PDF using a webviewer. In this case, I'd do something like:
import android.util.Base64;
import com.google.appinventor.components.runtime.util.IOUtils;
// ...
InputStream in;
try {
in = form.openAsset(filename);
byte[] contents = IOUtils.readStream(in);
String content64 = Base64.encodeToString(contents, Base64.NO_WRAP | Base64.URL_SAFE);
content64 = "data:application/pdf;base64," + content64;
// Set web viewer URL to content64
} catch (IOException e) {
// Report error via form.dispatchErrorOccurred(...)
} finally {
IOUtils.closeQuietly(in);
}