pramodkr123 / ConvertWebViewToPdfDemo

Convert WebView to pdf in android
MIT License
40 stars 19 forks source link

Is there any way to set the size of PDF? I want to set size to A5. Default size is A4 and there is a huge blank space. #3

Open xihuny opened 5 years ago

pramodkr123 commented 5 years ago

Currently not any option for A5 in my library. I will add option for A5 size soon. If you want to implement in your app just download my library and import in your project as a library. Go the class PdfView - >change this code .setMediaSize(PrintAttributes.MediaSize.ISO_A4) to .setMediaSize(PrintAttributes.MediaSize.ISO_A5)

// it is also depend on your width, height so change this as per your requirement. .setResolution(new PrintAttributes.Resolution("pdf", "pdf", 600, 600))

It will work.

Let me know if you are facing any issue. Thanks,