Posts

Showing posts from November, 2018

PDF - Convert linear view to pdf document in Sketchware.

Image
1) Create a New project. 2) Add EditText as id= " edittext1 ", a Button as id =" button "  with text" Save " and a Linear Layout as id =" linear1 ". 3) In that Linear Add an another EditText as id=" edittext2 ".Set linear1 background colour WHITE. 4) Then Create a String variable as path . 5) On button1 click event add add source directly block with code:- try{ android.graphics.pdf.PdfDocument document = new android.graphics.pdf.PdfDocument(); android.graphics.pdf.PdfDocument.PageInfo pageInfo = new android.graphics.pdf.PdfDocument.PageInfo.Builder(linear1.getWidth(), linear1.getHeight(), 1).create(); android.graphics.pdf.PdfDocument.Page page = document.startPage(pageInfo); Canvas canvas = page.getCanvas(); Paint paint = new Paint(); canvas.drawPaint(paint); linear1.draw(canvas); document.finishPage(page);  6) Then Set the string path to as shown below. 7) Add write string block to enable STORAGE permission. 8