//create a new workbook Workbook workbook = new Workbook(); IWorksheet sheet = workbook.getWorksheets().get(0); IShape rectangle = sheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 50, 200, 200); rectangle.getLine().setDashStyle(LineDashStyle.Dash); rectangle.getLine().setStyle(LineStyle.Single); rectangle.getLine().setWeight(7); rectangle.getLine().getColor().setRGB(Color.GetYellow()); IShape donut = sheet.getShapes().addShape(AutoShapeType.Donut, 260, 50, 200, 200); donut.getLine().setDashStyle(LineDashStyle.DashDotDot); donut.getLine().setStyle(LineStyle.Single); donut.getLine().setWeight(7); donut.getLine().getColor().setRGB(Color.GetRed()); //save to an pdf file workbook.save("ShapeWithLine.pdf");
//create a new workbook var workbook = Workbook() val sheet = workbook.worksheets.get(0) val rectangle = sheet.shapes.addShape(AutoShapeType.Rectangle, 20.0, 50.0, 200.0, 200.0) rectangle.line.dashStyle = LineDashStyle.Dash rectangle.line.style = LineStyle.Single rectangle.line.weight = 7.0 rectangle.line.color.rgb = Color.GetYellow() val donut = sheet.shapes.addShape(AutoShapeType.Donut, 260.0, 50.0, 200.0, 200.0) donut.line.dashStyle = LineDashStyle.DashDotDot donut.line.style = LineStyle.Single donut.line.weight = 7.0 donut.line.color.rgb = Color.GetRed() //save to an pdf file workbook.save("ShapeWithLine.pdf")