Search code examples
androidandroid-layoutpdfscreenshot

Screenshot of layout in Android as PDF


I have created an activity in Android 5.1. Now I would like to take a picture as PDF of the layout. One possibility is to run the app (on a tablet) and then taking a screenshot using

adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png

Unfortunately, it is not possible to directly create a PDF (vector graphic). Is there a possibility to store the layout as a PDF?


Solution

  • If you are using linux, you can use imagemagick to convert the png to pdf

    convert screen.png screen.pdf