import { IQuestion , QuestionImageModel } from 'survey-core' ; import { SurveyPDF } from '../survey' ; import { IPoint , DocController } from '../doc_controller' ; import { FlatQuestion } from './flat_question' ; import { FlatRepository } from './flat_repository' ; import { IPdfBrick } from '../pdf_render/pdf_brick' ; import { SurveyHelper } from '../helper_survey' ; export class FlatImage extends FlatQuestion { protected question : QuestionImageModel ; public constructor ( protected survey , question , controller ) { super ( survey , question , controller ) ; this . question = < QuestionImageModel > question ; } public async generateFlatsContent ( point ) { const widthPt = SurveyHelper . pxToPt ( < any > this . question . imageWidth ) ; const heightPt = SurveyHelper . pxToPt ( < any > this . question . imageHeight ) ; return [ SurveyHelper . createImageFlat ( point , this . question , this . controller , this . question . imageLink , widthPt , heightPt ) ] ; } } FlatRepository . getInstance ( ) . register ( 'image' , FlatImage ) ;