Question is already asked here : create PDF of RecyclerView in FULL length And I also have same Question as i haven't found solution yet, I want to Generate PDF of RecyclerView Content with full length. but did't found solution.
I have already tried all the available solutions and all the possible ways to generate PDF from RecycleView.
Solutions which i have already tried :
https://gist.github.com/PrashamTrivedi/809d2541776c8c141d9a
Take a screenshot of RecyclerView in FULL length
Convert Listview Items into a single Bitmap Image
Have tried all solutions which mentioned above but any of them not working with me and getting error, sometime width & height issue or sometime getting empty white bitmap as output don't know why.
Problem :
I have RecyclerView with HTML Content as well as Images in between contents.
Consider Following Screen as RecyclerView with content.
having content in RecyclerView same as above image with 100+ items.
RecyclerView Item Layout :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/leftImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:adjustViewBounds="true"
android:maxHeight="350dp"
fresco:actualImageScaleType="fitCenter"
fresco:placeholderImage="@color/white" />
<jp.wasabeef.richeditor.RichEditor
android:id="@+id/editor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin10dp"
android:layout_marginRight="@dimen/margin10dp"
android:layout_weight="1"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/rightImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:adjustViewBounds="true"
android:maxHeight="350dp"
fresco:actualImageScaleType="fitCenter"
fresco:placeholderImage="@color/white" />
</LinearLayout>
Update
As I was working on PDF to generate PDF from views, and was not able to generate PDF so I have posted this question.
But Now, I found a solution to generate PDF by using Webview you can see my answer on this question has marked as accepted.
Based on solution what I found, I have created a library to generate PDF from any String or Any HTML Content.
PDF-Generator Library: PDF-Generator
Thanks