2014-04-14 5 views

답변

0

은 어느 당신은 사용 목적은 최종 사용자의 PDF 리더에서 엽니 다하지만 앱에서 열 필요가 있다면 당신은이 라이브러리 사용할 수 있습니다 https://marketplace.appcelerator.com/apps/6897?restoreSearch=true#!overview

의지 :

try { 
var f = Ti.Filesystem.getFile('your.pdf'); 
Ti.Android.currentActivity.startActivity(Ti.Android.createIntent({ 
    action: Ti.Android.ACTION_VIEW, 
    type: 'application/pdf', 
    data: f.getNativePath() 
})); 
} 
    catch (err) { 
var alertDialog = Titanium.UI.createAlertDialog({ 
    title: 'No PDF Viewer', 
    message: 'We tried to open a PDF but failed. Do you want to search the marketplace for a PDF viewer?', 
    buttonNames: ['Yes','No'], 
    cancel: 1 
}); 
alertDialog.show(); 
alertDialog.addEventListener('click', function(evt) { 
    if (evt.index == 0) { 
     Ti.Platform.openURL('http://search?q=pdf'); 
    } 
}); 

을 }

+0

내 응용 프로그램에서 열어야합니다. 사용할 수있는 무료 모듈이 있습니까? – ggcodes

+0

mupdf는 티타늄과 통합 될 수 있습니까? – ggcodes

+0

iOS 용으로 신경 쓰지 마세요. 쉽게 구현할 수 있도록 Google 문서 뷰어를 사용할 수 있습니다. 로드 된 webview : http://docs.google.com/viewer?url=addresstoyourpdf.pdf –

관련 문제