그들은 또한 PDF 파일을 업로드하고 현재 우리가 blueimp 갤러리에서 미리보기 PDF로 좋은 것 동안 수동으로 열 수 있습니다 .
이 문서에서 나는 그 "쉽게"가 다른 콘텐츠 유형 (들)에 지원을 추가 할 수 있습니다 참조 : 아주 약간의 상상력과
https://github.com/blueimp/Gallery#example-html-text-factory-implementation
... 내가 시도 :
css:
.blueimp-gallery > .slides > .slide > .pdf-content {
overflow: auto;
margin: 60px auto;
padding: 0 60px;
max-width: 1200px;
text-align: left;
color:white;
}
js:
blueimp.Gallery.prototype.applicationFactory = function (obj, callback) {
var $element = $('<div>')
.addClass('pdf-content')
.attr('title', obj.title);
$.get(obj.href)
.done(function (result) {
$element.html(result);
callback({
type: 'load',
target: $element[0]
});
})
.fail(function() {
callback({
type: 'error',
target: $element[0]
});
});
return $element[0];
};
$('#blueimpGallery-button').on('click', function (event) {
blueimp.Gallery([
{
title: 'Test pdf_1',
href: '/docs/test1.pdf',
type: 'application/pdf'
},
{
title: 'Test pdf_2',
href: '/docs/test2.pdf',
type: 'application/x-pdf'
},
{
title: 'Test pdf_3',
href: '/docs/test3.pdf',
type: 'application/x-pdf'
}
]);
})
다소 의외로 .. 실행되지만 pdf는 인식되지 않고 다음과 같이 소스 코드 으로 표시됩니다. 필자는 적어도 그것이 유용하다고 생각할 수 있습니다. mime 형식의 m,하지만 그것을 고칠 수있는 방법을 모르겠다
방향을 제안 할 수 있습니까? 감사합니다.
대신 파일 업로드를 시도하십시오. --- https://blueimp.github.io/jQuery-File-Upload/ – Tasos
죄송합니다. 귀하의 조언을 이해하지 못했습니다 : 파일 업로드에는 악용 될 수있는 숨겨진 기능이 있지만 갤러리에 pdf 파일을 표시해야합니다. – Joe
갤러리에 파일 업로드 파일이 있고 파일을 업로드 할 수도 있습니다. 나는 당신이 그것을 볼 수있는 브라우저를 사용하여 그것을 볼 수있는 PDF를 클릭하면 가정합니다. 어쨌든 나는 당신이 별도로해야 할 것 같아요 2. 갤러리 갤러리에 PDF 파일을 열려면 추가 플러그인이 없다면 이미지 만 볼 수 있습니다. – Tasos