code: protected Element createLineElement(float x1, float y1, float x2, float y2)
      {
          HtmlDivLine line = new HtmlDivLine(x1, y1, x2, y2);
          String color = colorString(getGraphicsState().getStrokingColor());
  
          StringBuilder pstyle = new StringBuilder(50);
          pstyle.append("left:").append(style.formatLength(line.getLeft())).append(';');
          pstyle.append("top:").append(style.formatLength(line.getTop())).append(';');
          pstyle.append("width:").append(style.formatLength(line.getWidth())).append(';');
          pstyle.append("height:").append(style.formatLength(line.getHeight())).append(';');
          pstyle.append(line.getBorderSide()).append(':').append(style.formatLength(line.getLineStrokeWidth())).append(" solid ").append(color).append(';');
          if (line.getAngleDegrees() != 0)
              pstyle.append("transform:").append("rotate(").append(line.getAngleDegrees()).append("deg);");
  
          Element el = doc.createElement("div");
          el.setAttribute("class", "r");
          el.setAttribute("style", pstyle.toString());
          el.appendChild(doc.createEntityReference("nbsp"));
          return el;
      }
docs: Create an element that represents a horizntal or vertical line.
  @param x1
  @param y1
  @param x2
  @param y2
  @return the created DOM element