43 changed files with 1052 additions and 179 deletions
@ -0,0 +1,3 @@ |
|||||||
|
resource pdf.js content/ |
||||||
|
component {d0c5195d-e798-49d4-b1d3-9324328b2291} components/PdfStreamConverter.js |
||||||
|
contract @mozilla.org/streamconv;1?from=application/pdf&to=*/* {d0c5195d-e798-49d4-b1d3-9324328b2291} |
@ -1,27 +0,0 @@ |
|||||||
<?xml version="1.0"?> |
|
||||||
|
|
||||||
#filter substitution |
|
||||||
|
|
||||||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
|
||||||
xmlns:em="http://www.mozilla.org/2004/em-rdf#"> |
|
||||||
|
|
||||||
<Description about="urn:mozilla:install-manifest"> |
|
||||||
<em:id>uriloader@pdf.js</em:id> |
|
||||||
<!-- PDFJS_LOCALIZED_METADATA --> |
|
||||||
<em:name>PDF Viewer</em:name> |
|
||||||
<em:version>PDFJSSCRIPT_VERSION</em:version> |
|
||||||
<em:targetApplication> |
|
||||||
<Description> |
|
||||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> |
|
||||||
<em:minVersion>@FIREFOX_VERSION@</em:minVersion> |
|
||||||
<em:maxVersion>@FIREFOX_VERSION@</em:maxVersion> |
|
||||||
</Description> |
|
||||||
</em:targetApplication> |
|
||||||
<em:strictCompatibility>true</em:strictCompatibility> |
|
||||||
<em:bootstrap>true</em:bootstrap> |
|
||||||
<em:creator>Mozilla</em:creator> |
|
||||||
<em:description>Uses HTML5 to display PDF files directly in Firefox.</em:description> |
|
||||||
<em:homepageURL>https://support.mozilla.org/kb/Opening%20PDF%20files%20within%20Firefox</em:homepageURL> |
|
||||||
<em:type>2</em:type> |
|
||||||
</Description> |
|
||||||
</RDF> |
|
@ -0,0 +1,8 @@ |
|||||||
|
<em:localized> |
||||||
|
<Description> |
||||||
|
<em:locale>cs</em:locale> |
||||||
|
<em:name>PDF Viewer</em:name> |
||||||
|
<em:description>Používá HTML5 pro zobrazení PDF souborů přímo ve Firefoxu.</em:description> |
||||||
|
</Description> |
||||||
|
</em:localized> |
||||||
|
|
@ -0,0 +1,45 @@ |
|||||||
|
bookmark.title=Aktuální zobrazení(zkopírovat nebo otevřít v novém okně) |
||||||
|
previous.title=Předchozí stránka |
||||||
|
next.title=Další stránka |
||||||
|
print.title=Tisk |
||||||
|
download.title=Stáhnout |
||||||
|
zoom_out.title=Zmenšit |
||||||
|
zoom_in.title=Zvětšit |
||||||
|
error_more_info=Více informací |
||||||
|
error_less_info=Méně informací |
||||||
|
error_close=Zavřít |
||||||
|
error_build=PDF.JS Build: {{build}} |
||||||
|
error_message=Zpráva:{{message}} |
||||||
|
error_stack=Stack:{{stack}} |
||||||
|
error_file=Soubor:{{file}} |
||||||
|
error_line=Řádek:{{line}} |
||||||
|
page_scale_width=Šířka stránky |
||||||
|
page_scale_fit=Stránka |
||||||
|
page_scale_auto=Automatické přibližení |
||||||
|
page_scale_actual=Skutečná velikost |
||||||
|
toggle_slider.title=Přepnout posuvník |
||||||
|
thumbs.title=Zobrazit náhledy |
||||||
|
outline.title=Zobrazit osnovu dokumentu |
||||||
|
loading=Načítám... {{percent}}% |
||||||
|
loading_error_indicator=Chyba |
||||||
|
loading_error=Došlo k chybě při načítání PDF. |
||||||
|
rendering_error=Došlo k chybě při vykreslování stránky. |
||||||
|
page_label=Stránka: |
||||||
|
page_of=z{{pageCount}} |
||||||
|
no_outline=Žádné osnovy k dispozici |
||||||
|
open_file.title=Otevřít soubor |
||||||
|
text_annotation_type=[{{type}}Anotace] |
||||||
|
toggle_slider_label=Přepnout posuvník |
||||||
|
thumbs_label=Náhledy |
||||||
|
outline_label=Přehled dokumentu |
||||||
|
bookmark_label=Aktuální zobrazení |
||||||
|
previous_label=Předchozí |
||||||
|
next_label=Další |
||||||
|
print_label=Tisk |
||||||
|
download_label=Stáhnout |
||||||
|
zoom_out_label=Zmenšit |
||||||
|
zoom_in_label=Přiblížit |
||||||
|
zoom.title=Zvětšit |
||||||
|
thumb_page_title=Stránka{{page}} |
||||||
|
thumb_page_canvas=Náhled stránky {{page}} |
||||||
|
request_password=PDF je chráněn heslem: |
@ -0,0 +1,7 @@ |
|||||||
|
<em:localized> |
||||||
|
<Description> |
||||||
|
<em:locale>fr</em:locale> |
||||||
|
<em:name>PDF Viewer</em:name> |
||||||
|
<em:description>Utilise HTML5 pour afficher les documents PDF directement dans Firefox.</em:description> |
||||||
|
</Description> |
||||||
|
</em:localized> |
@ -0,0 +1,8 @@ |
|||||||
|
<em:localized> |
||||||
|
<Description> |
||||||
|
<em:locale>ja</em:locale> |
||||||
|
<em:name>PDF Viewer</em:name> |
||||||
|
<em:description>HTML5を使用して、Firefoxで直接PDFファイルを表示します。</em:description> |
||||||
|
</Description> |
||||||
|
</em:localized> |
||||||
|
|
@ -0,0 +1,45 @@ |
|||||||
|
bookmark.title=現在のビュー (コピーまたは新しいウインドウで開く) |
||||||
|
previous.title=前のページ |
||||||
|
next.title=次のページ |
||||||
|
print.title=印刷 |
||||||
|
download.title=ダウンロード |
||||||
|
zoom_out.title=縮小 |
||||||
|
zoom_in.title=拡大 |
||||||
|
error_more_info=詳細情報 |
||||||
|
error_less_info=詳細情報の非表示 |
||||||
|
error_close=閉じる |
||||||
|
error_build=PDF.JS Build: {{build}} |
||||||
|
error_message=メッセージ: {{message}} |
||||||
|
error_stack=スタック: {{stack}} |
||||||
|
error_file=ファイル: {{file}} |
||||||
|
error_line=ライン: {{line}} |
||||||
|
page_scale_width=幅に合わせる |
||||||
|
page_scale_fit=ページのサイズに合わせる |
||||||
|
page_scale_auto=自動ズーム |
||||||
|
page_scale_actual=実際のサイズ |
||||||
|
toggle_slider.title=サイドバーの切り替え |
||||||
|
thumbs.title=縮小版を表示 |
||||||
|
outline.title=文書の目次を表示 |
||||||
|
loading=読み込み中... {{percent}}% |
||||||
|
loading_error_indicator=エラー |
||||||
|
loading_error=PDFの読み込み中にエラーが発生しました |
||||||
|
rendering_error=ページのレンダリング中にエラーが発生しました |
||||||
|
page_label=ページ: |
||||||
|
page_of=of {{pageCount}} |
||||||
|
no_outline=利用可能な目次はありません |
||||||
|
open_file.title=ファイルを開く |
||||||
|
text_annotation_type=[{{type}} 注釈] |
||||||
|
toggle_slider_label=サイドバーの切り替え |
||||||
|
thumbs_label=縮小版 |
||||||
|
outline_label=文書の目次 |
||||||
|
bookmark_label=現在のビュー |
||||||
|
previous_label=前へ |
||||||
|
next_label=次へ |
||||||
|
print_label=印刷 |
||||||
|
download_label=ダウンロード |
||||||
|
zoom_out_label=縮小 |
||||||
|
zoom_in_label=拡大 |
||||||
|
zoom.title=ズーム |
||||||
|
thumb_page_title=ページ {{page}} |
||||||
|
thumb_page_canvas=ページの縮小版 {{page}} |
||||||
|
request_password=PDFはパスワードによって保護されています |
@ -0,0 +1,8 @@ |
|||||||
|
<em:localized> |
||||||
|
<Description> |
||||||
|
<em:locale>sv</em:locale> |
||||||
|
<em:name>PDF Läsare</em:name> |
||||||
|
<em:description>Använder HTML5 för att visa PDF filer direkt i Firefox.</em:description> |
||||||
|
</Description> |
||||||
|
</em:localized> |
||||||
|
|
@ -0,0 +1,45 @@ |
|||||||
|
bookmark.title=Aktuell vy (visa eller öppna i nytt fönster) |
||||||
|
previous.title=Föregående sida |
||||||
|
next.title=Nästa sida |
||||||
|
print.title=Skriv ut |
||||||
|
download.title=Ladda ner |
||||||
|
zoom_out.title=Zooma ut |
||||||
|
zoom_in.title=Zooma in |
||||||
|
error_more_info=Mer information |
||||||
|
error_less_info=Mindre information |
||||||
|
error_close=Stäng |
||||||
|
error_build=PDF.JS bygge: {{build}} |
||||||
|
error_message=Meddelande: {{message}} |
||||||
|
error_stack=Stack: {{stack}} |
||||||
|
error_file=Fil: {{file}} |
||||||
|
error_line=Rad: {{line}} |
||||||
|
page_scale_width=Sidbredd |
||||||
|
page_scale_fit=Passa sida |
||||||
|
page_scale_auto=Automatisk zoom |
||||||
|
page_scale_actual=Faktisk storlek |
||||||
|
toggle_slider.title=Visa/Dölj panel |
||||||
|
thumbs.title=Visa miniatyrer |
||||||
|
outline.title=Visa dokumentdisposition |
||||||
|
loading=Laddar... {{percent}}% |
||||||
|
loading_error_indicator=Fel |
||||||
|
loading_error=Ett fel inträffade när PDF dokumentet laddades. |
||||||
|
rendering_error=Ett fel inträffade när PDF dokumentet renderades. |
||||||
|
page_label=Sida: |
||||||
|
page_of=av {{pageCount}} |
||||||
|
no_outline=Ingen dokumentdisposition tillgänglig |
||||||
|
open_file.title=Öppna fil |
||||||
|
text_annotation_type=[{{type}} Annotering] |
||||||
|
toggle_slider_label=Visa/Dölj panel |
||||||
|
thumbs_label=Miniatyrer |
||||||
|
outline_label=Disposition |
||||||
|
bookmark_label=Aktuell vy |
||||||
|
previous_label=Föregående |
||||||
|
next_label=Nästa |
||||||
|
print_label=Skriv ut |
||||||
|
download_label=Ladda ner |
||||||
|
zoom_out_label=Zooma ut |
||||||
|
zoom_in_label=Zooma in |
||||||
|
zoom.title=Zooma |
||||||
|
thumb_page_title=Sida {{page}} |
||||||
|
thumb_page_canvas=Miniatyr av sida {{page}} |
||||||
|
request_password=PDF dokumentet är skyddat av ett lösenord: |
@ -0,0 +1,8 @@ |
|||||||
|
<em:localized> |
||||||
|
<Description> |
||||||
|
<em:locale>zh-CN</em:locale> |
||||||
|
<em:name>PDF 查看器</em:name> |
||||||
|
<em:description>使用 HTML5 来支持在 Firefox 中直接显示 PDF 文件。</em:description> |
||||||
|
</Description> |
||||||
|
</em:localized> |
||||||
|
|
@ -0,0 +1,45 @@ |
|||||||
|
bookmark.title=当前视图(复制或在新窗口中打开) |
||||||
|
previous.title=上一页 |
||||||
|
next.title=下一页 |
||||||
|
print.title=打印 |
||||||
|
download.title=下载 |
||||||
|
zoom_out.title=缩小 |
||||||
|
zoom_in.title=放大 |
||||||
|
error_more_info=更多信息 |
||||||
|
error_less_info=更少信息 |
||||||
|
error_close=关闭 |
||||||
|
error_build=PDF.JS Build: {{build}} |
||||||
|
error_message=Message: {{message}} |
||||||
|
error_stack=Stack: {{stack}} |
||||||
|
error_file=File: {{file}} |
||||||
|
error_line=Line: {{line}} |
||||||
|
page_scale_width=适合页宽 |
||||||
|
page_scale_fit=适合页面 |
||||||
|
page_scale_auto=自动缩放 |
||||||
|
page_scale_actual=实际大小 |
||||||
|
toggle_slider.title=切换侧栏 |
||||||
|
thumbs.title=显示缩略图 |
||||||
|
outline.title=显示文档大纲 |
||||||
|
loading=正在载入... {{percent}}% |
||||||
|
loading_error_indicator=错误 |
||||||
|
loading_error=载入PDF时发生错误。 |
||||||
|
rendering_error=呈现页面时发生错误。 |
||||||
|
page_label=页: |
||||||
|
page_of=/ {{pageCount}} |
||||||
|
no_outline=无可用大纲 |
||||||
|
open_file.title=打开文件 |
||||||
|
text_annotation_type=[{{type}} 注解] |
||||||
|
toggle_slider_label=切换侧栏 |
||||||
|
thumbs_label=缩略图 |
||||||
|
outline_label=文档大纲 |
||||||
|
bookmark_label=当前视图 |
||||||
|
previous_label=向上 |
||||||
|
next_label=向下 |
||||||
|
print_label=打印 |
||||||
|
download_label=下载 |
||||||
|
zoom_out_label=缩小 |
||||||
|
zoom_in_label=放大 |
||||||
|
zoom.title=缩放 |
||||||
|
thumb_page_title=页码 {{page}} |
||||||
|
thumb_page_canvas=页面 {{page}} 的缩略图 |
||||||
|
request_password=PDF 被密码保护: |
@ -0,0 +1,8 @@ |
|||||||
|
<em:localized> |
||||||
|
<Description> |
||||||
|
<em:locale>zh-TW</em:locale> |
||||||
|
<em:name>PDF 瀏覽器</em:name> |
||||||
|
<em:description>利用 HTML5 技術在 Firefox 中直接顯示 PDF 格式檔案。</em:description> |
||||||
|
</Description> |
||||||
|
</em:localized> |
||||||
|
|
@ -0,0 +1,45 @@ |
|||||||
|
bookmark.title=目前檢視(複製或在新視窗中開啟) |
||||||
|
previous.title=上一頁 |
||||||
|
next.title=下一頁 |
||||||
|
print.title=列印 |
||||||
|
download.title=下載 |
||||||
|
zoom_out.title=縮小 |
||||||
|
zoom_in.title=放大 |
||||||
|
error_more_info=更多資訊 |
||||||
|
error_less_info=更少資訊 |
||||||
|
error_close=關閉 |
||||||
|
error_build=PDF.JS 版本號: {{build}} |
||||||
|
error_message=錯誤信息: {{message}} |
||||||
|
error_stack=堆疊: {{stack}} |
||||||
|
error_file=檔案: {{file}} |
||||||
|
error_line=行數: {{line}} |
||||||
|
page_scale_width=符合頁寬 |
||||||
|
page_scale_fit=符合頁面 |
||||||
|
page_scale_auto=自動縮放 |
||||||
|
page_scale_actual=實際大小 |
||||||
|
toggle_slider.title=切換側邊欄 |
||||||
|
thumbs.title=顯示縮圖 |
||||||
|
outline.title=顯示文件綱要 |
||||||
|
loading=正在載入... {{percent}}% |
||||||
|
loading_error_indicator=錯誤 |
||||||
|
loading_error=載入PDF檔案時發生錯誤。 |
||||||
|
rendering_error=渲染頁面時發生錯誤。 |
||||||
|
page_label=頁次: |
||||||
|
page_of=, 共 {{pageCount}} 頁 |
||||||
|
no_outline=無可用的綱要 |
||||||
|
open_file.title=開啟檔案 |
||||||
|
text_annotation_type=[{{type}} 註解] |
||||||
|
toggle_slider_label=切換側邊欄 |
||||||
|
thumbs_label=縮圖 |
||||||
|
outline_label=文件綱要 |
||||||
|
bookmark_label=目前檢視 |
||||||
|
previous_label=上一頁 |
||||||
|
next_label=下一頁 |
||||||
|
print_label=列印 |
||||||
|
download_label=下載 |
||||||
|
zoom_out_label=縮小 |
||||||
|
zoom_in_label=放大 |
||||||
|
zoom.title=縮放 |
||||||
|
thumb_page_title=第 {{page}} 頁 |
||||||
|
thumb_page_canvas=第 {{page}} 頁的縮圖 |
||||||
|
request_password=PDF 檔案受密碼保護: |
@ -0,0 +1,21 @@ |
|||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
DEPTH = ../../../.. |
||||||
|
topsrcdir = @top_srcdir@ |
||||||
|
srcdir = @srcdir@ |
||||||
|
VPATH = @srcdir@ |
||||||
|
relativesrcdir = browser/extensions/pdfjs/test |
||||||
|
|
||||||
|
include $(DEPTH)/config/autoconf.mk |
||||||
|
include $(topsrcdir)/config/rules.mk |
||||||
|
|
||||||
|
_BROWSER_TEST_FILES = \
|
||||||
|
head.js \
|
||||||
|
browser_pdfjs_main.js \
|
||||||
|
file_pdfjs_test.pdf \
|
||||||
|
$(NULL) |
||||||
|
|
||||||
|
libs:: $(_BROWSER_TEST_FILES) |
||||||
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) |
@ -0,0 +1,102 @@ |
|||||||
|
/* Any copyright is dedicated to the Public Domain. |
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
*/ |
||||||
|
|
||||||
|
const RELATIVE_DIR = "browser/extensions/pdfjs/test/"; |
||||||
|
const TESTROOT = "http://example.com/browser/" + RELATIVE_DIR; |
||||||
|
|
||||||
|
function test() { |
||||||
|
waitForExplicitFinish(); |
||||||
|
|
||||||
|
var tab = gBrowser.addTab(TESTROOT + "file_pdfjs_test.pdf"); |
||||||
|
var newTabBrowser = gBrowser.getBrowserForTab(tab); |
||||||
|
newTabBrowser.addEventListener("pagechange", function onPageChange() { |
||||||
|
newTabBrowser.removeEventListener("pagechange", onPageChange, true); |
||||||
|
|
||||||
|
var document = newTabBrowser.contentDocument, |
||||||
|
window = newTabBrowser.contentWindow; |
||||||
|
|
||||||
|
//
|
||||||
|
// Overall sanity tests
|
||||||
|
//
|
||||||
|
ok(document.querySelector('div#viewer'), "document content has viewer UI"); |
||||||
|
ok('PDFJS' in window.wrappedJSObject, "window content has PDFJS object"); |
||||||
|
|
||||||
|
//
|
||||||
|
// Sidebar: open
|
||||||
|
//
|
||||||
|
var sidebar = document.querySelector('button#sidebarToggle'), |
||||||
|
outerContainer = document.querySelector('div#outerContainer'); |
||||||
|
|
||||||
|
sidebar.click(); |
||||||
|
ok(outerContainer.classList.contains('sidebarOpen'), 'sidebar opens on click'); |
||||||
|
|
||||||
|
// Thumbnails are created asynchronously - wait for them
|
||||||
|
waitForElement(document, 'canvas#thumbnail2', function(error) { |
||||||
|
if (error) |
||||||
|
finish(); |
||||||
|
|
||||||
|
//
|
||||||
|
// Page change from thumbnail click
|
||||||
|
//
|
||||||
|
var pageNumber = document.querySelector('input#pageNumber'); |
||||||
|
is(parseInt(pageNumber.value), 1, 'initial page is 1'); |
||||||
|
|
||||||
|
var thumbnail = document.querySelector('canvas#thumbnail2'); |
||||||
|
ok(thumbnail, 'thumbnail2 is available'); |
||||||
|
if (thumbnail) { |
||||||
|
thumbnail.click(); |
||||||
|
is(parseInt(pageNumber.value), 2, 'clicking on thumbnail changes page'); |
||||||
|
} |
||||||
|
|
||||||
|
//
|
||||||
|
// Sidebar: close
|
||||||
|
//
|
||||||
|
sidebar.click(); |
||||||
|
ok(!outerContainer.classList.contains('sidebarOpen'), 'sidebar closes on click'); |
||||||
|
|
||||||
|
//
|
||||||
|
// Page change from prev/next buttons
|
||||||
|
//
|
||||||
|
var prevPage = document.querySelector('button#previous'), |
||||||
|
nextPage = document.querySelector('button#next'); |
||||||
|
|
||||||
|
nextPage.click(); |
||||||
|
is(parseInt(pageNumber.value), 2, 'page increases after clicking on next'); |
||||||
|
|
||||||
|
prevPage.click(); |
||||||
|
is(parseInt(pageNumber.value), 1, 'page decreases after clicking on previous'); |
||||||
|
|
||||||
|
//
|
||||||
|
// Bookmark button
|
||||||
|
//
|
||||||
|
var viewBookmark = document.querySelector('a#viewBookmark'); |
||||||
|
viewBookmark.click(); |
||||||
|
ok(viewBookmark.href.length > 0, 'viewBookmark button has href'); |
||||||
|
|
||||||
|
//
|
||||||
|
// Zoom in/out
|
||||||
|
//
|
||||||
|
var zoomOut = document.querySelector('button.zoomOut'), |
||||||
|
zoomIn = document.querySelector('button.zoomIn'); |
||||||
|
|
||||||
|
// Zoom in
|
||||||
|
var oldWidth = document.querySelector('canvas#page1').width; |
||||||
|
zoomIn.click(); |
||||||
|
var newWidth = document.querySelector('canvas#page1').width; |
||||||
|
ok(oldWidth < newWidth, 'zooming in increases page width (old: '+oldWidth+', new: '+newWidth+')'); |
||||||
|
|
||||||
|
// Zoom out
|
||||||
|
var oldWidth = document.querySelector('canvas#page1').width; |
||||||
|
zoomOut.click(); |
||||||
|
var newWidth = document.querySelector('canvas#page1').width; |
||||||
|
ok(oldWidth > newWidth, 'zooming out decreases page width (old: '+oldWidth+', new: '+newWidth+')'); |
||||||
|
|
||||||
|
finish(); |
||||||
|
}); |
||||||
|
}, true, true); |
||||||
|
|
||||||
|
registerCleanupFunction(function() { |
||||||
|
gBrowser.removeTab(tab); |
||||||
|
}); |
||||||
|
} |
Binary file not shown.
@ -0,0 +1,21 @@ |
|||||||
|
// Waits for element 'el' to exist in the DOM of 'doc' before executing 'callback'
|
||||||
|
// Useful when elements are created asynchronously, e.g. after a Web Worker task
|
||||||
|
function waitForElement(doc, el, callback) { |
||||||
|
var time = 0, |
||||||
|
interval = 10, |
||||||
|
timeout = 5000; |
||||||
|
|
||||||
|
var checkEl = setInterval(function() { |
||||||
|
if (doc.querySelector(el)) { |
||||||
|
clearInterval(checkEl); |
||||||
|
if (callback) callback(); |
||||||
|
} |
||||||
|
|
||||||
|
time += interval; |
||||||
|
if (time > timeout) { |
||||||
|
ok(false, 'waitForElement timed out on element: '+el); |
||||||
|
clearInterval(checkEl); |
||||||
|
if (callback) callback(true); |
||||||
|
} |
||||||
|
}, interval); |
||||||
|
} |
@ -0,0 +1 @@ |
|||||||
|
http://is.muni.cz/www/20544/noty/sbm/Taize/Adoramus_te_Christe.pdf |
@ -0,0 +1 @@ |
|||||||
|
http://www.mft-online.de/files/medizinerreport_2012.pdf |
@ -0,0 +1 @@ |
|||||||
|
http://www.lezarts.org/07oforhom/Faitsdivers/Hadopi/Le%20Rapport%20Hadopi,%20Intox.pdf |
After Width: | Height: | Size: 708 B |
Loading…
Reference in new issue