PaperFormat.fromString constructor

PaperFormat.fromString(
  1. String value
)

value is paper size in string | default: a4 Example : PaperFormat.fromString("a4")

Implementation

factory PaperFormat.fromString(String value) {
  switch (value.toLowerCase()) {
    case "letter":
      return PaperFormat.letter;
    case "legal":
      return PaperFormat.legal;
    case "tabloid":
      return PaperFormat.tabloid;
    case "ledger":
      return PaperFormat.ledger;
    case "a0":
      return PaperFormat.a0;
    case "a1":
      return PaperFormat.a1;
    case "a2":
      return PaperFormat.a2;
    case "a3":
      return PaperFormat.a3;
    case "a4":
      return PaperFormat.a4;
    case "a5":
      return PaperFormat.a5;
    case "a6":
      return PaperFormat.a6;
    default:
      return PaperFormat.a4;
  }
}