Code Monkey home page Code Monkey logo

pdfjs's Introduction

pdfjs's People

Contributors

elashi avatar jfversluis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pdfjs's Issues

How to download in pdf on button click.

HI!!!
i have opened open rdlc report with asp.net web api in custome web view successfully you teach but now i want to downlaod this opened file in pdf in mobile storage.Thanks

Open local PDF file from FileSystem.AppDataDirectory

Hello good sir!
I'm new to xamarin and I have to finish an important project, how can I pass a path to de view instead of a url. I already managed the download of images to the desired folder, but i'm having trouble working with pdf files. I'm saving the downloaded pdf inside a folder using the FileSystem API and it seems to work, now I just need to be able to view it inside the app itself.
Also, is there a way I could pass the path to the downloads folder from the phone itself, since I managed to download pdf file to there as well.
Thanks in advance for any and all help with this issue, Greeting from Chile!

Sample crash when using latest Xamarin forms in IOS

Hello,

I just tried the sample from GitHub, and updated all Nuget packages.
for IOS, Xamarin forms is now 4.8.0.164

when I try to run it on an iPad, the app crash with that error :
"Object reference not set to an instance of an object"

" at Xamarin.Forms.Platform.iOS.WebViewRenderer+CustomWebViewDelegate.ShouldStartLoad (UIKit.UIWebView webView, Foundation.NSUrlRequest request, UIKit.UIWebViewNavigationType navigationType) [0x00072] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\WebViewRenderer.cs:277 \n at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)\n at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.20.2.2/src/Xamarin.iOS/UIKit/UIApplication.cs:86 \n at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.20.2.2/src/Xamarin.iOS/UIKit/UIApplication.cs:65 \n at pdfjs.iOS.Application.Main (System.String[] args) [0x00001] in /Users/olivier/Downloads/pdfjs-master/iOS/Main.cs:17 "

PDF-View cant pinch-to-Zoom / tap/doubletap to Zoom

Hey,

the pdf.js dont can handle the "pinch-to-zoom"-Action.
You can fake this, with this javascript in the viewer.html, but you can only pinch-to-zoom, but not swipe left/right/up/down.
It's on Android / iOS.

Do you have any idea how to handle a pinch to zoom or generally touch gestures?

<script> let pinchZoomEnabled = false; function enablePinchZoom(pdfViewer) { let startX = 0, startY = 0; let initialPinchDistance = 0; let pinchScale = 1; const viewer = document.getElementById("viewer"); const container = document.getElementById("viewerContainer"); const reset = () => { startX = startY = initialPinchDistance = 0; pinchScale = 1; }; // Prevent native iOS page zoom document.addEventListener("touchmove", (e) => { if (e.scale !== 1) { e.preventDefault(); } }, { passive: false }); viewer.addEventListener("touchstart", (e) => { if (e.touches.length > 1) { startX = (e.touches[0].pageX + e.touches[1].pageX) / 2; startY = (e.touches[0].pageY + e.touches[1].pageY) / 2; initialPinchDistance = Math.hypot((e.touches[1].pageX - e.touches[0].pageX), (e.touches[1].pageY - e.touches[0].pageY)); } else { initialPinchDistance = 0; } }); viewer.addEventListener("touchmove", (e) => { if (initialPinchDistance <= 0 || e.touches.length < 2) { return; } const pinchDistance = Math.hypot((e.touches[1].pageX - e.touches[0].pageX), (e.touches[1].pageY - e.touches[0].pageY)); const originX = startX + container.scrollLeft; const originY = startY + container.scrollTop; pinchScale = pinchDistance / initialPinchDistance; viewer.style.transform = scale(${pinchScale}); viewer.style.transformOrigin = ${originX}px ${originY}px; }); viewer.addEventListener("touchend", (e) => { if (initialPinchDistance <= 0) { return; } viewer.style.transform = none; viewer.style.transformOrigin = unset; PDFViewerApplication.pdfViewer.currentScale *= pinchScale; const rect = container.getBoundingClientRect(); const dx = startX - rect.left; const dy = startY - rect.top; container.scrollLeft += dx * (pinchScale - 1); container.scrollTop += dy * (pinchScale - 1); reset(); }); } document.addEventListener('webviewerloaded', () => { if (!pinchZoomEnabled) { pinchZoomEnabled = true; enablePinchZoom(); } }); </script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.