updatePageHeight method

Future<void> updatePageHeight(
  1. String svgPath,
  2. Size pageSize,
  3. Size newPageSize
)

We increase the page hieght so we can fit the page no. at the bottom of the page without it being over any of the diagram.

Implementation

Future<void> updatePageHeight(
    String svgPath, Size pageSize, Size newPageSize) async {
  final existing =
      '<svg width="${pageSize.width}pt" height="${pageSize.height}pt';
  final replacement =
      '<svg width="${newPageSize.width}px" height="${newPageSize.height}px';
  await replace(svgPath, existing, replacement);

  /// update the viewbox
  await replace(
      svgPath, ' ${pageSize.height}.00"', ' ${newPageSize.height}.00"');
}