intbot / ng2-pdfjs-viewer

An angular component for PDFJS and ViewerJS (Supports all versions of angular)
Apache License 2.0
228 stars 113 forks source link

Open external window in specific target #196

Open ruempel opened 1 year ago

ruempel commented 1 year ago

I can open a PDF document with [externalWindow]="true" in a new window or tab. Using externalWindowOptions I only managed to pass options from windowFeatures documented in https://developer.mozilla.org/en-US/docs/Web/API/Window/open, but I was not able to pass a target to e. g. open the next PDF document in the same window or tab as the first document.

How can I open a PDF document in a specific target window?

If this is currently not possible, I hereby request to add passing the target window as a parameter.

codehippie1 commented 1 year ago

@ruempel This is currently not possible. I will add to the list of feature requests. Alternatively, you can send me a PR, and that would be faster.

codehippie1 commented 1 year ago

@ruempel This was easy to address, I was already upgrading to Angular 15, so added a "target" parameter as well. Please look for next release.

Usage like this <ng2-pdfjs-viewer #externalPdfViewer [externalWindow]="true" openFile="false" [useOnlyCssZoom]=true target="_myWindow"></ng2-pdfjs-viewer>