0

I have tried to use the built in pdf generator with 'expo-print' and 'expo-sharing' but even after installing in SDK 51 with the command "npx expo install expo-print" and the other one it's still giving me this error. enter image description here

import * as Print from 'expo-print';
import * as Sharing from 'expo-sharing';

const GeneratePDF = async ({data}) =>{
    const html = `<h1> Teste </h1>`;
    const { uri } = await Print.printToFileAsync({ html:html,base64:false });
    Sharing.shareAsync(uri);
}

export default GeneratePDF

This is the only thing that I have written and anything that I have tried doesn't work.

4
  • create a dev build, npx expo prebuild, and then yarn ios or yarn android Commented Jul 18, 2024 at 5:12
  • @FaysalB it still gives me the same error nothing new Commented Jul 18, 2024 at 8:42
  • did you add the expo-print in the app.json plugins? Commented Jul 18, 2024 at 8:51
  • yes, also I have to mention that I am using an emulator apparently when I run the app on the phone it works. Commented Jul 18, 2024 at 9:16

1 Answer 1

0

Did you try by installing the Pods?

cd ios && pod install --repo-update && cd ..
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.