Comments (19)
<pinch-zoom>
<div class="oat-pdf-container">
<pdf-viewer [src]="pdfSrc"
[autoresize]="true"
[original-size]="false"
[show-all]="true"
[zoom]="currentZoom"
style="display: block;"
></pdf-viewer>
</div>
</pinch-zoom>
from ng2-pdf-viewer.
I implemented this in Ionic 3.9.2 in a modal. Here is a Gist to show how to implement.
from ng2-pdf-viewer.
I got it to work with pinch (although it's not very smooth), but couldn't get scroll to work with it.
from ng2-pdf-viewer.
Any news on this? I can't use this without pinch zoom.
from ng2-pdf-viewer.
for ionic 3 users here i found an work arround
from ng2-pdf-viewer.
Looking forward to this feature, as I am applying this to a mobile app.
from ng2-pdf-viewer.
+1
from ng2-pdf-viewer.
I also am looking for this
from ng2-pdf-viewer.
Anyone Implemented this? Help needed!
from ng2-pdf-viewer.
@tabirkeland That's with buttons though. What about the pinch gesture?
from ng2-pdf-viewer.
@jtcrowson I have not had the chance to try it which pinch.
You could try using the "pinch" gesture outlined here and calling the zoomIn()
and zoomOut()
functions depending on user input.
from ng2-pdf-viewer.
Biggest issue with using a gesture framework (like hammer.js) on the ng2-pdf-viewer is that it disables touch scrolling.
from ng2-pdf-viewer.
Any luck?
from ng2-pdf-viewer.
waiting for this as well, tried to get it to work myself but no luck... :(
from ng2-pdf-viewer.
using hammerjs it is something like that
const container: HTMLElement = document.getElementById('pdf-file-container');
const hammer = new Hammer(container, {
domEvents: true
});
hammer.get('pinch').set({
enable: true
});
hammer.on('pinchend', (event: any) => {
// get the current zoom value
let zoom = this.currentZoom;
// get the scaled amount
const scale = zoom * event.scale / 10;
// if the user is zooming in
if (event.additionalEvent === 'pinchout') {
zoom += scale;
} else {
// if zooming out
zoom -= scale * 10;
}
// if zoom is too small or too big set them to max values
if (zoom < 1) {
zoom = 1;
} else if (zoom > 2) {
zoom = 2;
}
// set the current zoom
this.currentZoom = zoom;
});
i am not sure if there is a better way but this works fine currently
from ng2-pdf-viewer.
using ngx-pinch-zoom, specific query google
from ng2-pdf-viewer.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from ng2-pdf-viewer.
any one able to do this?
from ng2-pdf-viewer.
from ng2-pdf-viewer.
Related Issues (20)
- Warnings in console when loading PDF file and trying to hide Annotation text yellow popup on onPageRendered event
- Getting console error after upgrading the ng2-pdf-viewer to latest version 10.0.0
- feat: [show-all]="false" with scroll end event to load next page bottom
- Uncaught TypeError: B.split(...).at is not a function
- Integrating custom script/features of adobe acrobat with ng2-pdf-viewer
- Pdf viewer shows stuck to load pdf file on Iphone 12 /13 HOT 1
- Hello everyone, I'm using pdf viewer version 6.3.2 and it runs fine locally but after build and publish I'm having this issue Refused to create a worker from 'blob
- Support for Angular version v17 HOT 4
- ReferenceError: Cannot access module before initialization ionic angular android 12 HOT 1
- 'PdfViewerModule' does not appear to be an NG module class
- ng2-pdf-viewer not working in Angular 17
- Getting Error "Worker was Destroyed" while loading large sized Pdf.
- Not works in IOS
- pef(Listeners): not removed
- Appending Date and Time with author name in annotation yellow text popup
- Any plans to upgrade to latest pdf.js version HOT 1
- Large file not shows starting pages quickly, is there any way to control chunk requests' sequence for linearization?
- How to get total page count of PDF? HOT 1
- CSP unsafe-inline directive blocks pdf viewer
- Not rendering PDF in angular 17, ng2-pdf-viewer : v10.0.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-pdf-viewer.