Generate PDF with Ionic images

Asked

Viewed 358 times

0

I need to generate a PDF within a hybrid APP developed with Ionic.

I tried to use the main plugins such as pdf-Generator but I always end up bumping into the same problem, which are the images that do not appear.

The app images, are stored in the store, because it works offline. PDF generates all right, but not images, I have checked path and tried several approaches.

  • Since the images are stored in the store, they are in Base64, correct? Are you correctly putting the img tag for Base64 in the source HTML of the pdf? Type this here: <img src="data:image/png;Base64, iVBORw0KGgoAAANSUhEUgAAAAUA Aaafcayaaacnbyblaaaaheleqvqi12p4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAABJRU5ErkJggg=="alt="Red dot" />

  • Yes they are loaded in the store, I receive them via request and upload them to the store, but load them via path ex: "file://var/mobile/Containers/Data/Application/filename" My problem seems to be that by path, inside the plugin that generates the pdf it does not recognize the same, or has no access.

  • With path does not scroll, tried the example q passed in the comment?

  • yes I tried, and it didn’t work either. .

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.