Achilles
Achilles

Reputation: 1129

How to take screenshots programmatically in a ReactJS android app?

I'm trying to build an android app that allows -

  1. Automatically scroll page by page.
  2. Take screenshot after each scroll (and ideally merge all screenshots into one image, if possible) and save the resulting image(s) in an album.

For example - the user opens a very long webpage in the browser, then triggers the app which screenshots the entire webpage automatically by scrolling down and taking screenshots until it reaches the bottom.

There seem to be many libraries to do the screenshot part for React Native but I can't seem to find any for ReactJS. Is it even possible with ReactJS or do I need to learn some other android specific technology to make it happen? I'm a ReactJS and mobile app dev newbie, so I might be missing something obvious.

Upvotes: 0

Views: 1942

Answers (2)

fatemeh kazemi
fatemeh kazemi

Reputation: 621

you can use this package to take screenshot from any pages "use-react-screenshot"

but this package have some problems. it works by react hooks or in take screenshot, svg codes not exist in image

Upvotes: 0

Arnaud Christ
Arnaud Christ

Reputation: 3551

If I understand well, your Android app is just a webview rendering the React app. If this is the case, you cannot do anything at React layer. you have to code the logic at native layer (in the native android application).

Upvotes: 1

Related Questions