0

I have a recyclerview data is set from server i want to save the data to pdf file how can i achieve please help

JSONArray jsonArray = jobj.getJSONArray("Complaint Details");
rcview.setBackgroundResource(R.drawable.bbg1);
for (int i = 0; i < jsonArray.length(); i++) {
    jobj = jsonArray.getJSONObject(i);
    viewcmplist item = new viewcmplist(
            jobj.getString("subject"),
            jobj.getString("mark"),
            jobj.getString("ce"),
            jobj.getString("te"),
            jobj.getString("grade")

    );
    listitems1.add(item);
}
cmpadapter = new CmpviewAdapter(listitems1, getApplicationContext());
rcview.setAdapter(cmpadapter);
K Neeraj Lal
  • 6,768
  • 3
  • 24
  • 33
Avinash
  • 361
  • 4
  • 16

1 Answers1

0

You can use a custom library such as https://github.com/HendrixString/Android-PdfMyXml. I prefer this library than any other method. Just Go through these.

but there is another way - How to convert Android View to PDF - that generate a pdf that contains bitmap of your layout

Tomin B Azhakathu
  • 2,656
  • 1
  • 19
  • 28