iZettle / android-html2bitmap

Generates a bitmap from html by rendering the content inside an off screen webview
MIT License
56 stars 20 forks source link

How can I include a external CSS file? #34

Open ghost opened 4 years ago

ghost commented 4 years ago

@erikeelde @BeeeQueue @warting @hfreire @bborisovs

Hi, Sorry for mentioning everyone. Thanks for making such a wonderful thing.

If I write CSS codes inside the style tag of the head tag, it works fine. Is there a way to include a CSS file from the project files? Not from an external internet link. I am pretty new to these things. If this is possible, please teach me a little about the procedure.

Thanks in advance.

beeequeue commented 4 years ago

I'd highly recommend using another library as this doesn't seem to be maintained anymore, and none of the creators work at iZettle anymore.

erikeelde commented 4 years ago

@amibappy it should be quite readily doable to include it from the project files I think? I can't recall the exact syntax needed off the top of my head atm. I think they needed to be included using assets-syntax or something similar - and I'm pretty sure it can be done with the library the way it works today. Did you try making use of WebViewAssetContent by means of targeting your file using "html2bitmap://android_asset/..." to achieve what you want?

@BeeeQueue I'm not so sure there are terribly many options as it comes to solving this particular problem on android - which in fact is just why we wrote up this library. (The suggestion to use another library may be something of a dead end).