Hi i was trying to create a PDF output file from a Recyclerview using the library iText . After hours of struggle i was able to create PDF from recylerview .
Followi
You saved my day. But i had to change this line :
image.scalePercent(70);
image.setAlignment(Image.MIDDLE);
with this :
float scaler = ((document.getPageSize().getWidth() - document.leftMargin()
- document.rightMargin() - 0) / image.getWidth()) * 100; // 0 means you have no indentation. If you have any, change it.
image.scalePercent(scaler);
image.setAlignment(com.itextpdf.text.Image.ALIGN_CENTER | com.itextpdf.text.Image.ALIGN_TOP);
Thank a lot