import { PAPER_SIZE } from './constant'; export function setCanvasSize(canvas: Canvas, paperSize: PaperSize) { const sizeObj = PAPER_SIZE[paperSize]; // const { pixelRatio: dpr, windowWidth, windowHeight } = wx.getWindowInfo(); // const printWidth = A4.width; // const printHeight = A4.height; // @ts-ignore // const originWidth = canvas._width || windowWidth; // // @ts-ignore // const originHeight = canvas._height || windowHeight; canvas.width = sizeObj.width; canvas.height = sizeObj.height; console.log('canvas----:', canvas); return canvas; }