Merged PR 1173: #2992 TK Fix PDF Viewer Content Sizing on Mobile

#2992 TK Fix PDF Viewer Content Sizing on Mobile
This commit is contained in:
Nino Righi
2022-04-12 08:21:36 +00:00
committed by Lorenz Hilpert
parent 4449992442
commit 09bb84c34e
3 changed files with 8 additions and 4 deletions

View File

@@ -5,8 +5,7 @@
[render-text]="true"
[(page)]="page"
(after-load-complete)="callBackFn($event)"
[fit-to-page]="true"
zoom-scale="page-height"
[fit-to-page]="!isSmallScreen"
></pdf-viewer>
<button (click)="print()" class="cta-print" type="button">

View File

@@ -1,3 +1,4 @@
import { BreakpointObserver } from '@angular/cdk/layout';
import { Component, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { DomainPrinterService } from '@domain/printer';
import { DomainTaskCalendarService } from '@domain/task-calendar';
@@ -22,12 +23,15 @@ export class PdfViewerModalComponent {
totalPages = 1;
isSmallScreen = this._breakpointObserver.isMatched('(max-width: 900px)');
constructor(
private modalRef: UiModalRef<any, PdfViewerModalData>,
private cdr: ChangeDetectorRef,
private uiModal: UiModalService,
private taskCalendarService: DomainTaskCalendarService,
private domainPrinterService: DomainPrinterService
private domainPrinterService: DomainPrinterService,
private _breakpointObserver: BreakpointObserver
) {
this.objectURL = URL.createObjectURL(this.modalRef.data.content);
this.file = this.modalRef.data.file;

View File

@@ -1,12 +1,13 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { LayoutModule } from '@angular/cdk/layout';
import { PdfViewerModalComponent } from './pdf-viewer-modal.component';
import { UiIconModule } from '@ui/icon';
@NgModule({
imports: [CommonModule, PdfViewerModule, UiIconModule],
imports: [CommonModule, LayoutModule, PdfViewerModule, UiIconModule],
exports: [PdfViewerModalComponent],
declarations: [PdfViewerModalComponent],
})