PdfBox.fromArray constructor

PdfBox.fromArray(
  1. PdfArray<PdfDataType> array
)

Creates the box from a PdfArray of four numbers.

Throws ArgumentError when the array does not describe a valid box.

Implementation

factory PdfBox.fromArray(PdfArray array) {
  final box = tryFromArray(array);
  if (box == null) {
    throw ArgumentError.value(
        array, 'array', 'Uma caixa PDF exige quatro nĂºmeros finitos.');
  }
  return box;
}