christopherdro / react-native-html-to-pdf

Convert html strings to PDF documents using React Native
MIT License
434 stars 264 forks source link

How I can add Images in footer and header of all pdf page that was build using HTML. #248

Closed UsmanAhsanPs19 closed 1 year ago

UsmanAhsanPs19 commented 2 years ago

This means I have an HTML form pdf is creating but now I want to add branding of my customer on each page like adding a brand image in header and footer of all pages. Please guide thanks.

spinoops commented 2 years ago

It seems impossible with this library.

I have the same question and can't find any functional library that can create a PDF with different pages and Footer/Header.

I tried https://github.com/Hopding/react-native-pdf-lib but not supported anymore for latest version of react-native.

sundardsTechMind commented 2 years ago

@UsmanAhsanPs19 try this in your pdf template I'm able to add Images Like given below pdf-hd

christopherdro commented 2 years ago

Possibly related to https://github.com/christopherdro/react-native-html-to-pdf/issues/206 ?

UzairSamad commented 2 years ago

Any solution for the above scenario i am also got stuck in adding images to pdf

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

KarolHarumi commented 2 years ago

I've made it works but I had to host the image somewhere else.

Trying to get the image from the relative path didn't work.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

TechSaq commented 1 year ago

I've made it works but I had to host the image somewhere else.

Trying to get the image from the relative path didn't work.

That's the one way and sometimes it can give CORS issue. Just in case someone needs another solution.

The other solution is to convert the image into base64 data either from the relative path or from hosted URL.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.