A
A
asdevlog2020-12-24 20:42:22
Python
asdevlog, 2020-12-24 20:42:22

How to print text by coordinates on PDF Weasyprint?

Good day.
Tell me how you can add text to the coordinates on the finished PDF using WEasyPrint
Python 2.7 is used.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kitmanov, 2017-02-16
@k12th

"Hidden closures", EMNIP, is a horror story from the IE6-8 era.
I simplified your code to this and it works:

function Some() {
    this.id = Math.floor(Math.random() * 1000);
    this.timer = setInterval(() => {
        console.log('чем-то гажу в консоль');
    }, 1000 * 1);
    this.stop = () => {
        console.log(this); // тут видно, что контекст действительно правильный
        clearInterval(this.timer);
    };
}

const some0 = new Some();

setTimeout(() => {
    some0.stop();
}, 3000);

However, I note that in your code the Some function is not closed and includes app.route and so on, that is, you are not telling the whole truth and it is quite difficult to understand what exactly is wrong.
You also have pool is an array, but it is used as an object. Plus, you use arrow functions, but you emulate a class through dumb crutches.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question