Merge branch 'master' into issue3156

This commit is contained in:
Yury Delendik 2013-04-30 11:09:03 -05:00
commit 34eed81b46
21 changed files with 654 additions and 365 deletions

View File

@ -765,33 +765,28 @@ PdfStreamConverter.prototype = {
// We get the DOM window here instead of before the request since it // We get the DOM window here instead of before the request since it
// may have changed during a redirect. // may have changed during a redirect.
var domWindow = getDOMWindow(channel); var domWindow = getDOMWindow(channel);
// Double check the url is still the correct one. var actions;
if (domWindow.document.documentURIObject.equals(aRequest.URI)) { if (rangeRequest) {
var actions; // We are going to be issuing range requests, so cancel the
if (rangeRequest) { // original request
// We are going to be issuing range requests, so cancel the aRequest.resume();
// original request aRequest.cancel(Cr.NS_BINDING_ABORTED);
aRequest.resume(); actions = new RangedChromeActions(domWindow,
aRequest.cancel(Cr.NS_BINDING_ABORTED); contentDispositionFilename, aRequest);
actions = new RangedChromeActions(domWindow,
contentDispositionFilename, aRequest);
} else {
actions = new StandardChromeActions(
domWindow, contentDispositionFilename, dataListener);
}
var requestListener = new RequestListener(actions);
domWindow.addEventListener(PDFJS_EVENT_ID, function(event) {
requestListener.receive(event);
}, false, true);
if (actions.supportsIntegratedFind()) {
var chromeWindow = getChromeWindow(domWindow);
var findEventManager = new FindEventManager(chromeWindow.gFindBar,
domWindow,
chromeWindow);
findEventManager.bind();
}
} else { } else {
log('Dom window url did not match request url.'); actions = new StandardChromeActions(
domWindow, contentDispositionFilename, dataListener);
}
var requestListener = new RequestListener(actions);
domWindow.addEventListener(PDFJS_EVENT_ID, function(event) {
requestListener.receive(event);
}, false, true);
if (actions.supportsIntegratedFind()) {
var chromeWindow = getChromeWindow(domWindow);
var findEventManager = new FindEventManager(chromeWindow.gFindBar,
domWindow,
chromeWindow);
findEventManager.bind();
} }
listener.onStopRequest(aRequest, context, statusCode); listener.onStopRequest(aRequest, context, statusCode);
} }

View File

@ -1,8 +0,0 @@
<em:localized>
<Description>
<em:locale>es-MX</em:locale>
<em:name>PDF Viewer</em:name>
<em:description>Utiliza HTML5 para mostrar archivos PDF directamente en Firefox.</em:description>
</Description>
</em:localized>

View File

