Customize zoom-dropdown #2713
-
Hi guys! I have a problem with customizing zoom-dropdown, because your dropdown has a cross-browser issue with styles inconsistencies, cause it uses common browser-specific styles and can't be changed using CSS. I tried to write a new HTML code for dropdown using ngx-extended-viewer ids, but it doesn't work, unfortunately. Here an example of my code: <pdf-zoom-out/>
<mat-select id="scaleSelect" (selectionChange)="changeZoom($event)">
<mat-option id="pageFitOption" value="page-fit" data-l10n-id="pdfjs-page-scale-fit">Page fit</mat-option>
<mat-option id="pageWidthOption" value="page-width" data-l10n-id="pdfjs-page-scale-width">Page Width</mat-option>
<mat-option value="0.5">50%</mat-option>
<mat-option value="0.75">75%</mat-option>
<mat-option value="1">100%</mat-option>
<mat-option value="1.5">150%</mat-option>
<mat-option value="2">200%</mat-option>
</mat-select>
<pdf-zoom-in/> Also, I tried to change zoom manually through pdfVIewer viewChild like this, but is also doesn't work: this.pdfViewer.zoom = 'page-fit';
this._pdfViewerService.recalculateSize(); Maybe I hasn't found the right way to solve my problem, if you don't have a solution, I think I create an issue |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'm afraid I haven't understood your problem.
As for setting the zoom: there's a two-way binding attribute for that. Just use "[zoom]="myZoom" in the HTML template and set "myZoom='page-fit' in the TypeScript code. Here's a live demo: https://pdfviewer.net/extended-pdf-viewer/zoom |
Beta Was this translation helpful? Give feedback.
I'm afraid I haven't understood your problem.
As for setting the zoom: there's a two-way binding attribute for that. Just use "[zoom]="myZoom" in the HTML template and set "myZoom='page-fit' in the TypeScript code. Here's a live demo: https://pdfviewer.net/extended-pdf-viewer/zoom