Skip to content

Commit

Permalink
Zeer beperkte aanpassing aan print.ts (functie uit een andere functie…
Browse files Browse the repository at this point in the history
… gehaald, anders wil de online versie niet werken).
  • Loading branch information
igoethal committed Nov 1, 2024
1 parent 38f9ed7 commit da0e401
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion builddate.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var CONF_builddate="20241101-151709"
var CONF_builddate="20241101-152135"
26 changes: 13 additions & 13 deletions eendraadschema.js
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,19 @@ function dosvgdownload() {
var filename = document.getElementById("dosvgname").value;
download_by_blob(prtContent, filename, 'data:image/svg+xml;charset=utf-8'); //Was text/plain
}
function getPrintSVGWithoutAddress(outSVG, page) {
if (page === void 0) { page = structure.print_table.displaypage; }
var scale = 1;
var startx = structure.print_table.pages[page].start;
var width = structure.print_table.pages[page].stop - startx;
var starty = structure.print_table.getstarty();
var height = structure.print_table.getstopy() - starty;
var viewbox = '' + startx + ' ' + starty + ' ' + width + ' ' + height;
var outstr = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" transform="scale(1,1)" style="border:1px solid white" ' +
'height="' + (height * scale) + '" width="' + (width * scale) + '" viewBox="' + viewbox + '">' +
flattenSVGfromString(outSVG.data) + '</svg>';
return (outstr);
}
function printsvg() {
function generatePdf() {
if (typeof (structure.properties.dpi) == 'undefined')
Expand All @@ -791,19 +804,6 @@ function printsvg() {
document.getElementById("progress_pdf") //HTML element where callback status can be given
);
}
function getPrintSVGWithoutAddress(outSVG, page) {
if (page === void 0) { page = structure.print_table.displaypage; }
var scale = 1;
var startx = structure.print_table.pages[page].start;
var width = structure.print_table.pages[page].stop - startx;
var starty = structure.print_table.getstarty();
var height = structure.print_table.getstopy() - starty;
var viewbox = '' + startx + ' ' + starty + ' ' + width + ' ' + height;
var outstr = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" transform="scale(1,1)" style="border:1px solid white" ' +
'height="' + (height * scale) + '" width="' + (width * scale) + '" viewBox="' + viewbox + '">' +
flattenSVGfromString(outSVG.data) + '</svg>';
return (outstr);
}
function renderPrintSVG(outSVG) {
document.getElementById("printarea").innerHTML = '<div id="printsvgarea">' +
getPrintSVGWithoutAddress(outSVG) +
Expand Down
34 changes: 17 additions & 17 deletions src/print/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ function dosvgdownload() {
download_by_blob(prtContent, filename, 'data:image/svg+xml;charset=utf-8'); //Was text/plain
}

function getPrintSVGWithoutAddress(outSVG: SVGelement, page:number = structure.print_table.displaypage) {
var scale = 1;

var startx = structure.print_table.pages[page].start;
var width = structure.print_table.pages[page].stop - startx;
var starty = structure.print_table.getstarty();
var height = structure.print_table.getstopy() - starty;

var viewbox = '' + startx + ' ' + starty + ' ' + width + ' ' + height;

var outstr = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" transform="scale(1,1)" style="border:1px solid white" ' +
'height="' + (height*scale) + '" width="' + (width*scale) + '" viewBox="' + viewbox + '">' +
flattenSVGfromString(outSVG.data) + '</svg>';

return(outstr);
}

function printsvg() {

function generatePdf() {
Expand All @@ -27,23 +44,6 @@ function printsvg() {
);
}

function getPrintSVGWithoutAddress(outSVG: SVGelement, page:number = structure.print_table.displaypage) {
var scale = 1;

var startx = structure.print_table.pages[page].start;
var width = structure.print_table.pages[page].stop - startx;
var starty = structure.print_table.getstarty();
var height = structure.print_table.getstopy() - starty;

var viewbox = '' + startx + ' ' + starty + ' ' + width + ' ' + height;

var outstr = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" transform="scale(1,1)" style="border:1px solid white" ' +
'height="' + (height*scale) + '" width="' + (width*scale) + '" viewBox="' + viewbox + '">' +
flattenSVGfromString(outSVG.data) + '</svg>';

return(outstr);
}

function renderPrintSVG(outSVG: SVGelement) {
document.getElementById("printarea").innerHTML = '<div id="printsvgarea">' +
getPrintSVGWithoutAddress(outSVG) +
Expand Down

0 comments on commit da0e401

Please sign in to comment.