@ -1,121 +0,0 @@
# Copyright 2012 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Main toolbar buttons (tooltips and alt text for images)
previous.title=Página anterior
previous_label=Anterior
next.title=Página siguiente
next_label=Siguiente
# LOCALIZATION NOTE (page_label, page_of):
# These strings are concatenated to form the "Page: X of Y" string.
# Do not translate "{{pageCount}}", it will be substituted with a number
# representing the total number of pages.
page_label=Página:
page_of=of {{pageCount}}
zoom_out.title=Reducir
zoom_out_label=Reducir
zoom_in.title=Aumentar
zoom_in_label=Aumentar
zoom.title=Tamaño
print.title=Imprimir
print_label=Imprimir
presentation_mode.title=Cambiar al modo de presentación
presentation_mode_label=Modo de presentación
open_file.title=Abrir archivo
open_file_label=Abrir
download.title=Descargar
download_label=Descargar
bookmark.title=Vista actual (copiar o abrir en una nueva ventana)
bookmark_label=Vista actual
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
toggle_sidebar.title=Activar barra lateral
toggle_sidebar_label=Activar barra lateral
outline.title=Mostrar el esquema del documento
outline_label=Esquema del documento
thumbs.title=Mostrar miniaturas
thumbs_label=Miniaturas
findbar.title=Buscar en el documento
findbar_label=Buscar
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
thumb_page_title=Página {{page}}
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
# number.
thumb_page_canvas=Miniatura o página {{page}}
# Context menu
first_page.label=Ir a la primera página
last_page.label=Ir a la última página
page_rotate_cw.label=Girar hacia la derecha
page_rotate_ccw.label=Girar hacia la izquierda
# Find panel button title and messages
find_label=Buscar:
find_previous.title=Ir a la anterior frase encontrada
find_previous_label=Anterior
find_next.title=Ir a la siguiente frase encontrada
find_next_label=Siguiente
find_highlight=Marcar todo
find_match_case_label=Coincidir con mayúsculas y minúsculas
find_reached_top=Inicio del documento, se continúa desde el final
find_reached_bottom=Final del documento, se continúa desde el inicio
find_not_found=No se encontró la frase
# Error panel labels
error_more_info=Más información
error_less_info=Menos información
error_close=Cerrar
# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
# replaced by the PDF.JS version and build ID.
error_version_info=PDF.js v{{version}} (compilación: {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
error_message=Mensaje: {{message}}
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
# trace.
error_stack=Pila: {{stack}}
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
error_file=Archivo: {{file}}
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
error_line=Línea: {{line}}
rendering_error=Ocurrió un error al interpretar la página.
# Predefined zoom values
page_scale_width=Ancho de página
page_scale_fit=Ajustar a la página
page_scale_auto=Ampliación automática
page_scale_actual=Tamaño real
# Loading indicator messages
loading_error_indicator=Error
loading_error=Ocurrió un error al cargar el PDF.
invalid_file_error=Archivo PDF inválido o corrupto.
missing_file_error=Archivo PDF faltante.
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
text_annotation_type=[Anotación {{type}}]
request_password=El archivo PDF está protegido por contraseña:
printing_not_supported=Advertencia: la impresión no está completamente soportada en este navegador.
web_fonts_disabled=Las tipografías web están deshabilitadas: no es posible utilizar tipografías PDF incrustadas.

18
l10n/es/chrome.properties Normal file
View File

@ -0,0 +1,18 @@
# Copyright 2012 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Chrome notification bar messages and buttons
unsupported_feature=Es posible que este documento PDF no se muestre correctamente.
open_with_different_viewer=Abrir con un visor diferente
open_with_different_viewer.accessKey=a

View File

@ -1,104 +1,123 @@
# Copyright 2012 Mozilla Foundation # Copyright 2012 Mozilla Foundation
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# Main toolbar buttons (tooltips and alt text for images) # Main toolbar buttons (tooltips and alt text for images)
previous.title=Página anterior previous.title=Página anterior
previous_label=Anterior previous_label=Anterior
next.title=Página siguiente next.title=Página siguiente
next_label=Siguiente next_label=Siguiente
# LOCALIZATION NOTE (page_label, page_of): # LOCALIZATION NOTE (page_label, page_of):
# These strings are concatenated to form the "Page: X of Y" string. # These strings are concatenated to form the "Page: X of Y" string.
# Do not translate "{{pageCount}}", it will be substituted with a number # Do not translate "{{pageCount}}", it will be substituted with a number
# representing the total number of pages. # representing the total number of pages.
page_label=Página: page_label=Página:
page_of=de {{pageCount}} page_of=de {{pageCount}}
zoom_out.title=Reducir zoom_out.title=Reducir
zoom_out_label=Reducir zoom_out_label=Reducir
zoom_in.title=Ampliar zoom_in.title=Aumentar
zoom_in_label=Ampliar zoom_in_label=Aumentar
zoom.title=Ampliación zoom.title=Ampliación
print.title=Imprimir print.title=Imprimir
print_label=Imprimir print_label=Imprimir
fullscreen.title=Pantalla completa presentation_mode.title=Cambiar al modo de presentación
fullscreen_label=Pantalla completa presentation_mode_label=Modo de presentación
open_file.title=Abrir archivo open_file.title=Abrir un archivo
open_file_label=Abrir open_file_label=Abrir
download.title=Descargar download.title=Descargar
download_label=Descargar download_label=Descargar
bookmark.title=Vista actual (copie o abra en una ventana nueva) bookmark.title=Vista actual (copie o abra en una ventana nueva)
bookmark_label=Vista actual bookmark_label=Vista actual
# Tooltips and alt text for side panel toolbar buttons # Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are # (the _label strings are alt text for the buttons, the .title strings are
# tooltips) # tooltips)
toggle_slider.title=Alternar deslizador toggle_sidebar.title=Mostrar u ocultar la barra lateral
toggle_slider_label=Alternar deslizador toggle_sidebar_label=Conmutar la barra lateral
outline.title=Mostrar esquema del documento outline.title=Mostrar el esquema del documento
outline_label=Esquema del documento outline_label=Esquema del documento
thumbs.title=Mostrar miniaturas thumbs.title=Mostrar las miniaturas
thumbs_label=Miniaturas thumbs_label=Miniaturas
findbar.title=Buscar en el documento findbar.title=Buscar en el documento
findbar_label=Buscar findbar_label=Buscar
# Thumbnails panel item (tooltip and alt text for images) # Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page # LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number. # number.
thumb_page_title=Página {{page}} thumb_page_title=Página {{page}}
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page # LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
# number. # number.
thumb_page_canvas=Miniatura de la página {{page}} thumb_page_canvas=Miniatura de la página {{page}}
# Find panel button title and messages # Context menu
find=Buscar first_page.label=Ir a la primera página
find_terms_not_found=(No encontrado) last_page.label=Ir a la última página
page_rotate_cw.label=Girar a la derecha
# Error panel labels page_rotate_ccw.label=Girar a la izquierda
error_more_info=Más información
error_less_info=Menos información # Find panel button title and messages
error_close=Cerrar find_label=Buscar:
# LOCALIZATION NOTE (error_build): "{{build}}" will be replaced by the PDF.JS find_previous.title=Ir a la frase encontrada anterior
# build ID. find_previous_label=Anterior
error_build=Compilación de PDF.JS: {{build}} find_next.title=Ir a la frase encontrada siguiente
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an find_next_label=Siguiente
# english string describing the error. find_highlight=Resaltar todo
error_message=Mensaje: {{message}} find_match_case_label=Coincidir mayúsculas y minúsculas
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack find_reached_top=Se alcanzó el inicio del documento, se continúa desde el final
# trace. find_reached_bottom=Se alcanzó el final del documento, se continúa desde el inicio
error_stack=Pila: {{stack}} find_not_found=No se encontró la frase
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
error_file=Archivo: {{file}} # Error panel labels
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number error_more_info=Más información
error_line=Línea: {{line}} error_less_info=Menos información
rendering_error=Ocurrió un error mientras se renderizaba la página. error_close=Cerrar
# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
# Predefined zoom values # replaced by the PDF.JS version and build ID.
page_scale_width=Anchura de página error_version_info=PDF.js v{{version}} (compilación: {{build}})
page_scale_fit=Ajustar a la página # LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
page_scale_auto=Ampliación automática # english string describing the error.
page_scale_actual=Tamaño real error_message=Mensaje: {{message}}
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
# Loading indicator messages # trace.
loading_error_indicator=Error error_stack=Pila: {{stack}}
loading_error=Ocurrió un error mientras se cargaba el PDF. # LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
error_file=Archivo: {{file}}
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. # LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
# "{{type}}" will be replaced with an annotation type from a list defined in error_line=Línea: {{line}}
# the PDF spec (32000-1:2008 Table 169 Annotation types). rendering_error=Ocurrió un error al renderizar la página.
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
text_annotation_type=[Anotación {{type}}] # Predefined zoom values
request_password=El PDF está protegido con una contraseña: page_scale_width=Anchura de la página
page_scale_fit=Ajustar a la página
printing_not_supported=Aviso: La impresión no es compatible totalmente con este navegador. page_scale_auto=Ampliación automática
page_scale_actual=Tamaño real
# Loading indicator messages
loading_error_indicator=Error
loading_error=Ocurrió un error al cargar el PDF.
invalid_file_error=El archivo PDF no es válido o está dañado.
missing_file_error=Falta el archivo PDF.
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
text_annotation_type=[Anotación {{type}}]
request_password=El archivo PDF está protegido por una contraseña:
printing_not_supported=Aviso: Este navegador no es compatible completamente con la impresión.
printing_not_ready=Aviso: El PDF no se ha cargado completamente para su impresión.
web_fonts_disabled=Se han desactivado los tipos de letra web: no se pueden usar los tipos de letra incrustados en el PDF.
web_colors_disabled=Se han desactivado los colores web.

View File

@ -13,6 +13,6 @@
# limitations under the License. # limitations under the License.
# Chrome notification bar messages and buttons # Chrome notification bar messages and buttons
unsupported_feature=Este documento PDF podría no mostrarse correctamente. unsupported_feature=이 PDF 문서는 제대로 표시되지 않을 수 있습니다.
open_with_different_viewer=Abrir con un lector distinto open_with_different_viewer=다른 뷰어로 열기
open_with_different_viewer.accessKey=o open_with_different_viewer.accessKey=o

8
l10n/ko/metadata.inc Normal file
View File

@ -0,0 +1,8 @@
<em:localized>
<Description>
<em:locale>ko</em:locale>
<em:name>PDF 뷰어</em:name>
<em:description>Firefox가 PDF 파일을 HTML5를 이용하여 직접 보여줍니다.</em:description>
</Description>
</em:localized>

123
l10n/ko/viewer.properties Normal file
View File

@ -0,0 +1,123 @@
# Copyright 2012 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Main toolbar buttons (tooltips and alt text for images)
previous.title=이전 쪽
previous_label=이전
next.title=다음 쪽
next_label=다음
# LOCALIZATION NOTE (page_label, page_of):
# These strings are concatenated to form the "Page: X of Y" string.
# Do not translate "{{pageCount}}", it will be substituted with a number
# representing the total number of pages.
page_label=쪽:
page_of=/ {{pageCount}}
zoom_out.title=축소
zoom_out_label=축소
zoom_in.title=확대
zoom_in_label=확대
zoom.title=확대 비율
print.title=출력
print_label=출력
presentation_mode.title=프레젠테이션 모드로 전환
presentation_mode_label=프레젠테이션 모드
open_file.title=파일 열기
open_file_label=열기
download.title=내려받기
download_label=내려받기
bookmark.title=현 화면 (복사하거나 새 창에서 열기)
bookmark_label=현 화면
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
toggle_sidebar.title=사이드바 보이기/숨기기
toggle_sidebar_label=사이드바 보이기/숨기기
outline.title=문서 개요 보이기
outline_label=문서 개요
thumbs.title=쪽 작게 보기
thumbs_label=쪽 작게 보기
findbar.title=문서 내에서 찾기
findbar_label=찾기
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
thumb_page_title={{page}} 쪽
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
# number.
thumb_page_canvas={{page}}쪽의 썸네일
# Context menu
first_page.label=첫 쪽으로
last_page.label=끝 쪽으로
page_rotate_cw.label=시계방향 회전
page_rotate_ccw.label=반시계방향 회전
# Find panel button title and messages
find_label=찾기:
find_previous.title=이전 구절 찾기
find_previous_label=이전
find_next.title=다음 구절 찾기
find_next_label=다음
find_highlight=모두 강조
find_match_case_label=대/소문자까지 정확히
find_reached_top=문서의 처음, 끝에서부터 계속
find_reached_bottom=문서의 끝, 처음에서부터 계속
find_not_found=구절을 찾을 수 없습니다
# Error panel labels
error_more_info=더 보기
error_less_info=간략히
error_close=닫기
# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
# replaced by the PDF.JS version and build ID.
error_version_info=PDF.js v{{version}} (build: {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
error_message=메시지: {{message}}
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
# trace.
error_stack=스택: {{stack}}
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
error_file=파일: {{file}}
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
error_line=행: {{line}}
rendering_error=쪽 렌더링 중 오류가 발생했습니다.
# Predefined zoom values
page_scale_width=너비 맞춤
page_scale_fit=쪽 맞춤
page_scale_auto=자동 맞춤
page_scale_actual=실제 크기
# Loading indicator messages
loading_error_indicator=오류
loading_error=PDF를 불러오던 중 오류가 발생했습니다.
invalid_file_error=PDF 파일이 아니거나 깨진 파일입니다.
missing_file_error=PDF 파일이 없습니다.
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
text_annotation_type=[{{type}} Annotation]
request_password=암호로 보호되는 PDF파일입니다:
printing_not_supported=경고: 이 브라우져는 출력을 완전히는 지원하지 않습니다.
printing_not_ready=경고: 이 PDF 파일은 완전히 적재되지 않았습니다.
web_fonts_disabled=웹 폰트 사용이 비활성되었습니다: 내장 PDF 폰트를 사용할 수 없습니다.
web_colors_disabled=웹 컬러가 비활성되었습니다.

18
l10n/vi/chrome.properties Normal file
View File

@ -0,0 +1,18 @@
# Copyright 2012 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Chrome notification bar messages and buttons
unsupported_feature=Tài liệu PDF có thể hiện thị không chính xác.
open_with_different_viewer=Mở với chương trình xem khác
open_with_different_viewer.accessKey=o

8
l10n/vi/metadata.inc Normal file
View File

@ -0,0 +1,8 @@
<em:localized>
<Description>
<em:locale>vi-VN</em:locale>
<em:name>Trình Xem PDF</em:name>
<em:description>Dùng HTML5 để hiện trị PDF trực giao trên FireFox.</em:description>
</Description>
</em:localized>

123
l10n/vi/viewer.properties Normal file
View File

@ -0,0 +1,123 @@
# Copyright 2012 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Main toolbar buttons (tooltips and alt text for images)
previous.title=Trang Trước
previous_label=Trước
next.title=Trang Tiếp
next_label=Tiếp
# LOCALIZATION NOTE (page_label, page_of):
# These strings are concatenated to form the "Page: X of Y" string.
# Do not translate "{{pageCount}}", it will be substituted with a number
# representing the total number of pages.
page_label=Trang:
page_of=trên {{pageCount}}
zoom_out.title=Phóng to
zoom_out_label=Phóng to
zoom_in.title=Thu nhỏ
zoom_in_label=Thu nhỏ
zoom.title=Thu phóng
print.title=In
print_label=In
presentation_mode.title=Chuyển sang chế độ thuyết trình
presentation_mode_label=Chế độ Thuyết trình
open_file.title=Mở Tệp
open_file_label=Tệp
download.title=Tải xuống
download_label=Tải xuống
bookmark.title=Đánh dấu (sao chép hoặc mở cửa sổ mới)
bookmark_label=Đánh dấu
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
toggle_sidebar.title=Đóng bật thanh lề
toggle_sidebar_label=Bật tắt thanh lề
outline.title=Hiện thị giản lược tài liệu
outline_label=Giản lược
thumbs.title=hiện tài liệu ở dạng ảnh thu nhỏ
thumbs_label=Ảnh thu nhỏ
findbar.title=Tìm trong văn bản
findbar_label=Tìm kiếm
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
thumb_page_title=Page {{page}}
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
# number.
thumb_page_canvas=Thumbnail of Page {{page}}
# Context menu
first_page.label=Đến trang đầu tiên
last_page.label=Đến trang cuối cùng
page_rotate_cw.label=Quay sang phải
page_rotate_ccw.label=Quay sang trái
# Find panel button title and messages
find_label=Tìm:
find_previous.title=Tìm kiếm câu xuất hiện phía trước
find_previous_label=Về trước
find_next.title=Tìm kiếm câu xuất hiện phía sau
find_next_label=Tiếp theo
find_highlight=Tô sáng toàn bộ
find_match_case_label=Giống chữ
find_reached_top=Đến cuối đầu tài liệu, tiếp tục từ cuối
find_reached_bottom=Đến cuối tài liệu, tiếp tục từ đầu
find_not_found=Không tìm thấy
# Error panel labels
error_more_info=Thông tim thêm
error_less_info=Thông tin giản lược
error_close=Đóng
# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
# replaced by the PDF.JS version and build ID.
error_version_info=PDF.js v{{version}} (dịch: {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
error_message=Thông báo: {{message}}
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
# trace.
error_stack=Ngăn xếp: {{stack}}
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
error_file=Tệp: {{file}}
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
error_line=Dòng: {{line}}
rendering_error=An error occurred while rendering the page.
# Predefined zoom values
page_scale_width=Ngang
page_scale_fit=Xem Toàn Trang
page_scale_auto=Tự Động
page_scale_actual=Kích thước thực
# Loading indicator messages
loading_error_indicator=Lỗi
loading_error=Lỗi khi mở tệp PDF.
invalid_file_error=Tệp PDF bị hỏng hoặc lỗi.
missing_file_error=Thiếu tệp tin PDF.
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
text_annotation_type=[{{type}} Đánh dấu]
request_password=PDF được bảo vệ bởi mật mã:
printing_not_supported=Chú ý: Công việc in ẩn không được hỗ trợ bởi trình duyệt.
printing_not_ready=Chú ý: Tệp PDF không sẵn sàng cho in ấn.
web_fonts_disabled=Phồng chữ cho Web bị vô tác dụng: không thể dùng phông chữ kèm theo tệp PDF.
web_colors_disabled=Màu cho Wev bị vô tác dụng.

View File

@ -16,7 +16,7 @@
*/ */
/* globals ColorSpace, DeviceCmykCS, DeviceGrayCS, DeviceRgbCS, error, /* globals ColorSpace, DeviceCmykCS, DeviceGrayCS, DeviceRgbCS, error,
FONT_IDENTITY_MATRIX, IDENTITY_MATRIX, ImageData, isArray, isNum, FONT_IDENTITY_MATRIX, IDENTITY_MATRIX, ImageData, isArray, isNum,
isString, Pattern, TilingPattern, TODO, Util, warn, assert */ isString, Pattern, TilingPattern, TODO, Util, warn, assert, info */
'use strict'; 'use strict';
@ -1401,7 +1401,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
// - remove background color: // - remove background color:
// colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew) // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew)
if (!group.isolated) { if (!group.isolated) {
TODO('Support non-isolated groups.'); info('TODO: Support non-isolated groups.');
} }
// TODO knockout - supposedly possible with the clever use of compositing // TODO knockout - supposedly possible with the clever use of compositing
@ -1422,9 +1422,10 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
group.bbox, group.bbox,
currentCtx.mozCurrentTransform); currentCtx.mozCurrentTransform);
// Use ceil in case we're between sizes so we don't create canvas that is // Use ceil in case we're between sizes so we don't create canvas that is
// too small. // too small and make the canvas at least 1x1 pixels.
var drawnWidth = Math.ceil(bounds[2] - bounds[0]); var drawnWidth = Math.max(Math.ceil(bounds[2] - bounds[0]), 1);
var drawnHeight = Math.ceil(bounds[3] - bounds[1]); var drawnHeight = Math.max(Math.ceil(bounds[3] - bounds[1]), 1);
var scratchCanvas = createScratchCanvas(drawnWidth, drawnHeight); var scratchCanvas = createScratchCanvas(drawnWidth, drawnHeight);
var groupCtx = scratchCanvas.getContext('2d'); var groupCtx = scratchCanvas.getContext('2d');
addContextCurrentTransform(groupCtx); addContextCurrentTransform(groupCtx);

View File

@ -1532,7 +1532,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var fontNameStr = fontName && fontName.name; var fontNameStr = fontName && fontName.name;
var baseFontStr = baseFont && baseFont.name; var baseFontStr = baseFont && baseFont.name;
if (fontNameStr !== baseFontStr) { if (fontNameStr !== baseFontStr) {
warn('The FontDescriptor\'s FontName is "' + fontNameStr + info('The FontDescriptor\'s FontName is "' + fontNameStr +
'" but should be the same as the Font\'s BaseFont "' + '" but should be the same as the Font\'s BaseFont "' +
baseFontStr + '"'); baseFontStr + '"');
} }

View File

@ -17,7 +17,7 @@
/* globals assert, bytesToString, CIDToUnicodeMaps, error, ExpertCharset, /* globals assert, bytesToString, CIDToUnicodeMaps, error, ExpertCharset,
ExpertSubsetCharset, FileReaderSync, globalScope, GlyphsUnicode, ExpertSubsetCharset, FileReaderSync, globalScope, GlyphsUnicode,
info, isArray, isNum, ISOAdobeCharset, isWorker, PDFJS, Stream, info, isArray, isNum, ISOAdobeCharset, isWorker, PDFJS, Stream,
stringToBytes, TextDecoder, TODO, warn, Lexer */ stringToBytes, TextDecoder, TODO, warn, Lexer, Util */
'use strict'; 'use strict';
@ -3647,80 +3647,144 @@ var Font = (function FontClosure() {
var TTOpsStackDeltas = [ var TTOpsStackDeltas = [
0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5,
-1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1,
1, -1, -999, 0, 1, 0, 0, -2, 0, -1, -2, -1, -999, -999, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1,
0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -2, 0, -2, -2, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -2, 0, -2, -2,
0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1,
-1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1,
-1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1,
-999, -2, -2, 0, 0, -1, -2, -2, 0, -999, 0, 0, 0, -1, -2]; -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2];
// 0xC0-DF == -1 and 0xE0-FF == -2 // 0xC0-DF == -1 and 0xE0-FF == -2
function sanitizeTTProgram(table, ttContext) { function sanitizeTTProgram(table, ttContext) {
var data = table.data; var data = table.data;
var i = 0, n, lastEndf = 0, lastDeff = 0; var i = 0, n, lastEndf = 0, lastDeff = 0;
var stack = []; var stack = [];
var callstack = [];
var functionsCalled = [];
var tooComplexToFollowFunctions = var tooComplexToFollowFunctions =
ttContext.tooComplexToFollowFunctions; ttContext.tooComplexToFollowFunctions;
var inFDEF = false, ifLevel = 0, inELSE = 0;
for (var ii = data.length; i < ii;) { for (var ii = data.length; i < ii;) {
var op = data[i++]; var op = data[i++];
// The TrueType instruction set docs can be found at // The TrueType instruction set docs can be found at
// https://developer.apple.com/fonts/TTRefMan/RM05/Chap5.html // https://developer.apple.com/fonts/TTRefMan/RM05/Chap5.html
if (op === 0x40) { // NPUSHB - pushes n bytes if (op === 0x40) { // NPUSHB - pushes n bytes
n = data[i++]; n = data[i++];
for (var j = 0; j < n; j++) { if (inFDEF || inELSE) {
stack.push(data[i++]); i += n;
} else {
for (var j = 0; j < n; j++) {
stack.push(data[i++]);
}
} }
} else if (op === 0x41) { // NPUSHW - pushes n words } else if (op === 0x41) { // NPUSHW - pushes n words
n = data[i++]; n = data[i++];
for (var j = 0; j < n; j++) { if (inFDEF || inELSE) {
var b = data[i++]; i += n * 2;
stack.push((b << 8) | data[i++]); } else {
for (var j = 0; j < n; j++) {
var b = data[i++];
stack.push((b << 8) | data[i++]);
}
} }
} else if ((op & 0xF8) === 0xB0) { // PUSHB - pushes bytes } else if ((op & 0xF8) === 0xB0) { // PUSHB - pushes bytes
n = op - 0xB0 + 1; n = op - 0xB0 + 1;
for (var j = 0; j < n; j++) { if (inFDEF || inELSE) {
stack.push(data[i++]); i += n;
} else {
for (var j = 0; j < n; j++) {
stack.push(data[i++]);
}
} }
} else if ((op & 0xF8) === 0xB8) { // PUSHW - pushes words } else if ((op & 0xF8) === 0xB8) { // PUSHW - pushes words
n = op - 0xB8 + 1; n = op - 0xB8 + 1;
for (var j = 0; j < n; j++) { if (inFDEF || inELSE) {
var b = data[i++]; i += n * 2;
stack.push((b << 8) | data[i++]); } else {
for (var j = 0; j < n; j++) {
var b = data[i++];
stack.push((b << 8) | data[i++]);
}
} }
} else if (op === 0x2B && !tooComplexToFollowFunctions) { // CALL } else if (op === 0x2B && !tooComplexToFollowFunctions) { // CALL
// collecting inforamtion about which functions are used if (!inFDEF && !inELSE) {
var funcId = stack[stack.length - 1]; // collecting inforamtion about which functions are used
ttContext.functionsUsed[funcId] = true; var funcId = stack[stack.length - 1];
if (i >= 2 && data[i - 2] === 0x2B) { ttContext.functionsUsed[funcId] = true;
// all data in stack, calls are performed in sequence if (funcId in ttContext.functionsStackDeltas) {
tooComplexToFollowFunctions = true; stack.length += ttContext.functionsStackDeltas[funcId];
} else if (funcId in ttContext.functionsDefined &&
functionsCalled.indexOf(funcId) < 0) {
callstack.push({data: data, i: i, stackTop: stack.length - 1});
functionsCalled.push(funcId);
var pc = ttContext.functionsDefined[funcId];
data = pc.data;
i = pc.i;
}
} }
} else if (op === 0x2C && !tooComplexToFollowFunctions) { // FDEF } else if (op === 0x2C && !tooComplexToFollowFunctions) { // FDEF
// collecting inforamtion about which functions are defined if (inFDEF || inELSE) {
lastDeff = i; warn('TT: nested FDEFs not allowed');
var funcId = stack[stack.length - 1];
ttContext.functionsDefined[funcId] = true;
if (i >= 2 && data[i - 2] === 0x2D) {
// all function ids in stack, FDEF/ENDF perfomed in sequence
tooComplexToFollowFunctions = true; tooComplexToFollowFunctions = true;
} }
inFDEF = true;
// collecting inforamtion about which functions are defined
lastDeff = i;
var funcId = stack.pop();
ttContext.functionsDefined[funcId] = {data: data, i: i};
} else if (op === 0x2D) { // ENDF - end of function } else if (op === 0x2D) { // ENDF - end of function
lastEndf = i; if (inFDEF) {
inFDEF = false;
lastEndf = i;
} else {
var pc = callstack.pop();
var funcId = functionsCalled.pop();
data = pc.data;
i = pc.i;
ttContext.functionsStackDeltas[funcId] =
stack.length - pc.stackTop;
}
} else if (op === 0x89) { // IDEF - instruction definition } else if (op === 0x89) { // IDEF - instruction definition
if (inFDEF || inELSE) {
warn('TT: nested IDEFs not allowed');
tooComplexToFollowFunctions = true;
}
inFDEF = true;
// recording it as a function to track ENDF // recording it as a function to track ENDF
lastDeff = i; lastDeff = i;
} else if (op === 0x58) { // IF
++ifLevel;
} else if (op === 0x1B) { // ELSE
inELSE = ifLevel;
} else if (op === 0x59) { // EIF
if (inELSE === ifLevel) {
inELSE = 0;
}
--ifLevel;
} else if (op === 0x1C) { // JMPR
var offset = stack[stack.length - 1];
// only jumping forward to prevent infinite loop
if (offset > 0) { i += offset - 1; }
} }
// Adjusting stack not extactly, but just enough to get function id // Adjusting stack not extactly, but just enough to get function id
var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : if (!inFDEF && !inELSE) {
op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] :
while (stackDelta < 0 && stack.length > 0) { op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0;
stack.pop(); if (op >= 0x71 && op <= 0x75) {
stackDelta++; n = stack.pop();
} if (n === n) {
while (stackDelta > 0) { stackDelta = -n * 2;
stack.push(NaN); // pushing any number into stack }
stackDelta--; }
while (stackDelta < 0 && stack.length > 0) {
stack.pop();
stackDelta++;
}
while (stackDelta > 0) {
stack.push(NaN); // pushing any number into stack
stackDelta--;
}
} }
} }
ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions;
@ -3729,20 +3793,44 @@ var Font = (function FontClosure() {
content.push(new Uint8Array(i - data.length)); content.push(new Uint8Array(i - data.length));
} }
if (lastDeff > lastEndf) { if (lastDeff > lastEndf) {
warn('TT: complementing a missing function tail');
// new function definition started, but not finished // new function definition started, but not finished
// complete function by [CLEAR, ENDF] // complete function by [CLEAR, ENDF]
content.push(new Uint8Array([0x22, 0x2D])); content.push(new Uint8Array([0x22, 0x2D]));
} }
if (ttContext.defineMissingFunctions && !tooComplexToFollowFunctions) { foldTTTable(table, content);
}
function addTTDummyFunctions(table, ttContext, maxFunctionDefs) {
var content = [table.data];
if (!ttContext.tooComplexToFollowFunctions) {
var undefinedFunctions = [];
for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) {
if (!ttContext.functionsUsed[j] || ttContext.functionsDefined[j]) { if (!ttContext.functionsUsed[j] || ttContext.functionsDefined[j]) {
continue; continue;
} }
undefinedFunctions.push(j);
if (j >= maxFunctionDefs) {
continue;
}
// function is used, but not defined // function is used, but not defined
// creating empty one [PUSHB, function-id, FDEF, ENDF] if (j < 256) {
content.push(new Uint8Array([0xB0, j, 0x2C, 0x2D])); // creating empty one [PUSHB, function-id, FDEF, ENDF]
content.push(new Uint8Array([0xB0, j, 0x2C, 0x2D]));
} else {
// creating empty one [PUSHW, function-id, FDEF, ENDF]
content.push(
new Uint8Array([0xB8, j >> 8, j & 255, 0x2C, 0x2D]));
}
}
if (undefinedFunctions.length > 0) {
warn('TT: undefined functions: ' + undefinedFunctions);
} }
} }
foldTTTable(table, content);
}
function foldTTTable(table, content) {
if (content.length > 1) { if (content.length > 1) {
// concatenating the content items // concatenating the content items
var newLength = 0; var newLength = 0;
@ -3765,15 +3853,17 @@ var Font = (function FontClosure() {
var ttContext = { var ttContext = {
functionsDefined: [], functionsDefined: [],
functionsUsed: [], functionsUsed: [],
functionsStackDeltas: [],
tooComplexToFollowFunctions: false tooComplexToFollowFunctions: false
}; };
if (fpgm) {
sanitizeTTProgram(fpgm, ttContext);
}
if (prep) { if (prep) {
// collecting prep functions info first
sanitizeTTProgram(prep, ttContext); sanitizeTTProgram(prep, ttContext);
} }
if (fpgm) { if (fpgm) {
ttContext.defineMissingFunctions = true; addTTDummyFunctions(fpgm, ttContext, maxFunctionDefs);
sanitizeTTProgram(fpgm, ttContext);
} }
} }
@ -3843,12 +3933,17 @@ var Font = (function FontClosure() {
// Ensure the hmtx table contains the advance width and // Ensure the hmtx table contains the advance width and
// sidebearings information for numGlyphs in the maxp table // sidebearings information for numGlyphs in the maxp table
font.pos = (font.start || 0) + maxp.offset; font.pos = (font.start || 0) + maxp.offset;
var version = int16(font.getBytes(4)); var version = int32(font.getBytes(4));
var numGlyphs = int16(font.getBytes(2)); var numGlyphs = int16(font.getBytes(2));
var maxFunctionDefs = 0;
if (version >= 0x00010000 && maxp.length >= 22) {
font.pos += 14;
var maxFunctionDefs = int16(font.getBytes(2));
}
sanitizeMetrics(font, hhea, hmtx, numGlyphs); sanitizeMetrics(font, hhea, hmtx, numGlyphs);
sanitizeTTPrograms(fpgm, prep); sanitizeTTPrograms(fpgm, prep, maxFunctionDefs);
if (head) { if (head) {
sanitizeHead(head, numGlyphs, loca.length); sanitizeHead(head, numGlyphs, loca.length);
@ -6696,6 +6791,33 @@ var CFFCompiler = (function CFFCompilerClosure() {
var nameIndex = this.compileNameIndex(cff.names); var nameIndex = this.compileNameIndex(cff.names);
output.add(nameIndex); output.add(nameIndex);
if (cff.isCIDFont) {
// The spec is unclear on how font matrices should relate to each other
// when there is one in the main top dict and the sub top dicts.
// Windows handles this differently than linux and osx so we have to
// normalize to work on all.
// Rules based off of some mailing list discussions:
// - If main font has a matrix and subfont doesn't, use the main matrix.
// - If no main font matrix and there is a subfont matrix, use the
// subfont matrix.
// - If both have matrices, concat together.
// - If neither have matrices, use default.
// To make this work on all platforms we move the top matrix into each
// sub top dict and concat if necessary.
if (cff.topDict.hasName('FontMatrix')) {
var base = cff.topDict.getByName('FontMatrix');
cff.topDict.removeByName('FontMatrix');
for (var i = 0, ii = cff.fdArray.length; i < ii; i++) {
var subDict = cff.fdArray[i];
var matrix = base.slice(0);
if (subDict.hasName('FontMatrix')) {
matrix = Util.transform(matrix, subDict.getByName('FontMatrix'));
}
subDict.setByName('FontMatrix', matrix);
}
}
}
var compiled = this.compileTopDicts([cff.topDict], var compiled = this.compileTopDicts([cff.topDict],
output.length, output.length,
cff.isCIDFont); cff.isCIDFont);

View File

@ -33,10 +33,6 @@
// // TODO(mack): dump() doesn't seem to work here... // // TODO(mack): dump() doesn't seem to work here...
// dump(msg + '\n'); // dump(msg + '\n');
//} //}
//#else
function log(aMsg) {
console.log(aMsg);
}
//#endif //#endif
var NetworkManager = (function NetworkManagerClosure() { var NetworkManager = (function NetworkManagerClosure() {

View File

@ -262,6 +262,18 @@ var Util = PDFJS.Util = (function UtilClosure() {
return Util.makeCssCmyk(cmyk); return Util.makeCssCmyk(cmyk);
}; };
// Concatenates two transformation matrices together and returns the result.
Util.transform = function Util_transform(m1, m2) {
return [
m1[0] * m2[0] + m1[2] * m2[1],
m1[1] * m2[0] + m1[3] * m2[1],
m1[0] * m2[2] + m1[2] * m2[3],
m1[1] * m2[2] + m1[3] * m2[3],
m1[0] * m2[4] + m1[2] * m2[5] + m1[4],
m1[1] * m2[4] + m1[3] * m2[5] + m1[5]
];
};
// For 2d affine transforms // For 2d affine transforms
Util.applyTransform = function Util_applyTransform(p, m) { Util.applyTransform = function Util_applyTransform(p, m) {
var xt = p[0] * m[0] + p[1] * m[2] + m[4]; var xt = p[0] * m[0] + p[1] * m[2] + m[4];

BIN
test/pdfs/issue3061.pdf Normal file

Binary file not shown.

View File

@ -906,6 +906,13 @@
"lastPage": 4, "lastPage": 4,
"type": "load" "type": "load"
}, },
{ "id": "issue3061",
"file": "pdfs/issue3061.pdf",
"md5": "696a7cb1b194d095ca3f7861779a606b",
"rounds": 1,
"type": "eq",
"about": "CFF CID font with font matrices in main top dict and sub top dict."
},
{ "id": "issue1878", { "id": "issue1878",
"file": "pdfs/issue1878.pdf", "file": "pdfs/issue1878.pdf",
"md5": "b4fb0ce7c19368e7104dce3d0d34bcb3", "md5": "b4fb0ce7c19368e7104dce3d0d34bcb3",

View File

@ -256,14 +256,7 @@ html[dir='rtl'] #sidebarContent {
#toolbarSidebar { #toolbarSidebar {
width: 200px; width: 200px;
height: 32px; height: 32px;
background-image: url(images/texture.png), background-color: #424242; /* fallback */
-webkit-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95));
background-image: url(images/texture.png),
-moz-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95));
background-image: url(images/texture.png),
-ms-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95));
background-image: url(images/texture.png),
-o-linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95));
background-image: url(images/texture.png), background-image: url(images/texture.png),
linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95)); linear-gradient(hsla(0,0%,30%,.99), hsla(0,0%,25%,.95));
box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25),
@ -275,15 +268,8 @@ html[dir='rtl'] #sidebarContent {
#toolbarContainer, .findbar { #toolbarContainer, .findbar {
position: relative; position: relative;
background-color: #474747; /* IE9 */ height: 32px;
background-image: url(images/texture.png), background-color: #474747; /* fallback */
-webkit-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95));
background-image: url(images/texture.png),
-moz-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95));
background-image: url(images/texture.png),
-ms-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95));
background-image: url(images/texture.png),
-o-linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95));
background-image: url(images/texture.png), background-image: url(images/texture.png),
linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95)); linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95));
box-shadow: inset 1px 0 0 hsla(0,0%,100%,.08), box-shadow: inset 1px 0 0 hsla(0,0%,100%,.08),
@ -358,10 +344,7 @@ html[dir='rtl'] #sidebarContent {
height: 100%; height: 100%;
width: 50px; width: 50px;
background-image: -moz-linear-gradient(left, #999 0%, #fff 50%, #999 100%); background-image: linear-gradient(to right, #999 0%, #fff 50%, #999 100%);
background-image: -ms-linear-gradient(left, #999 0%, #fff 50%, #999 100%);
background-image: -webkit-linear-gradient(left, #999 0%, #fff 50%, #999 100%);
background-image: linear-gradient(left, #999 0%, #fff 50%, #999 100%);
background-size: 100% 100% no-repeat; background-size: 100% 100% no-repeat;
-moz-animation: progressIndeterminate 2s linear infinite; -moz-animation: progressIndeterminate 2s linear infinite;
@ -540,10 +523,6 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton {
.splitToolbarButton.toggled > .toolbarButton, .splitToolbarButton.toggled > .toolbarButton,
.toolbarButton.textButton { .toolbarButton.textButton {
background-color: hsla(0,0%,0%,.12); background-color: hsla(0,0%,0%,.12);
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-clip: padding-box; background-clip: padding-box;
border: 1px solid hsla(0,0%,0%,.35); border: 1px solid hsla(0,0%,0%,.35);
@ -678,10 +657,6 @@ html[dir='rtl'] .dropdownToolbarButton {
.toolbarButton:focus, .toolbarButton:focus,
.dropdownToolbarButton { .dropdownToolbarButton {
background-color: hsla(0,0%,0%,.12); background-color: hsla(0,0%,0%,.12);
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-clip: padding-box; background-clip: padding-box;
border: 1px solid hsla(0,0%,0%,.35); border: 1px solid hsla(0,0%,0%,.35);
@ -694,10 +669,6 @@ html[dir='rtl'] .dropdownToolbarButton {
.toolbarButton:hover:active, .toolbarButton:hover:active,
.dropdownToolbarButton:hover:active { .dropdownToolbarButton:hover:active {
background-color: hsla(0,0%,0%,.2); background-color: hsla(0,0%,0%,.2);
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.4) hsla(0,0%,0%,.45); border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.4) hsla(0,0%,0%,.45);
box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset,
@ -723,10 +694,6 @@ html[dir='rtl'] .dropdownToolbarButton {
.toolbarButton.toggled, .toolbarButton.toggled,
.splitToolbarButton.toggled > .toolbarButton.toggled { .splitToolbarButton.toggled > .toolbarButton.toggled {
background-color: hsla(0,0%,0%,.3); background-color: hsla(0,0%,0%,.3);
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.45) hsla(0,0%,0%,.5); border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.45) hsla(0,0%,0%,.5);
box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset, box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset,
@ -958,7 +925,7 @@ html[dir='rtl'] .toolbarButton.pageDown::before {
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 2px; border-radius: 2px;
background-color: hsla(0,0%,100%,.09); background-color: hsla(0,0%,100%,.09);
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-clip: padding-box; background-clip: padding-box;
border: 1px solid hsla(0,0%,0%,.35); border: 1px solid hsla(0,0%,0%,.35);
border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42);
@ -1055,7 +1022,7 @@ a:focus > .thumbnail > .thumbnailSelectionRing > .thumbnailImage,
a:focus > .thumbnail > .thumbnailSelectionRing, a:focus > .thumbnail > .thumbnailSelectionRing,
.thumbnail:hover > .thumbnailSelectionRing { .thumbnail:hover > .thumbnailSelectionRing {
background-color: hsla(0,0%,100%,.15); background-color: hsla(0,0%,100%,.15);
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-clip: padding-box; background-clip: padding-box;
box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset,
0 0 1px hsla(0,0%,100%,.2) inset, 0 0 1px hsla(0,0%,100%,.2) inset,
@ -1070,7 +1037,7 @@ a:focus > .thumbnail > .thumbnailSelectionRing,
.thumbnail.selected > .thumbnailSelectionRing { .thumbnail.selected > .thumbnailSelectionRing {
background-color: hsla(0,0%,100%,.3); background-color: hsla(0,0%,100%,.3);
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-clip: padding-box; background-clip: padding-box;
box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset,
0 0 1px hsla(0,0%,100%,.1) inset, 0 0 1px hsla(0,0%,100%,.1) inset,
@ -1121,7 +1088,7 @@ html[dir='rtl'] .outlineItem > a {
.outlineItem > a:hover { .outlineItem > a:hover {
background-color: hsla(0,0%,100%,.02); background-color: hsla(0,0%,100%,.02);
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-clip: padding-box; background-clip: padding-box;
box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset,
0 0 1px hsla(0,0%,100%,.2) inset, 0 0 1px hsla(0,0%,100%,.2) inset,
@ -1131,7 +1098,7 @@ html[dir='rtl'] .outlineItem > a {
.outlineItem.selected { .outlineItem.selected {
background-color: hsla(0,0%,100%,.08); background-color: hsla(0,0%,100%,.08);
background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-clip: padding-box; background-clip: padding-box;
box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset, box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset,
0 0 1px hsla(0,0%,100%,.1) inset, 0 0 1px hsla(0,0%,100%,.1) inset,

View File

@ -76,7 +76,7 @@ limitations under the License.
<script type="text/javascript" src="viewer.js"></script> <script type="text/javascript" src="viewer.js"></script>
</head> </head>
<body> <body tabindex="1">
<div id="outerContainer" class="loadingInProgress"> <div id="outerContainer" class="loadingInProgress">
<div id="sidebarContainer"> <div id="sidebarContainer">
@ -212,7 +212,7 @@ limitations under the License.
data-l10n-id="page_rotate_cw" ></menuitem> data-l10n-id="page_rotate_cw" ></menuitem>
</menu> </menu>
<div id="viewerContainer" tabindex="1"> <div id="viewerContainer">
<div id="viewer" contextmenu="viewerContextMenu"></div> <div id="viewer" contextmenu="viewerContextMenu"></div>
</div> </div>

View File

@ -1442,6 +1442,13 @@ var PDFView = {
left + ',' + top; left + ',' + top;
} }
self.setInitialView(storedHash, scale); self.setInitialView(storedHash, scale);
// Make all navigation keys work on document load,
// unless the viewer is embedded in another page.
if (window.parent === window) {
PDFView.container.focus();
PDFView.container.blur();
}
}); });
pagesPromise.then(function() { pagesPromise.then(function() {
@ -1480,12 +1487,6 @@ var PDFView = {
self.outline = new DocumentOutlineView(outline); self.outline = new DocumentOutlineView(outline);
document.getElementById('viewOutline').disabled = !outline; document.getElementById('viewOutline').disabled = !outline;
}); });
// Make all navigation keys work on document load,
// unless the viewer is embedded in another page.
if (window.parent.location === window.location) {
PDFView.container.focus();
}
}); });
pdfDocument.getMetadata().then(function(data) { pdfDocument.getMetadata().then(function(data) {