fun tablePlaintiff(canvas: Canvas, pos: POS, jsonObject: String) { /** 변수 **/ val cellHeight = 30 // Row Height : 30 val columnWidth = 60 // 내부선 val secondColumn = 260 // 두번쨰 열 val vcOffset = 4f // 세로 중간을 맞추기 위한 오프셋 val contact = getJsonContactPlaintiff(JSONObject(jsonObject)) // 첫째 행 // Rect val rect1 = Rect(pos.X, pos.Y, body.Width, pos.Y + cellHeight) canvas.drawRect(rect1, linePaint) // 첫쨰 줄 val rect1head1 = Rect(pos.X, pos.Y, pos.X + columnWidth, pos.Y + cellHeight) canvas.drawRect(rect1head1, cellFill) // 첫쨰 줄 첫쨰 제목 val rect1head2 = Rect(pos.X + secondColumn, pos.Y, pos.X + secondColumn + columnWidth, pos.Y + cellHeight) canvas.drawRect(rect1head2, cellFill) // 첫쨰 줄 둘쨰 제목 // Text canvas.drawText("이 름", rect1head1.exactCenterX(), rect1head1.exactCenterY() + vcOffset , cellHeader) canvas.drawText(contact.pName, pos.X.toFloat() + columnWidth + (secondColumn - columnWidth) / 2, pos.Y.toFloat() + cellHeight / 2 + vcOffset, cellBody) canvas.drawText("주민번호", pos.X.toFloat() + secondColumn + columnWidth / 2, pos.Y.toFloat() + cellHeight / 2 + vcOffset, cellHeader) // 2번쨰 칸 canvas.drawText(contact.socialNumber, pos.X.toFloat() + secondColumn + columnWidth + (body.Width - (pos.X + secondColumn + columnWidth)) / 2, pos.Y.toFloat() + cellHeight / 2 + vcOffset, cellBody) // 둘재 행 // Rect canvas.drawRect(pos.X.toFloat(), pos.Y.toFloat() + cellHeight, body.Width.toFloat(), pos.Y.toFloat() + cellHeight * 2, linePaint) // 둘쨰 줄 canvas.drawRect(pos.X.toFloat(), pos.Y.toFloat() + cellHeight, pos.X.toFloat() + columnWidth, pos.Y.toFloat() + cellHeight * 2, cellFill) // 제목박스 // Text canvas.drawText("주 소", pos.X.toFloat() + columnWidth / 2, pos.Y.toFloat() + cellHeight * 1 + cellHeight / 2 + vcOffset, cellHeader) canvas.drawText(contact.pAddress, pos.X.toFloat() + columnWidth + (body.Width - (pos.X + columnWidth)) / 2, pos.Y.toFloat() + cellHeight * 1 + cellHeight / 2 + vcOffset, cellBody) // 셋쨰 행 // Rect canvas.drawRect(pos.X.toFloat(), pos.Y.toFloat() + cellHeight * 2, body.Width.toFloat(), pos.Y.toFloat() + cellHeight * 3, linePaint) // 셋쨰 줄 canvas.drawRect(pos.X.toFloat(), pos.Y.toFloat() + cellHeight * 2, pos.X.toFloat() + columnWidth, pos.Y.toFloat() + cellHeight * 3, cellFill) // 제목박스 // Text canvas.drawText("연 락 처", pos.X.toFloat() + columnWidth / 2, pos.Y.toFloat() + cellHeight * 2 + cellHeight / 2 + vcOffset, cellHeader) // 제목 canvas.drawText(contact.pPhoneNumber, pos.X.toFloat() + columnWidth + (body.Width - (pos.X + columnWidth)) / 2, pos.Y.toFloat() + cellHeight * 2 + cellHeight / 2 + vcOffset, cellBody) // 내용 } // 명단이 없을 떄 fun noneContact(canvas: Canvas, pos: POS) { /** 변수 **/ val cellHeight = 30 // Row Height : 30 val vcOffset = 4f // 세로 중간을 맞추기 위한 오프셋 canvas.drawRect(pos.X.toFloat(), pos.Y.toFloat(), body.Width.toFloat(), pos.Y.toFloat() + cellHeight, linePaint) // 첫쨰 줄 canvas.drawText("당사자 정보가 없습니다. 당사자를 추가했는지 확인하세요!", pos.X.toFloat() + body.Width / 2, pos.Y.toFloat() + cellHeight / 2 + vcOffset , cellHeader) }