Local Image is not loaded/displayed

  1. SDK Version: 44
  2. Platforms(Android/iOS/web/all): Android

We are using below code to generate HTML with local image. This HTML is then converted to PDF. This used to work in past (image was displayed in PDF), but has stopped working now, probably after we started using EAS build. The image we wanted to show is there in assets folder.

Please note that we are not experiencing this issue in Expo Go app.

import * as Print from 'expo-print';

const { default: exampleImage } = await import('../assets/example.jpg')
const exampleImageUri = Image.resolveAssetSource(exampleImage).uri;
// actual html is very long, below is just simple example
let html = `<html><body><div><img src="${exampleImageUri}" width="300" height="125" /></div></body></html>`;
const pdf = await Print.printToFileAsync({ html: html });

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.