मैं मोबाइल के लिए पीडीएफ ebook आवेदन विकसित करना चाहते हैं। आयनिक ढांचे के लिए पीडीएफ दर्शक घटक है। मैं mozilla pdf.js शौकीन हूँ। मुझे आयनिक परियोजना उदाहरण की आवश्यकता है।आयोनिक ढांचे PdfViewer
उत्तर
आप कोणीय मॉड्यूल ng-pdfviewer की कोशिश की है? चूंकि कोणीय आयनिक के हुड के नीचे काम करता है।
var app = angular.module('testApp', [ 'ngPDFViewer' ]);
app.controller('TestCtrl', [ '$scope', 'PDFViewerService', function($scope, pdf) {
$scope.viewer = pdf.Instance("viewer");
$scope.nextPage = function() {
$scope.viewer.nextPage();
};
$scope.prevPage = function() {
$scope.viewer.prevPage();
};
$scope.pageLoaded = function(curPage, totalPages) {
$scope.currentPage = curPage;
$scope.totalPages = totalPages;
};
}]);
और निर्देशक ऊपर pdf.js फ़ाइल उपयोग करता है और एचटीएमएल bellow है:
<button ng-click="prevPage()"><</button>
<button ng-click="nextPage()">></button>
<br>
<span>{{currentPage}}/{{totalPages}}</span>
<br>
<pdfviewer src="test.pdf" on-page-load='pageLoaded(page,total)' id="viewer"></pdfviewer>
और का उपयोग कर एनजी-पीडीएफ आपकी समस्या का समाधान करना चाहिए।
आप इस Phonegap प्लगइन https://github.com/ti8m/DocumentHandler
की कोशिश की है नीचे मैं इसे कैसे किया जाता है।
$scope.HandleDocumentPlugin = function() {
if (DocumentViewer != null) {
DocumentViewer.previewFileFromUrlOrPath(
function() {
console.log('success');
}, function (error) {
if (error == 53) {
console.log('No app that handles this file type.');
var alert = $ionicPopup.alert({
title: 'Alert!',
template: "There is no app installed that handles this file type."
});
alert.then(function (res) {
});
}
}, $scope.PDF_URL);
}
else if (DocumentHandler != null) {
DocumentHandler.previewFileFromUrlOrPath(
function() {
console.log('success');
}, function (error) {
if (error == 53) {
console.log('No app that handles this file type.');
var alert = $ionicPopup.alert({
title: 'Alert!',
template: "There is no app installed that handles this file type."
});
alert.then(function (res) {
});
}
}, $scope.PDF_URL);
}
else {
console.log("error");
}
}
आप कॉर्डोबा इस्तेमाल कर सकते हैं - InAppBrowser के बाद से यह पीडीएफ प्रदर्शित करने के लिए सिर्फ स्थिर या गतिशील पथ निर्दिष्ट खोलने में सक्षम हो जाएगा। आप इस रूप में अन्य मॉड्यूल जोड़ने के लिए एक भी भी वेब पृष्ठों को खोलने के लिए किया जा आप पीडीएफ उद्घाटन विषय को
https://github.com/initialxy/cordova-plugin-themeablebrowser
इस्तेमाल कर सकते हैं कस्टम लोड हो रहा है यूआरएल आदि क्षेत्रों
इन दो दृष्टिकोण को छिपाने के लिए के लिए की आवश्यकता क्यों है पढ़ने के उद्देश्यों के लिए एक साधारण पीडीएफ दस्तावेज खोलने के लिए इस्तेमाल किया जा सकता है।
लेकिन अधिक विशिष्ट विकल्प के लिए आप
https://github.com/akrennmair/ng-pdfviewer
जो pdf.js और pdf.compat.js की आवश्यकता के साथ जाना चाहिए।
अपने ऐप्लिकेशन में निर्भरता के रूप में जोड़ें।
var app = angular.module('testApp', [ 'ngPDFViewer' ]);
बुनियादी नियंत्रक वाक्य रचना के उपयोग:
app.controller('TestCtrl', [ '$scope', 'PDFViewerService', function($scope,
pdf) {
$scope.viewer = pdf.Instance("viewer");
$scope.nextPage = function() {
$scope.viewer.nextPage();
};
$scope.prevPage = function() {
$scope.viewer.prevPage();
};
$scope.pageLoaded = function(curPage, totalPages) {
$scope.currentPage = curPage;
$scope.totalPages = totalPages;
};
}]);
- 1. आयोनिक ढांचे
- 2. आयोनिक
- 3. खड़ी आयोनिक
- 4. आयोनिक/Cordova menubutton घटना
- 5. स्थिति पट्टी आयोनिक एप्लिकेशन
- 6. बिल्ड आयोनिक आवेदन Crosswalk
- 7. आयोनिक स्क्रॉल तत्व
- 8. Cordova CLI और आयोनिक
- 9. आयोनिक 2 मॉड्यूल 'dgram'
- 10. आयोनिक http पोस्ट
- 11. आयोनिक अनंत स्क्रॉल
- 12. बनाना और आयोनिक
- 13. कैसे कोणीय और आयोनिक
- 14. आयोनिक -3 पाइप
- 15. आयोनिक एंड्रॉयड प्लेटफार्म विफल
- 16. आयोनिक एंड्रॉयड आंतरिक साझा मेमोरी
- 17. आयोनिक 2 एनिमेशन IOS डिवाइस
- 18. आयोनिक 2 परियोजना नहीं चल
- 19. आयोनिक 2 और एनजी मॉडल
- 20. आयोनिक मूल निवासी जियोलोकेशन एंड्रॉयड
- 21. आयोनिक iOS एप्लिकेशन बिल्ड MainController.xib
- 22. आयोनिक 2: स्थानीय सूचना आइकन
- 23. ढांचे
- 24. आयोनिक 3 कड़ी चोट एक ही पृष्ठ
- 25. आयोनिक v3 में HTML सामग्री प्रस्तुत
- 26. आयोनिक 2 लोड हो रहा है नियंत्रक
- 27. आयोनिक 2 देव और उत्पादन वातावरण चर
- 28. त्रुटि रन आईओएस एमुलेटर पर - आयोनिक 3
- 29. त्रुटि: EACCES, अनुमति आयोनिक Cordova आईओएस
- 30. पार्स आयोनिक अनुप्रयोग ऑटो पुश अधिसूचना संभावनाओं