Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderText() {
const { top, left } = this.getAbsoluteLayout();
const initialY = this.lines[0] ? this.lines[0].box.y : 0;
// We translate lines based on Yoga container
this.root.instance.save();
this.root.instance.translate(
left + this.padding.left,
top + this.padding.top - initialY,
);
// Perform actual text rendering on document
PDFRenderer.render(this.root.instance, [this.lines]);
setLink(this);
setDestination(this)
this.root.instance.restore();
}
async render() {
const renderText = (ctx, node) => {
const { top, left } = node.box;
const paddingTop = R.pathOr(0, ['box', 'paddingTop'], node);
const paddingLeft = R.pathOr(0, ['box', 'paddingLeft'], node);
const initialY = node.lines[0] ? node.lines[0].box.y : 0;
ctx.save();
ctx.translate(left + paddingLeft, top + paddingTop - initialY);
PDFRenderer.render(ctx, [node.lines]);
ctx.restore();
return node;
};