Discover the HorizontalRuleFormat WidthPercent property to easily customize your horizontal rule's length as a percentage of window width for better design control.... Document doc = new Document (); DocumentBuilder...builder = new DocumentBuilder ( doc ); Shape shape = builder . InsertHorizontalRule...