From e5847cfafb4c8244b964876852c620d2dfa7669b Mon Sep 17 00:00:00 2001 From: jsheridan <17163297+jooshkins@users.noreply.github.com> Date: Fri, 31 Mar 2023 11:01:47 -0400 Subject: Feature - Page Preview for Simulator (#2174) Authored-by: jooshkins --- lib/api/page_specs.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/api/page_specs.py (limited to 'lib/api/page_specs.py') diff --git a/lib/api/page_specs.py b/lib/api/page_specs.py new file mode 100644 index 00000000..ff9f7cf6 --- /dev/null +++ b/lib/api/page_specs.py @@ -0,0 +1,22 @@ +# Authors: see git history +# +# Copyright (c) 2010 Authors +# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. + +from flask import Blueprint, g, jsonify + +page_specs = Blueprint('page_specs', __name__) + +@page_specs.route('') +def get_page_specs(): + + metadata = g.extension.get_inkstitch_metadata() + + page_specs = { + "width": metadata.document.get('width'), + "height": metadata.document.get('height'), + "pagecolor": metadata.document[1].get('pagecolor'), + "deskcolor": metadata.document[1].get('inkscape:deskcolor') + } + + return jsonify(page_specs) \ No newline at end of file -- cgit v1.2.3