High resolution screen shot in Android

前端 未结 4 1976
盖世英雄少女心
盖世英雄少女心 2021-01-31 10:58

Is there any way to get a high resolution screen shot of a certain view in an activity.

I want to convert html content of my webview to PDF. For that I

4条回答
  •  太阳男子
    2021-01-31 11:45

    When you capture the view, just screen bound will capture ( due to control weight and android render pipeline ).

    Capturing screenshot for converting to PDF is tricky way. I think two way is more reasonable solutions.

    Solution #1

    Write a parser ( it's simple ) to convert webview content ( that is HTML ) to iText format.
    You can refer to this article for more information.
    http://www.vogella.com/articles/JavaPDF/article.html

    Also to write a parser you can use REGEX and provide your own methods like parseTable, parseImage, ...

    Solution #2 Internet Required

    Provide a URL ( or webservice ) to convert HTML to PDF using PHP or C# that has a lot of nice libraries. Next you can send download link to the Client ( Android Device ).

    So you can also dynamically add some Tags, Banners, ... to the PDF from server side.

提交回复
热议问题