Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory image throwing type cast error - WEB #1818

Open
rmarco-dohle opened this issue Feb 13, 2025 · 2 comments
Open

Memory image throwing type cast error - WEB #1818

rmarco-dohle opened this issue Feb 13, 2025 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@rmarco-dohle
Copy link

rmarco-dohle commented Feb 13, 2025

Project is running in --wasm and having issues when displaying an image as the pdf header i have followed the documentation on how to display an asset image in a pdf.

final img = await rootBundle.load('assets/images/logo.jpg');
final imageBytes = img.buffer.asUint8List();
Create an image from the ImageBytes

pw.Image image1 = pw.Image(pw.MemoryImage(imageBytes));
implement the image in a container

pw.Container(
alignment: pw.Alignment.center,
height: 200,
child: image1,
);

Image

works fine when using html as renderer

@rmarco-dohle rmarco-dohle added bug Something isn't working needs triage labels Feb 13, 2025
@rmarco-dohle
Copy link
Author

Hi @DavBfr is this a valid bug? appreciate the help.

@rmarco-dohle
Copy link
Author

Hello badly need help in this please. Thanks for the quick reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant