import { PageOrientation , PredefinedPageSize } from 'pdfmake/interfaces' ; import type { LayoutParams , LayoutSelectorDictionary } from '../../common/layout' ; import { LayoutTypes } from '../../common' ; import type { Layout } from '.' ; import { DEFAULT_SELECTORS } from '.' ; import { DEFAULT_VIEWPORT } from '../browsers' ; import { BaseLayout } from './base_layout' ; export class PrintLayout extends BaseLayout implements Layout { public readonly selectors : LayoutSelectorDictionary = { ... DEFAULT_SELECTORS , screenshot : '[data-shared-item]' , } ; public readonly groupCount = 2 ; private readonly viewport = DEFAULT_VIEWPORT ; private zoom : number ; constructor ( { zoom = 1 } ) { super ( LayoutTypes . PRINT ) ; this . zoom = zoom ; } public getCssOverridesPath ( ) { return undefined ; } public getBrowserViewport ( ) { return this . viewport ; } public getBrowserZoom ( ) { return this . zoom ; } public getViewport ( itemsCount ) { return { zoom : this . zoom , width : this . viewport . width , height : this . viewport . height * itemsCount , } ; } public getPdfImageSize ( ) { return { width : 500 , } ; } public getPdfPageOrientation ( ) { return 'portrait' ; } public getPdfPageSize ( ) { return 'A4' ; } }