mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-04-28 19:16:43 +00:00
Compare commits
315 Commits
0.0.2
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0b9d8f476 | ||
|
|
db2ed3a555 | ||
|
|
6efc375066 | ||
|
|
9a4c864490 | ||
|
|
a3081ef4a9 | ||
|
|
43374e02bd | ||
|
|
fb8a19469b | ||
|
|
f2d5f4a86c | ||
|
|
2177aed64f | ||
|
|
2395a489a3 | ||
|
|
0b8eedf935 | ||
|
|
807ada0bf9 | ||
|
|
216c35c0b8 | ||
|
|
d98cd5d9a9 | ||
|
|
fb6adf316f | ||
|
|
0854317cc8 | ||
|
|
fcdefa450c | ||
|
|
dc50a460e5 | ||
|
|
31187ccb69 | ||
|
|
d4b72b06e9 | ||
|
|
922e1e6ac4 | ||
|
|
79341b2c8e | ||
|
|
8a1eebb9b0 | ||
|
|
85e26c6d93 | ||
|
|
0a1ff64d18 | ||
|
|
176f38070d | ||
|
|
4f5b0f74fd | ||
|
|
c549508417 | ||
|
|
b86515a926 | ||
|
|
1ba8c31d2c | ||
|
|
06ff1d4e8f | ||
|
|
b03a11f2b5 | ||
|
|
a362d21aa4 | ||
|
|
cd33d80a8c | ||
|
|
2bb0dd545d | ||
|
|
ac2115114c | ||
|
|
831550d847 | ||
|
|
1fa7b4a911 | ||
|
|
bcdb5ce0e6 | ||
|
|
a3485dd9b7 | ||
|
|
5a28b89f46 | ||
|
|
58b1b50c2e | ||
|
|
8f75df15e2 | ||
|
|
9883d3b064 | ||
|
|
e477ce7048 | ||
|
|
0985aed0b0 | ||
|
|
2ffda7a1a6 | ||
|
|
5cad4aa93e | ||
|
|
2a61449ce1 | ||
|
|
fe0b42c5e3 | ||
|
|
6ccc724839 | ||
|
|
56cdeffaa9 | ||
|
|
5633eb4111 | ||
|
|
6255c8dbbc | ||
|
|
1fd7d5df88 | ||
|
|
01213c5d02 | ||
|
|
49685e545b | ||
|
|
2542a24675 | ||
|
|
28d3e05ca9 | ||
|
|
00fbb5cd74 | ||
|
|
fbafcd5c92 | ||
|
|
376a90772d | ||
|
|
4f4e75859d | ||
|
|
679459f53b | ||
|
|
8baef0d873 | ||
|
|
d01dddf9e3 | ||
|
|
d61e5236d0 | ||
|
|
d514e6dc0f | ||
|
|
188d2def2d | ||
|
|
17d64ad963 | ||
|
|
d95fbe02bd | ||
|
|
212526d989 | ||
|
|
ef5052e7ea | ||
|
|
3531af4a46 | ||
|
|
b2f6fb3a00 | ||
|
|
996da0862c | ||
|
|
50dd7c1b83 | ||
|
|
2dd067170b | ||
|
|
e635ca86c5 | ||
|
|
8bd36e37a3 | ||
|
|
b3b2f7c407 | ||
|
|
f1ad3d44ff | ||
|
|
ee6ff50244 | ||
|
|
196741d5dc | ||
|
|
374c06472f | ||
|
|
12c85c60c7 | ||
|
|
4747ee93b2 | ||
|
|
5ec53c4b33 | ||
|
|
ee7f7f50cc | ||
|
|
92869e8d6c | ||
|
|
c66dda239f | ||
|
|
e927760c40 | ||
|
|
8783f9059a | ||
|
|
12e1239267 | ||
|
|
7c963193ef | ||
|
|
bce9a624d7 | ||
|
|
dac3606b4e | ||
|
|
eb00385d76 | ||
|
|
986f562266 | ||
|
|
11d0441ed4 | ||
|
|
ef46e2c51e | ||
|
|
0a3c03f18b | ||
|
|
7a7e1a1855 | ||
|
|
f530f441d5 | ||
|
|
10160e8104 | ||
|
|
602e80ee9e | ||
|
|
9c83860e1b | ||
|
|
1f1970232b | ||
|
|
594bd895ec | ||
|
|
486c09b24a | ||
|
|
aaf396fbc8 | ||
|
|
4e01d6f5f3 | ||
|
|
342c391a9b | ||
|
|
f2d929e6fa | ||
|
|
41cdc227b3 | ||
|
|
0f4f1d580b | ||
|
|
37c37868a3 | ||
|
|
01218e4a5c | ||
|
|
f6d54902e9 | ||
|
|
5a559aa868 | ||
|
|
9b0f381c06 | ||
|
|
c1802b2487 | ||
|
|
d4b11a4056 | ||
|
|
da1553920b | ||
|
|
d787813bc6 | ||
|
|
4a3886e41a | ||
|
|
cf1f833d60 | ||
|
|
cb21952155 | ||
|
|
3498df0491 | ||
|
|
e3ebf1979f | ||
|
|
fb09a8c00f | ||
|
|
4c708f3cbd | ||
|
|
e1035510df | ||
|
|
c466d0399c | ||
|
|
8b33a233dd | ||
|
|
9e2962bb62 | ||
|
|
fc73deb3fd | ||
|
|
40ac4b1eb9 | ||
|
|
3d6da5f5a0 | ||
|
|
7c4fc42247 | ||
|
|
0c2a92080e | ||
|
|
b1fd13bcbb | ||
|
|
cd37ff4b41 | ||
|
|
215e9f0f4a | ||
|
|
26e147b426 | ||
|
|
c7318c2b17 | ||
|
|
c16116c7cd | ||
|
|
1a4748bbec | ||
|
|
c0f7d60213 | ||
|
|
bf83a0847d | ||
|
|
7601d49795 | ||
|
|
1edf4d83f1 | ||
|
|
f620c00785 | ||
|
|
180e7bcb8a | ||
|
|
8a52450629 | ||
|
|
a535ebfe1d | ||
|
|
3e80590a82 | ||
|
|
5196536bb4 | ||
|
|
59ac8effc1 | ||
|
|
9cc0267619 | ||
|
|
a21f35c2b0 | ||
|
|
fde31cb327 | ||
|
|
9c096605bb | ||
|
|
b90e326eec | ||
|
|
66e2acd063 | ||
|
|
44165d655d | ||
|
|
c9a6956b0d | ||
|
|
9288564195 | ||
|
|
9b8e7f812c | ||
|
|
3908f1be7e | ||
|
|
15bd035304 | ||
|
|
e0b1cd76ca | ||
|
|
2144b776b1 | ||
|
|
a8022df1d9 | ||
|
|
a5d92bf905 | ||
|
|
81a18d07c3 | ||
|
|
86e5dcb23b | ||
|
|
1339c09382 | ||
|
|
01e310a6e7 | ||
|
|
a07c962867 | ||
|
|
09b6964c0e | ||
|
|
461030d34f | ||
|
|
c1a7cd8c46 | ||
|
|
5888c56f1d | ||
|
|
0798b8d8a0 | ||
|
|
ae93d48b44 | ||
|
|
506a3ba2b3 | ||
|
|
12f197b623 | ||
|
|
2001b241ee | ||
|
|
7911edec4b | ||
|
|
7ea70bf422 | ||
|
|
b1fdbd26a3 | ||
|
|
fa7241bd4e | ||
|
|
8fdf462c6c | ||
|
|
f7c7411bcf | ||
|
|
845cb2e657 | ||
|
|
a4bfde68bd | ||
|
|
19d1ba6cf9 | ||
|
|
1060bdd00f | ||
|
|
8c2fb2bdee | ||
|
|
0fe75387eb | ||
|
|
fbea49e54f | ||
|
|
41a72798d9 | ||
|
|
03cc185085 | ||
|
|
bfbd8ee25e | ||
|
|
f3f36169ff | ||
|
|
2df88544d3 | ||
|
|
6b744d77c7 | ||
|
|
ba57dedebb | ||
|
|
affd5b3057 | ||
|
|
30c3128995 | ||
|
|
b003a05775 | ||
|
|
98ec3d7dab | ||
|
|
69e23dbb99 | ||
|
|
47bda1023a | ||
|
|
fd538a74af | ||
|
|
300d213a7a | ||
|
|
4c0a70f300 | ||
|
|
8798d344b6 | ||
|
|
63e62ab57b | ||
|
|
9a027674ac | ||
|
|
e4407467dd | ||
|
|
551eeb0390 | ||
|
|
11d6ad1ed3 | ||
|
|
e57db6925c | ||
|
|
87096364d8 | ||
|
|
ad8027a7d0 | ||
|
|
9786fa8275 | ||
|
|
37762cf034 | ||
|
|
a78f1e5f8e | ||
|
|
440b8030e0 | ||
|
|
fb7cdfbef7 | ||
|
|
cf1ee9c631 | ||
|
|
13123f8f9d | ||
|
|
189bc3965d | ||
|
|
0aa7444dba | ||
|
|
628efec6bd | ||
|
|
6d0846a551 | ||
|
|
41d9015023 | ||
|
|
3f40b60c64 | ||
|
|
f244054462 | ||
|
|
37fbc98827 | ||
|
|
795cf3393e | ||
|
|
70323b8ee3 | ||
|
|
67686e99f0 | ||
|
|
90554462dc | ||
|
|
ba3084d698 | ||
|
|
3813f75f65 | ||
|
|
a663e99bcd | ||
|
|
d517ab4e6f | ||
|
|
29726c11a3 | ||
|
|
336a18ade7 | ||
|
|
53814fe6ab | ||
|
|
50fb586e6f | ||
|
|
a49ee9d726 | ||
|
|
ae40d0233b | ||
|
|
8f7c13850e | ||
|
|
b4d3419797 | ||
|
|
68aa5db66b | ||
|
|
7e8de7c754 | ||
|
|
f989fbf9c9 | ||
|
|
af8ddc10da | ||
|
|
3713e6e550 | ||
|
|
4a7ba07df1 | ||
|
|
b625381de3 | ||
|
|
0968ac774a | ||
|
|
0db6b23bf7 | ||
|
|
6dc10e8df4 | ||
|
|
9976f0ae99 | ||
|
|
55537d3a25 | ||
|
|
02e116fd8a | ||
|
|
5af3a97720 | ||
|
|
bf08c2c26f | ||
|
|
236ed405f2 | ||
|
|
0fb02e3ccb | ||
|
|
3dd6609fd6 | ||
|
|
dd876792c7 | ||
|
|
3b79ef31e8 | ||
|
|
deb3abcac1 | ||
|
|
1c1a945959 | ||
|
|
d1c5211d03 | ||
|
|
d73bc3a031 | ||
|
|
6f2001b8c9 | ||
|
|
378920b773 | ||
|
|
c78bf0605d | ||
|
|
e8f0efe1ec | ||
|
|
f8ebc4e39b | ||
|
|
3ecea6ee6c | ||
|
|
540e434954 | ||
|
|
6754232a1d | ||
|
|
ad790f4ae9 | ||
|
|
05464bbf1c | ||
|
|
cbe22c259f | ||
|
|
976a071089 | ||
|
|
bb7407542f | ||
|
|
2f86701eea | ||
|
|
5b5388e51f | ||
|
|
02957d98fc | ||
|
|
e3126f3711 | ||
|
|
a04e68c1af | ||
|
|
d4515dfadd | ||
|
|
78de36964d | ||
|
|
dcf37b94db | ||
|
|
73764b027b | ||
|
|
6d621dc05f | ||
|
|
4d6c5501ae | ||
|
|
cd8d1e2ba8 | ||
|
|
4731772d38 | ||
|
|
bc9bb6862b | ||
|
|
4462bab4fa | ||
|
|
6d98c972d1 | ||
|
|
852abadf8f | ||
|
|
2a93f80827 | ||
|
|
a8aef1b97b | ||
|
|
3e5ba7d3ba |
5
.gitattributes
vendored
Normal file
5
.gitattributes
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
*.css linguist-language=java
|
||||||
|
*.less linguist-language=java
|
||||||
|
*.js linguist-language=java
|
||||||
|
*.html linguist-language=java
|
||||||
|
*.* linguist-language=java
|
||||||
21
.gitignore
vendored
21
.gitignore
vendored
@@ -17,25 +17,14 @@ target/
|
|||||||
|
|
||||||
### NetBeans ###
|
### NetBeans ###
|
||||||
nbproject/private/
|
nbproject/private/
|
||||||
build/
|
|
||||||
nbbuild/
|
nbbuild/
|
||||||
dist/
|
dist/
|
||||||
nbdist/
|
nbdist/
|
||||||
.nb-gradle/
|
.nb-gradle/
|
||||||
/*.iml
|
/*.iml
|
||||||
|
|
||||||
**/target/
|
### VS Code ###
|
||||||
.classpath
|
.vscode/
|
||||||
.project
|
|
||||||
**/.settings
|
server/src/main/cache/
|
||||||
**/bin/
|
server/src/main/file/
|
||||||
**/build/
|
|
||||||
**/.externalToolBuilders/
|
|
||||||
*.iml
|
|
||||||
**/.idea/
|
|
||||||
**/disconf
|
|
||||||
**/rpc.properties
|
|
||||||
/producer/tmp
|
|
||||||
/.temfile
|
|
||||||
.temfile
|
|
||||||
convertedFile/
|
|
||||||
|
|||||||
41
Dockerfile
Normal file
41
Dockerfile
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
FROM ubuntu:20.04
|
||||||
|
MAINTAINER chenjh "842761733@qq.com"
|
||||||
|
ADD server/target/kkFileView-*.tar.gz /opt/
|
||||||
|
COPY fonts/* /usr/share/fonts/chinese/
|
||||||
|
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" > /etc/apt/sources.list &&\
|
||||||
|
apt-get clean && apt-get update &&\
|
||||||
|
apt-get install -y locales && apt-get install -y language-pack-zh-hans &&\
|
||||||
|
localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 && locale-gen zh_CN.UTF-8 &&\
|
||||||
|
apt-get install -y tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
|
||||||
|
apt-get install -y libxrender1 && apt-get install -y libxt6 && apt-get install -y libxext-dev && apt-get install -y libfreetype6-dev &&\
|
||||||
|
apt-get install -y wget && apt-get install -y ttf-mscorefonts-installer && apt-get install -y fontconfig &&\
|
||||||
|
apt-get install ttf-wqy-microhei &&\
|
||||||
|
apt-get install ttf-wqy-zenhei &&\
|
||||||
|
apt-get install xfonts-wqy &&\
|
||||||
|
cd /tmp &&\
|
||||||
|
wget https://kkfileview.keking.cn/server-jre-8u251-linux-x64.tar.gz &&\
|
||||||
|
tar -zxf /tmp/server-jre-8u251-linux-x64.tar.gz && mv /tmp/jdk1.8.0_251 /usr/local/ &&\
|
||||||
|
|
||||||
|
# 安装 OpenOffice
|
||||||
|
# wget https://kkfileview.keking.cn/Apache_OpenOffice_4.1.6_Linux_x86-64_install-deb_zh-CN.tar.gz -cO openoffice_deb.tar.gz &&\
|
||||||
|
# tar -zxf /tmp/openoffice_deb.tar.gz && cd /tmp/zh-CN/DEBS &&\
|
||||||
|
# dpkg -i *.deb && dpkg -i desktop-integration/openoffice4.1-debian-menus_4.1.6-9790_all.deb &&\
|
||||||
|
|
||||||
|
# 安装 libreoffice
|
||||||
|
apt-get install -y libxinerama1 libcairo2 libcups2 libx11-xcb1 &&\
|
||||||
|
wget https://kkfileview.keking.cn/LibreOffice_7.1.4_Linux_x86-64_deb.tar.gz -cO libreoffice_deb.tar.gz &&\
|
||||||
|
tar -zxf /tmp/libreoffice_deb.tar.gz && cd /tmp/LibreOffice_7.1.4.2_Linux_x86-64_deb/DEBS &&\
|
||||||
|
dpkg -i *.deb &&\
|
||||||
|
|
||||||
|
rm -rf /tmp/* && rm -rf /var/lib/apt/lists/* &&\
|
||||||
|
cd /usr/share/fonts/chinese &&\
|
||||||
|
mkfontscale &&\
|
||||||
|
mkfontdir &&\
|
||||||
|
fc-cache -fv
|
||||||
|
ENV JAVA_HOME /usr/local/jdk1.8.0_251
|
||||||
|
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
|
||||||
|
ENV PATH $PATH:$JAVA_HOME/bin
|
||||||
|
ENV LANG zh_CN.UTF-8
|
||||||
|
ENV LC_ALL zh_CN.UTF-8
|
||||||
|
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.0.0/bin
|
||||||
|
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dspring.config.location=/opt/kkFileView-4.0.0/config/application.properties","-jar","/opt/kkFileView-4.0.0/bin/kkFileView-4.0.0.jar"]
|
||||||
166
README.en.md
Normal file
166
README.en.md
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
# file-online-preview
|
||||||
|
|
||||||
|
[](https://github.com/kekingcn/kkFileView/blob/master/LICENSE)
|
||||||
|
|
||||||
|
### Introduction
|
||||||
|
|
||||||
|
This kekingcn kkFileView project is intended to be a solution for previewing documents online. At present,there are some similar paid products in the industry.
|
||||||
|
Such as 【[永中office](http://dcs.yozosoft.com/)】,【[office365](http://www.officeweb365.com/)】,【[idocv](https://www.idocv.com/)】, etc...
|
||||||
|
It is an open source implementation and released under the Apache License version 2.0. Finally,It is aimed to feedback the community after obtaining the consent of company executives,
|
||||||
|
special thanks to the supports of @唐老大 and the contributions of @端木详笑.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
- Build with the popular frame spring boot
|
||||||
|
- Easy to build and deploy
|
||||||
|
- Basically support online preview of mainstream office documents, such as Doc, docx, Excel, PDF, TXT, zip, rar, pictures, etc
|
||||||
|
- REST API
|
||||||
|
- Abstract file preview interface so that it is easy to extend more file extensions and develop this project on your own
|
||||||
|
|
||||||
|
### Official website and DOCS
|
||||||
|
|
||||||
|
URL:[https://kkfileview.keking.cn](https://kkfileview.keking.cn)
|
||||||
|
|
||||||
|
### Live demo
|
||||||
|
> Please treat public service kindly, or this would stop at any time.
|
||||||
|
|
||||||
|
URL:[https://file.keking.cn](https://file.keking.cn)
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
1. Full wiki document:https://gitee.com/kekingcn/file-online-preview/wikis/pages
|
||||||
|
1. 中文文档:https://gitee.com/kekingcn/file-online-preview/blob/master/README.md
|
||||||
|
1. English document:https://gitee.com/kekingcn/file-online-preview/blob/master/README.en.md
|
||||||
|
|
||||||
|
### Contact us && Join us
|
||||||
|
> We will answer everyone's questions in use of this project.
|
||||||
|
And please Google or Baidu first before asking a question, so that we can solve it efficiently.
|
||||||
|
Cherish life away from ineffective communication.
|
||||||
|
|
||||||
|

|
||||||
|
QQ group:613025121
|
||||||
|
|
||||||
|
### Pictures for some samples
|
||||||
|
#### 1. Text Preview
|
||||||
|
It supports preview of all types of text documents. Because there are too many types of text documents, it is impossible to enumerate them. The default open types are as follows: txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd
|
||||||
|
The text preview effect is as follows
|
||||||
|

|
||||||
|
|
||||||
|
#### 2. Picture preview
|
||||||
|
Support jpg, jpeg, png, gif and other picture previews (flip, zoom, mirror). The preview effect is as follows
|
||||||
|

|
||||||
|
|
||||||
|
#### 3. Word document preview
|
||||||
|
Doc and docx document previews are supported. There are two modes of word previews: one is that each page of word is converted to picture previews, the other is that the whole word document is converted to PDF, and then previews PDF. The applicable scenarios of the two modes are as follows
|
||||||
|
* Picture preview modes: the word file is large, and the whole PDF loaded in the foreground is too slow
|
||||||
|
* Pdf Preview modes: intranet access, loading PDF fast
|
||||||
|
The preview effect of picture preview mode is as follows
|
||||||
|

|
||||||
|
The preview effect of PDF preview mode is as follows
|
||||||
|

|
||||||
|
|
||||||
|
#### 4. PPT document preview
|
||||||
|
ppt and pptx document preview are supported. Like word documents, there are two preview modes
|
||||||
|
The preview effect of picture preview mode is as follows
|
||||||
|

|
||||||
|
The preview effect of PDF preview mode is as follows
|
||||||
|

|
||||||
|
|
||||||
|
#### 5. PDF document preview
|
||||||
|
Pdf document preview is supported. Like word document, there are two preview modes
|
||||||
|
The preview effect of picture preview mode is as follows
|
||||||
|

|
||||||
|
The preview effect of PDF preview mode is as follows
|
||||||
|

|
||||||
|
|
||||||
|
#### 6. EXCEL document preview
|
||||||
|
Support XLS, xlsx document preview, the preview effect is as follows
|
||||||
|

|
||||||
|
|
||||||
|
#### 7. Compressed file Preview
|
||||||
|
Support zip, rar, jar, tar, gzip and other compressed packages. The preview effect is as follows
|
||||||
|

|
||||||
|
Click the file name in the compressed package to preview the file directly. The preview effect is as follows
|
||||||
|

|
||||||
|
|
||||||
|
#### 8. Multimedia file Preview
|
||||||
|
Theoretically, all video and audio files are supported. Since all file formats cannot be enumerated, the default open type is as follows
|
||||||
|
mp3,wav,mp4,flv
|
||||||
|
The video preview effect is as follows
|
||||||
|

|
||||||
|
The audio preview effect is as follows
|
||||||
|

|
||||||
|
|
||||||
|
#### 9. CAD document preview
|
||||||
|
CAD DWG document preview is supported. Like word document, there are two preview modes
|
||||||
|
The preview effect of Picture preview mode is as follows
|
||||||
|

|
||||||
|
The preview effect of PDF preview mode is as follows
|
||||||
|

|
||||||
|
Considering space issues, the pictures of other types of documents will not be shown here.You can deploy it by yourself if you are interested in our project.There is a way to deploy it as below.
|
||||||
|
|
||||||
|
### Quick Start
|
||||||
|
> Technology stack
|
||||||
|
- Spring boot: [spring boot Development Reference Guide](http://www.kailing.pub/PdfReader/web/viewer.html?file=springboot)
|
||||||
|
- Freemarker
|
||||||
|
- Redisson
|
||||||
|
- Jodconverter
|
||||||
|
> Dependencies
|
||||||
|
- Redis(Optional, Unnecessary by default)
|
||||||
|
- OpenOffice or LibreOffice(Integrated on Windows, will be installed automatically on Linux, need to be manually installed on Mac OS)
|
||||||
|
|
||||||
|
1. First step:`git pull https://github.com/kekingcn/file-online-preview.git`
|
||||||
|
|
||||||
|
2. Third step:Run the main method of FilePreviewApplication.java.After starting,visit `http://localhost:8012/`.
|
||||||
|
If everything is ok,you will see the picture below.
|
||||||
|

|
||||||
|
|
||||||
|
### Changelog
|
||||||
|
> May 20th 2020 :
|
||||||
|
1. Support for global watermark and dynamic change of watermark content through parameters
|
||||||
|
2. Support for CAD file Preview
|
||||||
|
3. Add configuration item base.url, support using nginx reverse proxy and set context-path
|
||||||
|
4. All configuration items can be read from environment variables, which is convenient for docker image deployment and large-scale use in cluster
|
||||||
|
5. Support the configuration of TrustHost (only the file source from the trust site can be previewed), and protect the preview service from abuse
|
||||||
|
6. Support configuration of customize cache cleanup time (cron expression)
|
||||||
|
7. All recognizable plain text can be previewed directly without downloading, such as .md .java .py, etc
|
||||||
|
8. Support configuration to limit PDF file download after conversion
|
||||||
|
9. Optimize Maven packaging configuration to solve the problem of line break in .sh script
|
||||||
|
10. Place all CDN dependencies on the front end locally for users without external network connection
|
||||||
|
11. Comment Service on home page switched from Sohu ChangYan to gitalk
|
||||||
|
12. Fixed preview exceptions that may be caused by special characters in the URL
|
||||||
|
13. Fixed the addtask exception of the transformation file queue
|
||||||
|
14. Fixed other known issues
|
||||||
|
15. Official website build: [https://kkfileview.keking.cn](https://kkfileview.keking.cn)
|
||||||
|
16. Official docker image repository build: [https://hub.docker.com/r/keking/kkfileview](https://hub.docker.com/r/keking/kkfileview)
|
||||||
|
|
||||||
|
> June 18th 2019 :
|
||||||
|
1. Support automatic cleaning of cache and preview files
|
||||||
|
2. Support http/https stream url file preview
|
||||||
|
3. Support FTP url file preview
|
||||||
|
4. Add Docker build
|
||||||
|
|
||||||
|
> April 8th 2019
|
||||||
|
1. Cache and queue implementations abstract, providing JDK and REDIS implementations (REDIS becomes optional dependencies)
|
||||||
|
2. Provides zip and tar.gz packages, and provides a one-click startup script
|
||||||
|
|
||||||
|
> January 17th 2018
|
||||||
|
|
||||||
|
1. Refined the project directory, abstract file preview interface, Easy to extend more file extensions and depoly this project on your own
|
||||||
|
1. Added English documentation (@幻幻Fate,@汝辉) contribution
|
||||||
|
1. Support for more image file extensions
|
||||||
|
1. Fixed the issue that image carousel in zip file will always start from the first
|
||||||
|
|
||||||
|
> January 12th 2018
|
||||||
|
|
||||||
|
1. Support for multiple images preview
|
||||||
|
1. Support for images rotation preview in rar/zip
|
||||||
|
|
||||||
|
> January 2nd 2018
|
||||||
|
|
||||||
|
1. Fixed gibberish issue when preview a txt document caused by the file encoding problem
|
||||||
|
1. Fixed the issue that some module dependencies can not be found
|
||||||
|
1. Add a spring boot profile, and support for Multi-environment configuration
|
||||||
|
1. Add `pdf.js` to preview the documents such as doc,etc.,support for generating doc headlines as pdf menu,support for mobile preview
|
||||||
|
|
||||||
|
### Register Usage
|
||||||
|
If this project is helpful for you, please register on 'https://gitee.com/kekingcn/file-online-preview/issues/IGSBV',
|
||||||
|
If this project helps you to economize the service charge for preview of documents, as well as you are willing to support us, click 【donate】 below to donate a cup of coffee, we would appreciate it.
|
||||||
236
README.md
236
README.md
@@ -1,31 +1,94 @@
|
|||||||
# file-online-preview
|
# file-online-preview
|
||||||
此项目为文件文档在线预览项目解决方案,对标业内付费产品有【[永中office](http://dcs.yozosoft.com/)】【[office365](http://www.officeweb365.com/)】【[idocv](https://www.idocv.com/)】等,在取得公司高层同意后以Apache协议开源出来反哺社区,在此特别感谢@唐老大的支持以及@端木详笑的贡献。该项目使用流行的spring boot搭建,易上手和部署,基本支持主流办公文档的在线预览,如doc,docx,Excel,pdf,txt,zip,rar,图片等等
|
此项目为文件文档在线预览项目解决方案,对标业内付费产品有【[永中office](http://dcs.yozosoft.com/)】【[office365](http://www.officeweb365.com/)】【[idocv](https://www.idocv.com/)】等,在取得公司高层同意后以Apache协议开源出来反哺社区,在此特别感谢@唐老大的支持以及@端木详笑的贡献。该项目使用流行的spring boot搭建,易上手和部署,基本支持主流办公文档的在线预览,如doc,docx,Excel,pdf,txt,zip,rar,图片等等
|
||||||
|
### 项目特性
|
||||||
|
|
||||||
|
1. 支持 office, pdf, cad 等办公文档
|
||||||
|
1. 支持 txt, xml(渲染), md(渲染), java, php, py, js, css 等所有纯文本
|
||||||
|
1. 支持 zip, rar, jar, tar, gzip 等压缩包
|
||||||
|
1. 支持 jpg, jpeg, png, gif, tif, tiff 等图片预览(翻转,缩放,镜像)
|
||||||
|
1. 使用 spring-boot 开发,预览服务搭建部署非常简便
|
||||||
|
1. rest 接口提供服务,跨语言、跨平台特性(java,php,python,go,php,....)都支持,应用接入简单方便
|
||||||
|
1. 抽象预览服务接口,方便二次开发,非常方便添加其他类型文件预览支持
|
||||||
|
1. 最最重要 Apache 协议开源,代码 pull 下来想干嘛就干嘛
|
||||||
|
|
||||||
|
### 官网及文档
|
||||||
|
|
||||||
|
地址:[https://kkfileview.keking.cn](https://kkfileview.keking.cn)
|
||||||
|
|
||||||
### 在线体验
|
### 在线体验
|
||||||
> 请善待公共服务,会不定时停用
|
> 请善待公共服务,会不定时停用
|
||||||
|
|
||||||
地址:http://58.246.254.194:8012/
|
地址:[https://file.keking.cn](https://file.keking.cn)
|
||||||
|
|
||||||
|
### 项目文档(Project documentation)
|
||||||
|
1. 详细wiki文档:https://gitee.com/kekingcn/file-online-preview/wikis/pages
|
||||||
|
1. 中文文档:https://gitee.com/kekingcn/file-online-preview/blob/master/README.md
|
||||||
|
1. English document:https://gitee.com/kekingcn/file-online-preview/blob/master/README.en.md
|
||||||
|
|
||||||
### 联系我们,加入组织
|
### 联系我们,加入组织
|
||||||
> 我们会用心回答解决大家在项目使用中的问题,也请大家在提问前至少Google或baidu过,珍爱生命远离无效的交流沟通
|
> 我们会用心回答解决大家在项目使用中的问题,也请大家在提问前至少 Google 或 baidu 过,珍爱生命远离无效的交流沟通
|
||||||
|
|
||||||

|

|
||||||
QQ群号:613025121
|
|
||||||
|
QQ群号:~~613025121(已满)~~ 2群:484680571
|
||||||
|
|
||||||
### 文档预览效果
|
### 文档预览效果
|
||||||
> Excel预览效果
|
#### 1. 文本预览
|
||||||
|
支持所有类型的文本文档预览, 由于文本文档类型过多,无法全部枚举,默认开启的类型如下 txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd
|
||||||
|
文本预览效果如下
|
||||||
|

|
||||||
|
|
||||||

|
#### 2. 图片预览
|
||||||
> doc预览效果
|
支持jpg,jpeg,png,gif等图片预览(翻转,缩放,镜像),预览效果如下
|
||||||
|

|
||||||
|
|
||||||

|
#### 3. word文档预览
|
||||||
|
支持doc,docx文档预览,word预览有两种模式:一种是每页word转为图片预览,另一种是整个word文档转成pdf,再预览pdf。两种模式的适用场景如下
|
||||||
|
* 图片预览:word文件大,前台加载整个pdf过慢
|
||||||
|
* pdf预览:内网访问,加载pdf快
|
||||||
|
图片预览模式预览效果如下
|
||||||
|

|
||||||
|
pdf预览模式预览效果如下
|
||||||
|

|
||||||
|
|
||||||
> zip,rar压缩预览效果
|
#### 4. ppt文档预览
|
||||||
|
支持ppt,pptx文档预览,和word文档一样,有两种预览模式
|
||||||
|
图片预览模式预览效果如下
|
||||||
|

|
||||||
|
pdf预览模式预览效果如下
|
||||||
|

|
||||||
|
|
||||||

|
#### 5. pdf文档预览
|
||||||
|
支持pdf文档预览,和word文档一样,有两种预览模式
|
||||||
|
图片预览模式预览效果如下
|
||||||
|

|
||||||
|
pdf预览模式预览效果如下
|
||||||
|

|
||||||
|
|
||||||
> png,jpeg,jpg等图片预览效果,支持滚轮缩放,旋转,倒置等
|
#### 6. excel文档预览
|
||||||
|
支持xls,xlsx文档预览,预览效果如下
|
||||||
|

|
||||||
|
|
||||||

|
#### 7. 压缩文件预览
|
||||||
|
支持zip,rar,jar,tar,gzip等压缩包,预览效果如下
|
||||||
|

|
||||||
|
可点击压缩包中的文件名,直接预览文件,预览效果如下
|
||||||
|

|
||||||
|
|
||||||
|
#### 8. 多媒体文件预览
|
||||||
|
理论上支持所有的视频、音频文件,由于无法枚举所有文件格式,默认开启的类型如下
|
||||||
|
mp3,wav,mp4,flv
|
||||||
|
视频预览效果如下
|
||||||
|

|
||||||
|
音频预览效果如下
|
||||||
|

|
||||||
|
|
||||||
|
#### 9. CAD文档预览
|
||||||
|
支持CAD dwg文档预览,和word文档一样,有两种预览模式
|
||||||
|
图片预览模式预览效果如下
|
||||||
|

|
||||||
|
pdf预览模式预览效果如下
|
||||||
|

|
||||||
考虑说明篇幅原因,就不贴其他格式文件的预览效果了,感兴趣的可以参考下面的实例搭建下
|
考虑说明篇幅原因,就不贴其他格式文件的预览效果了,感兴趣的可以参考下面的实例搭建下
|
||||||
|
|
||||||
### 快速开始
|
### 快速开始
|
||||||
@@ -35,26 +98,141 @@ QQ群号:613025121
|
|||||||
- redisson
|
- redisson
|
||||||
- jodconverter
|
- jodconverter
|
||||||
> 依赖外部环境
|
> 依赖外部环境
|
||||||
- redis
|
- redis (可选,默认不用)
|
||||||
- OpenOffice或者LibreOffice
|
- OpenOffice 或者 LibreOffice( Windows 下已内置,Linux 脚本启动模式会自动安装,Mac OS 下需要手动安装)
|
||||||
|
|
||||||
1. 第一步:pull项目https://github.com/kekingcn/file-online-preview.git
|
1. 第一步:pull 项目 https://github.com/kekingcn/file-online-preview.git
|
||||||
|
|
||||||
2. 第二步:配置redis地址和OpenOffice目录,如
|
3. 第二步:运行 ServerMain 的 main 方法,服务启动后,访问 http://localhost:8012/
|
||||||
```
|
|
||||||
#=============================================#spring Redisson配置#===================================#
|
|
||||||
spring.redisson.address = 192.168.1.204:6379
|
|
||||||
##资源映射路径(因为jar方式运行的原因)
|
|
||||||
file.dir = C:\\Users\\yudian\\Desktop\\dev\\
|
|
||||||
## openoffice相关配置
|
|
||||||
office.home = C:\\Program Files (x86)\\OpenOffice 4
|
|
||||||
|
|
||||||
```
|
|
||||||
file.dir为转换文件实际存储地址,注意要以/结尾
|
|
||||||
|
|
||||||
3. 第三步:运行FilePreviewApplication的main方法,服务启动后,访问http://localhost:8012/
|
|
||||||
会看到如下界面,代表服务启动成功
|
会看到如下界面,代表服务启动成功
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
### 历史更新记录
|
||||||
|
|
||||||
|
> 2021年7月6日,v4.0.0 版本发布 :
|
||||||
|
|
||||||
|
1. 底层集成OpenOffice替换为LibreOffice,Office文件兼容性增强,预览效果提升
|
||||||
|
2. 修复压缩文件目录穿越漏洞
|
||||||
|
3. 修复PPT预览使用PDF模式无效
|
||||||
|
4. 修复PPT图片预览模式前端显示异常
|
||||||
|
5. 新增功能:首页文件上传功能可通过配置实时开启或禁用
|
||||||
|
6. 优化增加Office进程关闭日志
|
||||||
|
7. 优化Windows环境下,查找Office组件逻辑(内置的LibreOffice优先)
|
||||||
|
8. 优化启动Office进程改同步执行
|
||||||
|
|
||||||
|
> 2021年6月17日,v3.6.0 版本发布 :
|
||||||
|
|
||||||
|
ofd 类型文件支持版本,本次版本重要功能均由社区开发贡献,感谢 @gaoxingzaq、@zhangxiaoxiao9527 的代码贡献
|
||||||
|
1. 新增 ofd 类型文件预览支持,ofd 是国产的类似 pdf 格式的文件
|
||||||
|
2. 新增了 ffmpeg 视频文件转码预览支持,打开转码功能后,理论上支持所有主流视频的预览,如 rm、rmvb、flv 等
|
||||||
|
3. 美化了 ppt、pptx 类型文件预览效果,比之前版本好看太多
|
||||||
|
4. 更新了 pdfbox、xstream、common-io 等依赖的版本
|
||||||
|
|
||||||
|
> 2021年1月28日 :
|
||||||
|
|
||||||
|
2020农历年最后一个版本发布,主要包含了部分 UI 改进,和解决了 QQ 群友、 Issue 里反馈的 Bug 修复,最最重要的是发个新版,过个好年
|
||||||
|
|
||||||
|
1. 引入galimatias,解决不规范文件名导致文件下载异常
|
||||||
|
2. 更新index接入演示界面UI风格
|
||||||
|
3. 更新markdown文件预览UI风格
|
||||||
|
4. 更新XML文件预览UI风格,调整类文本预览架构,更方便扩展
|
||||||
|
5. 更新simTxT文件预览UI风格
|
||||||
|
6. 调整多图连续预览上下翻图的UI
|
||||||
|
7. 采用apache-common-io包简化所有的文件下载io操作
|
||||||
|
8. XML文件预览支持切换纯文本模式
|
||||||
|
9. 增强url base64解码失败时的提示信息
|
||||||
|
10. 修复导包错误以及图片预览 bug
|
||||||
|
11. 修复发行包运行时找不到日志目录的问题
|
||||||
|
12. 修复压缩包内多图连续预览的bug
|
||||||
|
13. 修复大小写文件类型后缀没通用匹配的问题
|
||||||
|
14. 指定Base64转码采用Apache Commons-code中的实现,修复base64部分jdk版本下出现的异常
|
||||||
|
15. 修复类文本类型HTML文件预览的bug
|
||||||
|
16. 修复:dwg文件预览时无法在jpg和pdf两种类型之间切换
|
||||||
|
17. escaping of dangerous characters to prevent reflected xss
|
||||||
|
18. 修复重复编码导致文档转图片预览失败的问题&编码规范
|
||||||
|
|
||||||
|
> 2020年12月27日 :
|
||||||
|
|
||||||
|
2020年年终大版本更新,架构全面设计,代码全面重构,代码质量全面提升,二次开发更便捷,欢迎拉源码品鉴,提issue、pr共同建设
|
||||||
|
|
||||||
|
1. 架构模块调整,大量的代码重构,代码质量提升N个等级,欢迎品鉴
|
||||||
|
2. 增强XML文件预览效果,新增XML文档数结构预览
|
||||||
|
3. 新增markdown文件预览支持,预览支持md渲染和源文本切换支持
|
||||||
|
4. 切换底层web server为jetty,解决这个issue:https://github.com/kekingcn/kkFileView/issues/168
|
||||||
|
5. 引入cpdetector,解决文件编码识别问题
|
||||||
|
6. url采用base64+urlencode双编码,彻底解决各种奇葩文件名预览问题
|
||||||
|
7. 新增配置项office.preview.switch.disabled,控制offic文件预览切换开关
|
||||||
|
8. 优化文本类型文件预览逻辑,采用Base64传输内容,避免预览时再次请求文件内容
|
||||||
|
9. office预览图片模式禁用图片放大效果,达到图片和pdf预览效果一致的体验
|
||||||
|
10. 直接代码静态设置pdfbox兼容低版本jdk,在IDEA中运行也不会有警告提示
|
||||||
|
11. 移除guava、hutool等非必须的工具包,减少代码体积
|
||||||
|
12. Office组件加载异步化,提速应用启动速度最快到5秒内
|
||||||
|
13. 合理设置预览消费队列的线程数
|
||||||
|
14. 修复压缩包里文件再次预览失败的bug
|
||||||
|
15. 修复图片预览的bug
|
||||||
|
|
||||||
|
> 2020年05月20日 :
|
||||||
|
1. 新增支持全局水印,并支持通过参数动态改变水印内容
|
||||||
|
2. 新增支持CAD文件预览
|
||||||
|
3. 新增base.url配置,支持使用nginx反向代理和使用context-path
|
||||||
|
4. 支持所有配置项支持从环境变量里读取,方便Docker镜像部署和集群中大规模使用
|
||||||
|
5. 支持配置限信任站点(只能预览来自信任点的文件源),保护预览服务不被滥用
|
||||||
|
6. 支持配置自定义缓存清理时间(cron表达式)
|
||||||
|
7. 全部能识别的纯文本直接预览,不用再转跳下载,如.md .java .py等
|
||||||
|
8. 支持配置限制转换后的PDF文件下载
|
||||||
|
9. 优化maven打包配置,解决 .sh 脚本可能出现换行符问题
|
||||||
|
10. 将前端所有CDN依赖放到本地,方便没有外网连接的用户使用
|
||||||
|
11. 首页评论服务由搜狐畅言切换到Gitalk
|
||||||
|
12. 修复url中包含特殊字符可能会引起的预览异常
|
||||||
|
13. 修复转换文件队列addTask异常
|
||||||
|
14. 修复其他已经问题
|
||||||
|
15. 官网建设:[https://kkfileview.keking.cn](https://kkfileview.keking.cn)
|
||||||
|
16. 官方Docker镜像仓库建设:[https://hub.docker.com/r/keking/kkfileview](https://hub.docker.com/r/keking/kkfileview)
|
||||||
|
|
||||||
|
> 2019年06月18日 :
|
||||||
|
1. 支持自动清理缓存及预览文件
|
||||||
|
2. 支持http/https下载流url文件预览
|
||||||
|
3. 支持FTP url文件预览
|
||||||
|
4. 加入Docker构建
|
||||||
|
|
||||||
|
> 2019年04月08日 :
|
||||||
|
1. 缓存及队列实现抽象,提供JDK和REDIS两种实现(REDIS成为可选依赖)
|
||||||
|
2. 打包方式提供zip和tar.gz包,并提供一键启动脚本
|
||||||
|
|
||||||
|
> 2018年01月19日 :
|
||||||
|
|
||||||
|
1. 大文件入队提前处理
|
||||||
|
1. 新增addTask文件转换入队接口
|
||||||
|
1. 采用redis队列,支持kkFIleView接口和异构系统入队两种方式
|
||||||
|
|
||||||
|
> 2018年01月17日 :
|
||||||
|
|
||||||
|
1. 优化项目结构,抽象文件预览接口,更方便的加入更多的文件类型预览支持,方便二次开发
|
||||||
|
1. 新增英文文档说明(@幻幻Fate,@汝辉)贡献
|
||||||
|
1. 新增图片预览文件支持类型
|
||||||
|
1. 修复压缩包内轮播图片总是从第一张开始的问题
|
||||||
|
|
||||||
|
> 2018年01月12日 :
|
||||||
|
|
||||||
|
1. 新增多图片同时预览
|
||||||
|
1. 支持压缩包内图片轮番预览
|
||||||
|
|
||||||
|
> 2018年01月02日 :
|
||||||
|
|
||||||
|
1. 修复txt等文本编码问题导致预览乱码
|
||||||
|
1. 修复项目模块依赖引入不到的问题
|
||||||
|
1. 新增spring boot profile,支持多环境配置
|
||||||
|
1. 引入pdf.js预览doc等文件,支持doc标题生成pdf预览菜单,支持手机端预览
|
||||||
|
|
||||||
### 使用登记
|
### 使用登记
|
||||||
如果这个项目解决了你的实际问题,可在https://gitee.com/kekingcn/file-online-preview/issues/IGSBV
|
如果这个项目解决了你的实际问题,可在 https://gitee.com/kekingcn/file-online-preview/issues/IGSBV
|
||||||
登记下,如果节省了你的三方预览服务费用,也愿意支持下的话,可点击下方【捐助】请作者喝杯咖啡,也是非常感谢
|
登记下,如果节省了你的三方预览服务费用,也愿意支持下的话,可点击下方【捐助】请作者喝杯咖啡,也是非常感谢
|
||||||
|
|
||||||
|
### Stars 趋势图
|
||||||
|
#### Gitee
|
||||||
|
[](https://whnb.wang/kekingcn/file-online-preview?e=86400)
|
||||||
|
|
||||||
|
#### GitHub
|
||||||
|
|
||||||
|
[](https://starchart.cc/kekingcn/kkFileView)
|
||||||
|
|||||||
BIN
doc/KK开源技术交流2群群聊二维码.png
Normal file
BIN
doc/KK开源技术交流2群群聊二维码.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
BIN
doc/kk开源技术交流群聊二维码.png
Normal file
BIN
doc/kk开源技术交流群聊二维码.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
@@ -1,160 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>com.yudianbank</groupId>
|
|
||||||
<artifactId>jodconverter-core</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<!-- required for org.hyperic:sigar -->
|
|
||||||
<id>jboss-public-repository-group</id>
|
|
||||||
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-io</groupId>
|
|
||||||
<artifactId>commons-io</artifactId>
|
|
||||||
<version>1.4</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.openoffice</groupId>
|
|
||||||
<artifactId>juh</artifactId>
|
|
||||||
<version>3.2.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.openoffice</groupId>
|
|
||||||
<artifactId>ridl</artifactId>
|
|
||||||
<version>3.2.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.openoffice</groupId>
|
|
||||||
<artifactId>unoil</artifactId>
|
|
||||||
<version>3.2.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<!-- for the command line tool -->
|
|
||||||
<groupId>commons-cli</groupId>
|
|
||||||
<artifactId>commons-cli</artifactId>
|
|
||||||
<version>1.1</version>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.hyperic</groupId>
|
|
||||||
<artifactId>sigar</artifactId>
|
|
||||||
<version>1.6.5.132</version>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.json</groupId>
|
|
||||||
<artifactId>json</artifactId>
|
|
||||||
<version>20090211</version>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.testng</groupId>
|
|
||||||
<artifactId>testng</artifactId>
|
|
||||||
<version>6.0.1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<!-- 要将源码放上去,需要加入这个插件 -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>2.1</version>
|
|
||||||
<configuration>
|
|
||||||
<attach>true</attach>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>compile</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>2.3.2</version>
|
|
||||||
<configuration>
|
|
||||||
<source>1.6</source>
|
|
||||||
<target>1.6</target>
|
|
||||||
<encoding>UTF-8</encoding>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>2.7.2</version>
|
|
||||||
<configuration>
|
|
||||||
<!-- don't run tests in parallel -->
|
|
||||||
<perCoreThreadCount>false</perCoreThreadCount>
|
|
||||||
<threadCount>1</threadCount>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>2.3.1</version>
|
|
||||||
<configuration>
|
|
||||||
<archive>
|
|
||||||
<manifest>
|
|
||||||
<mainClass>org.artofsolving.jodconverter.cli.Convert</mainClass>
|
|
||||||
<addClasspath>true</addClasspath>
|
|
||||||
</manifest>
|
|
||||||
</archive>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<version>2.2-beta-5</version>
|
|
||||||
<configuration>
|
|
||||||
<descriptors>
|
|
||||||
<descriptor>src/main/assembly/dist.xml</descriptor>
|
|
||||||
</descriptors>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<reporting>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>2.7</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>cobertura-maven-plugin</artifactId>
|
|
||||||
<version>2.4</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</reporting>
|
|
||||||
<!-- distribute目录 -->
|
|
||||||
<distributionManagement>
|
|
||||||
<repository>
|
|
||||||
<id>repo</id>
|
|
||||||
<name>User Project Releases</name>
|
|
||||||
<url>http://192.168.1.204:8081/nexus/content/repositories/releases</url>
|
|
||||||
</repository>
|
|
||||||
<snapshotRepository>
|
|
||||||
<id>repo</id>
|
|
||||||
<name>User Project SNAPSHOTS</name>
|
|
||||||
<url>http://192.168.1.204:8081/nexus/content/repositories/snapshots</url>
|
|
||||||
</snapshotRepository>
|
|
||||||
</distributionManagement>
|
|
||||||
</project>
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
//
|
|
||||||
// JODConverter - Java OpenDocument Converter
|
|
||||||
// Copyright 2004-2012 Mirko Nasato and contributors
|
|
||||||
//
|
|
||||||
// JODConverter is Open Source software, you can redistribute it and/or
|
|
||||||
// modify it under either (at your option) of the following licenses
|
|
||||||
//
|
|
||||||
// 1. The GNU Lesser General Public License v3 (or later)
|
|
||||||
// -> http://www.gnu.org/licenses/lgpl-3.0.txt
|
|
||||||
// 2. The Apache License, Version 2.0
|
|
||||||
// -> http://www.apache.org/licenses/LICENSE-2.0.txt
|
|
||||||
//
|
|
||||||
package org.artofsolving.jodconverter.office;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.artofsolving.jodconverter.util.PlatformUtils;
|
|
||||||
|
|
||||||
import com.sun.star.beans.PropertyValue;
|
|
||||||
import com.sun.star.uno.UnoRuntime;
|
|
||||||
|
|
||||||
public class OfficeUtils {
|
|
||||||
|
|
||||||
public static final String SERVICE_DESKTOP = "com.sun.star.frame.Desktop";
|
|
||||||
|
|
||||||
private OfficeUtils() {
|
|
||||||
throw new AssertionError("utility class must not be instantiated");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> T cast(Class<T> type, Object object) {
|
|
||||||
return (T) UnoRuntime.queryInterface(type, object);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static PropertyValue property(String name, Object value) {
|
|
||||||
PropertyValue propertyValue = new PropertyValue();
|
|
||||||
propertyValue.Name = name;
|
|
||||||
propertyValue.Value = value;
|
|
||||||
return propertyValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static PropertyValue[] toUnoProperties(Map<String,?> properties) {
|
|
||||||
PropertyValue[] propertyValues = new PropertyValue[properties.size()];
|
|
||||||
int i = 0;
|
|
||||||
for (Map.Entry<String,?> entry : properties.entrySet()) {
|
|
||||||
Object value = entry.getValue();
|
|
||||||
if (value instanceof Map) {
|
|
||||||
Map<String,Object> subProperties = (Map<String,Object>) value;
|
|
||||||
value = toUnoProperties(subProperties);
|
|
||||||
}
|
|
||||||
propertyValues[i++] = property((String) entry.getKey(), value);
|
|
||||||
}
|
|
||||||
return propertyValues;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String toUrl(File file) {
|
|
||||||
String path = file.toURI().getRawPath();
|
|
||||||
String url = path.startsWith("//") ? "file:" + path : "file://" + path;
|
|
||||||
return url.endsWith("/") ? url.substring(0, url.length() - 1) : url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static File getDefaultOfficeHome() {
|
|
||||||
if (System.getProperty("office.home") != null) {
|
|
||||||
return new File(System.getProperty("office.home"));
|
|
||||||
}
|
|
||||||
if (PlatformUtils.isWindows()) {
|
|
||||||
// %ProgramFiles(x86)% on 64-bit machines; %ProgramFiles% on 32-bit ones
|
|
||||||
String programFiles = System.getenv("ProgramFiles(x86)");
|
|
||||||
if (programFiles == null) {
|
|
||||||
programFiles = System.getenv("ProgramFiles");
|
|
||||||
}
|
|
||||||
return findOfficeHome(
|
|
||||||
programFiles + File.separator + "OpenOffice 4",
|
|
||||||
programFiles + File.separator + "LibreOffice 4"
|
|
||||||
);
|
|
||||||
} else if (PlatformUtils.isMac()) {
|
|
||||||
return findOfficeHome(
|
|
||||||
"/Applications/OpenOffice.org.app/Contents",
|
|
||||||
"/Applications/LibreOffice.app/Contents"
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
// Linux or other *nix variants
|
|
||||||
return findOfficeHome(
|
|
||||||
"/opt/openoffice.org3",
|
|
||||||
"/opt/libreoffice",
|
|
||||||
"/usr/lib/openoffice",
|
|
||||||
"/usr/lib/libreoffice"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static File findOfficeHome(String... knownPaths) {
|
|
||||||
for (String path : knownPaths) {
|
|
||||||
File home = new File(path);
|
|
||||||
if (getOfficeExecutable(home).isFile()) {
|
|
||||||
return home;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static File getOfficeExecutable(File officeHome) {
|
|
||||||
if (PlatformUtils.isMac()) {
|
|
||||||
return new File(officeHome, "MacOS/soffice.bin");
|
|
||||||
} else {
|
|
||||||
return new File(officeHome, "program/soffice.bin");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<parent>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
|
||||||
<version>1.5.8.RELEASE</version>
|
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
|
||||||
</parent>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>jodconverter-web</artifactId>
|
|
||||||
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
|
||||||
<java.version>1.8</java.version>
|
|
||||||
<ufile.sdk.verison>1.0-SNAPSHOT</ufile.sdk.verison>
|
|
||||||
<logging.path>${basedir}/target/classes/logs</logging.path>
|
|
||||||
<appName>file-preview</appName>
|
|
||||||
</properties>
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<!-- required for org.hyperic:sigar -->
|
|
||||||
<id>jboss-public-repository-group</id>
|
|
||||||
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-freemarker</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.logstash.logback</groupId>
|
|
||||||
<artifactId>logstash-logback-encoder</artifactId>
|
|
||||||
<version>4.11</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.yudianbank</groupId>
|
|
||||||
<artifactId>jodconverter-core</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>commons-io</artifactId>
|
|
||||||
<groupId>commons-io</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<!-- REDISSON -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.redisson</groupId>
|
|
||||||
<artifactId>redisson</artifactId>
|
|
||||||
<version>3.2.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.poi</groupId>
|
|
||||||
<artifactId>poi</artifactId>
|
|
||||||
<version>3.12</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.poi</groupId>
|
|
||||||
<artifactId>poi-scratchpad</artifactId>
|
|
||||||
<version>3.12</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>fr.opensagres.xdocreport</groupId>
|
|
||||||
<artifactId>org.apache.poi.xwpf.converter.core</artifactId>
|
|
||||||
<version>1.0.5</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>poi</artifactId>
|
|
||||||
<groupId>org.apache.poi</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>fr.opensagres.xdocreport</groupId>
|
|
||||||
<artifactId>org.apache.poi.xwpf.converter.xhtml</artifactId>
|
|
||||||
<version>1.0.5</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>fr.opensagres.xdocreport</groupId>
|
|
||||||
<artifactId>fr.opensagres.xdocreport.document</artifactId>
|
|
||||||
<version>1.0.5</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-io</groupId>
|
|
||||||
<artifactId>commons-io</artifactId>
|
|
||||||
<version>2.4</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- 解压(apache) -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-compress</artifactId>
|
|
||||||
<version>1.9</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- 解压(rar)-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.junrar</groupId>
|
|
||||||
<artifactId>junrar</artifactId>
|
|
||||||
<version>0.7</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.sourceforge.jchardet</groupId>
|
|
||||||
<artifactId>jchardet</artifactId>
|
|
||||||
<version>1.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>antlr</groupId>
|
|
||||||
<artifactId>antlr</artifactId>
|
|
||||||
<version>2.7.7</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-httpclient</groupId>
|
|
||||||
<artifactId>commons-httpclient</artifactId>
|
|
||||||
<version>3.1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-cli</groupId>
|
|
||||||
<artifactId>commons-cli</artifactId>
|
|
||||||
<version>1.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.thoughtworks.xstream</groupId>
|
|
||||||
<artifactId>xstream</artifactId>
|
|
||||||
<version>1.3.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
<version>19.0</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<includes>
|
|
||||||
<include>**/*</include>
|
|
||||||
</includes>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package com.yudianbank;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
|
||||||
@EnableScheduling
|
|
||||||
@ComponentScan(value = "com.yudianbank.*")
|
|
||||||
public class FilePreviewApplication {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
Properties properties = System.getProperties();
|
|
||||||
System.out.println(properties.get("user.dir"));
|
|
||||||
SpringApplication.run(FilePreviewApplication.class, args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,211 +0,0 @@
|
|||||||
package com.yudianbank.extend;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.sun.star.beans.PropertyValue;
|
|
||||||
import org.artofsolving.jodconverter.document.DocumentFamily;
|
|
||||||
import org.artofsolving.jodconverter.document.DocumentFormat;
|
|
||||||
import org.artofsolving.jodconverter.document.SimpleDocumentFormatRegistry;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重写了DefaultDocumentFormatRegistry类,因为要添加自定义行为,比如字符编码。。。
|
|
||||||
* @author yudian-it
|
|
||||||
* @date 2017/12/5
|
|
||||||
*/
|
|
||||||
public class ControlDocumentFormatRegistry extends SimpleDocumentFormatRegistry {
|
|
||||||
|
|
||||||
public ControlDocumentFormatRegistry() {
|
|
||||||
DocumentFormat pdf = new DocumentFormat("Portable Document Format", "pdf", "application/pdf");
|
|
||||||
pdf.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "writer_pdf_Export"));
|
|
||||||
pdf.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "calc_pdf_Export"));
|
|
||||||
pdf.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "impress_pdf_Export"));
|
|
||||||
pdf.setStoreProperties(DocumentFamily.DRAWING, Collections.singletonMap("FilterName", "draw_pdf_Export"));
|
|
||||||
addFormat(pdf);
|
|
||||||
|
|
||||||
DocumentFormat swf = new DocumentFormat("Macromedia Flash", "swf", "application/x-shockwave-flash");
|
|
||||||
swf.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "impress_flash_Export"));
|
|
||||||
swf.setStoreProperties(DocumentFamily.DRAWING, Collections.singletonMap("FilterName", "draw_flash_Export"));
|
|
||||||
addFormat(swf);
|
|
||||||
|
|
||||||
// disabled because it's not always available
|
|
||||||
//DocumentFormat xhtml = new DocumentFormat("XHTML", "xhtml", "application/xhtml+xml");
|
|
||||||
//xhtml.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "XHTML Writer File"));
|
|
||||||
//xhtml.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "XHTML Calc File"));
|
|
||||||
//xhtml.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "XHTML Impress File"));
|
|
||||||
//addFormat(xhtml);
|
|
||||||
|
|
||||||
DocumentFormat html = new DocumentFormat("HTML", "html", "text/html");
|
|
||||||
// HTML is treated as Text when supplied as input, but as an output it is also
|
|
||||||
// available for exporting Spreadsheet and Presentation formats
|
|
||||||
html.setInputFamily(DocumentFamily.TEXT);
|
|
||||||
html.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "HTML (StarWriter)"));
|
|
||||||
Map<String,Object> htmlLoadAndStoreProperties = new LinkedHashMap<String,Object>();
|
|
||||||
htmlLoadAndStoreProperties.put("FilterName", "HTML (StarCalc)");
|
|
||||||
htmlLoadAndStoreProperties.put("FilterOptions", "utf8");
|
|
||||||
html.setStoreProperties(DocumentFamily.SPREADSHEET, htmlLoadAndStoreProperties);
|
|
||||||
html.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "impress_html_Export"));
|
|
||||||
addFormat(html);
|
|
||||||
|
|
||||||
DocumentFormat odt = new DocumentFormat("OpenDocument Text", "odt", "application/vnd.oasis.opendocument.text");
|
|
||||||
odt.setInputFamily(DocumentFamily.TEXT);
|
|
||||||
odt.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "writer8"));
|
|
||||||
addFormat(odt);
|
|
||||||
|
|
||||||
DocumentFormat sxw = new DocumentFormat("OpenOffice.org 1.0 Text Document", "sxw", "application/vnd.sun.xml.writer");
|
|
||||||
sxw.setInputFamily(DocumentFamily.TEXT);
|
|
||||||
sxw.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "StarOffice XML (Writer)"));
|
|
||||||
addFormat(sxw);
|
|
||||||
|
|
||||||
DocumentFormat doc = new DocumentFormat("Microsoft Word", "doc", "application/msword");
|
|
||||||
doc.setInputFamily(DocumentFamily.TEXT);
|
|
||||||
doc.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "MS Word 97"));
|
|
||||||
addFormat(doc);
|
|
||||||
|
|
||||||
DocumentFormat docx = new DocumentFormat("Microsoft Word 2007 XML", "docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
|
||||||
docx.setInputFamily(DocumentFamily.TEXT);
|
|
||||||
addFormat(docx);
|
|
||||||
|
|
||||||
DocumentFormat rtf = new DocumentFormat("Rich Text Format", "rtf", "text/rtf");
|
|
||||||
rtf.setInputFamily(DocumentFamily.TEXT);
|
|
||||||
rtf.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "Rich Text Format"));
|
|
||||||
addFormat(rtf);
|
|
||||||
|
|
||||||
DocumentFormat wpd = new DocumentFormat("WordPerfect", "wpd", "application/wordperfect");
|
|
||||||
wpd.setInputFamily(DocumentFamily.TEXT);
|
|
||||||
addFormat(wpd);
|
|
||||||
|
|
||||||
DocumentFormat txt = new DocumentFormat("Plain Text", "txt", "text/plain");
|
|
||||||
txt.setInputFamily(DocumentFamily.TEXT);
|
|
||||||
Map<String,Object> txtLoadAndStoreProperties = new LinkedHashMap<String,Object>();
|
|
||||||
txtLoadAndStoreProperties.put("FilterName", "Text (encoded)");
|
|
||||||
txtLoadAndStoreProperties.put("FilterOptions", "utf8");
|
|
||||||
txt.setLoadProperties(txtLoadAndStoreProperties);
|
|
||||||
txt.setStoreProperties(DocumentFamily.TEXT, txtLoadAndStoreProperties);
|
|
||||||
addFormat(txt);
|
|
||||||
|
|
||||||
DocumentFormat wikitext = new DocumentFormat("MediaWiki wikitext", "wiki", "text/x-wiki");
|
|
||||||
wikitext.setStoreProperties(DocumentFamily.TEXT, Collections.singletonMap("FilterName", "MediaWiki"));
|
|
||||||
//addFormat(wikitext);
|
|
||||||
|
|
||||||
DocumentFormat ods = new DocumentFormat("OpenDocument Spreadsheet", "ods", "application/vnd.oasis.opendocument.spreadsheet");
|
|
||||||
ods.setInputFamily(DocumentFamily.SPREADSHEET);
|
|
||||||
ods.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "calc8"));
|
|
||||||
addFormat(ods);
|
|
||||||
|
|
||||||
DocumentFormat sxc = new DocumentFormat("OpenOffice.org 1.0 Spreadsheet", "sxc", "application/vnd.sun.xml.calc");
|
|
||||||
sxc.setInputFamily(DocumentFamily.SPREADSHEET);
|
|
||||||
sxc.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "StarOffice XML (Calc)"));
|
|
||||||
addFormat(sxc);
|
|
||||||
|
|
||||||
DocumentFormat xls = new DocumentFormat("Microsoft Excel", "xls", "application/vnd.ms-excel");
|
|
||||||
xls.setInputFamily(DocumentFamily.SPREADSHEET);
|
|
||||||
xls.setStoreProperties(DocumentFamily.SPREADSHEET, Collections.singletonMap("FilterName", "MS Excel 97"));
|
|
||||||
addFormat(xls);
|
|
||||||
|
|
||||||
DocumentFormat xlsx = new DocumentFormat("Microsoft Excel 2007 XML", "xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
||||||
xlsx.setInputFamily(DocumentFamily.SPREADSHEET);
|
|
||||||
addFormat(xlsx);
|
|
||||||
|
|
||||||
DocumentFormat csv = new DocumentFormat("Comma Separated Values", "csv", "text/csv");
|
|
||||||
csv.setInputFamily(DocumentFamily.SPREADSHEET);
|
|
||||||
Map<String,Object> csvLoadAndStoreProperties = new LinkedHashMap<String,Object>();
|
|
||||||
csvLoadAndStoreProperties.put("FilterName", "Text - txt - csv (StarCalc)");
|
|
||||||
csvLoadAndStoreProperties.put("FilterOptions", "44,34,0"); // Field Separator: ','; Text Delimiter: '"'
|
|
||||||
csv.setLoadProperties(csvLoadAndStoreProperties);
|
|
||||||
csv.setStoreProperties(DocumentFamily.SPREADSHEET, csvLoadAndStoreProperties);
|
|
||||||
addFormat(csv);
|
|
||||||
|
|
||||||
DocumentFormat tsv = new DocumentFormat("Tab Separated Values", "tsv", "text/tab-separated-values");
|
|
||||||
tsv.setInputFamily(DocumentFamily.SPREADSHEET);
|
|
||||||
Map<String,Object> tsvLoadAndStoreProperties = new LinkedHashMap<String,Object>();
|
|
||||||
tsvLoadAndStoreProperties.put("FilterName", "Text - txt - csv (StarCalc)");
|
|
||||||
tsvLoadAndStoreProperties.put("FilterOptions", "9,34,0"); // Field Separator: '\t'; Text Delimiter: '"'
|
|
||||||
tsv.setLoadProperties(tsvLoadAndStoreProperties);
|
|
||||||
tsv.setStoreProperties(DocumentFamily.SPREADSHEET, tsvLoadAndStoreProperties);
|
|
||||||
addFormat(tsv);
|
|
||||||
|
|
||||||
DocumentFormat odp = new DocumentFormat("OpenDocument Presentation", "odp", "application/vnd.oasis.opendocument.presentation");
|
|
||||||
odp.setInputFamily(DocumentFamily.PRESENTATION);
|
|
||||||
odp.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "impress8"));
|
|
||||||
addFormat(odp);
|
|
||||||
|
|
||||||
DocumentFormat sxi = new DocumentFormat("OpenOffice.org 1.0 Presentation", "sxi", "application/vnd.sun.xml.impress");
|
|
||||||
sxi.setInputFamily(DocumentFamily.PRESENTATION);
|
|
||||||
sxi.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "StarOffice XML (Impress)"));
|
|
||||||
addFormat(sxi);
|
|
||||||
|
|
||||||
DocumentFormat ppt = new DocumentFormat("Microsoft PowerPoint", "ppt", "application/vnd.ms-powerpoint");
|
|
||||||
ppt.setInputFamily(DocumentFamily.PRESENTATION);
|
|
||||||
ppt.setStoreProperties(DocumentFamily.PRESENTATION, Collections.singletonMap("FilterName", "MS PowerPoint 97"));
|
|
||||||
addFormat(ppt);
|
|
||||||
|
|
||||||
DocumentFormat pptx = new DocumentFormat("Microsoft PowerPoint 2007 XML", "pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
|
|
||||||
pptx.setInputFamily(DocumentFamily.PRESENTATION);
|
|
||||||
addFormat(pptx);
|
|
||||||
|
|
||||||
DocumentFormat odg = new DocumentFormat("OpenDocument Drawing", "odg", "application/vnd.oasis.opendocument.graphics");
|
|
||||||
odg.setInputFamily(DocumentFamily.DRAWING);
|
|
||||||
odg.setStoreProperties(DocumentFamily.DRAWING, Collections.singletonMap("FilterName", "draw8"));
|
|
||||||
addFormat(odg);
|
|
||||||
|
|
||||||
DocumentFormat svg = new DocumentFormat("Scalable Vector Graphics", "svg", "image/svg+xml");
|
|
||||||
svg.setStoreProperties(DocumentFamily.DRAWING, Collections.singletonMap("FilterName", "draw_svg_Export"));
|
|
||||||
addFormat(svg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建默认的导出属性
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private PropertyValue[] getCommonPropertyValue() {
|
|
||||||
PropertyValue[] aFilterData = new PropertyValue[11];
|
|
||||||
// 不显示文档标题
|
|
||||||
aFilterData[0] = new PropertyValue();
|
|
||||||
aFilterData[0].Name = "DisplayPDFDocumentTitle";
|
|
||||||
aFilterData[0].Value= true;
|
|
||||||
// 导出文件编码方式
|
|
||||||
aFilterData[1] = new PropertyValue();
|
|
||||||
aFilterData[1].Name = "Encoding";
|
|
||||||
aFilterData[1].Value= "UTF-8";
|
|
||||||
// 隐藏工具条
|
|
||||||
aFilterData[2] = new PropertyValue();
|
|
||||||
aFilterData[2].Name = "HideViewerToolbar";
|
|
||||||
aFilterData[2].Value= false;
|
|
||||||
// 隐藏窗口控制条
|
|
||||||
aFilterData[3] = new PropertyValue();
|
|
||||||
aFilterData[3].Name = "HideViewerWindowControls";
|
|
||||||
aFilterData[3].Value= true;
|
|
||||||
// 全屏展示
|
|
||||||
aFilterData[4] = new PropertyValue();
|
|
||||||
aFilterData[4].Name = "OpenInFullScreenMode";
|
|
||||||
aFilterData[4].Value= false;
|
|
||||||
// 第一页左边展示
|
|
||||||
aFilterData[5] = new PropertyValue();
|
|
||||||
aFilterData[5].Name = "MathToMathType";
|
|
||||||
aFilterData[5].Value= true;
|
|
||||||
// 文档标题内容
|
|
||||||
aFilterData[6] = new PropertyValue();
|
|
||||||
aFilterData[6].Name = "Watermark";
|
|
||||||
aFilterData[6].Value= "KEKING.CN";
|
|
||||||
// 导出文件编码方式
|
|
||||||
aFilterData[7] = new PropertyValue();
|
|
||||||
aFilterData[7].Name = "CharacterSet";
|
|
||||||
aFilterData[7].Value= "UTF-8";
|
|
||||||
// 导出文件编码方式
|
|
||||||
aFilterData[8] = new PropertyValue();
|
|
||||||
aFilterData[8].Name = "Encoding";
|
|
||||||
aFilterData[8].Value= "UTF-8";
|
|
||||||
// 导出文件编码方式
|
|
||||||
aFilterData[9] = new PropertyValue();
|
|
||||||
aFilterData[9].Name = "CharSet";
|
|
||||||
aFilterData[9].Value= "UTF-8";
|
|
||||||
// 导出文件编码方式
|
|
||||||
aFilterData[10] = new PropertyValue();
|
|
||||||
aFilterData[10].Name = "charset";
|
|
||||||
aFilterData[10].Value= "UTF-8";
|
|
||||||
return aFilterData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package com.yudianbank.filters;
|
|
||||||
|
|
||||||
import javax.servlet.*;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author yudian-it
|
|
||||||
* @date 2017/11/30
|
|
||||||
*/
|
|
||||||
public class ChinesePathFilter implements Filter {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(FilterConfig filterConfig) throws ServletException {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
|
||||||
request.setCharacterEncoding("UTF-8");
|
|
||||||
response.setCharacterEncoding("UTF-8");
|
|
||||||
StringBuilder pathBuilder = new StringBuilder();
|
|
||||||
pathBuilder.append(request.getScheme()).append("://").append(request.getServerName()).append(":")
|
|
||||||
.append(request.getServerPort()).append(((HttpServletRequest)request).getContextPath()).append("/");
|
|
||||||
request.setAttribute("baseUrl", pathBuilder.toString());
|
|
||||||
chain.doFilter(request, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package com.yudianbank.filters;
|
|
||||||
|
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author yudian-it
|
|
||||||
* @date 2017/11/30
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class FilterConfiguration {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public FilterRegistrationBean getChinesePathFilter(){
|
|
||||||
ChinesePathFilter filter = new ChinesePathFilter();
|
|
||||||
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
|
|
||||||
registrationBean.setFilter(filter);
|
|
||||||
return registrationBean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
package com.yudianbank.param;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接口返回值结构
|
|
||||||
* @author yudian-it
|
|
||||||
* @date 2017/11/17
|
|
||||||
*/
|
|
||||||
public class ReturnResponse<T> implements Serializable{
|
|
||||||
private static final long serialVersionUID = 313975329998789878L;
|
|
||||||
/**
|
|
||||||
* 返回状态
|
|
||||||
* 0. 成功
|
|
||||||
* 1. 失败
|
|
||||||
*/
|
|
||||||
private int code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回状态描述
|
|
||||||
* XXX成功
|
|
||||||
* XXX失败
|
|
||||||
*/
|
|
||||||
private String msg;
|
|
||||||
|
|
||||||
private T content;
|
|
||||||
|
|
||||||
public ReturnResponse(int code, String msg, T content) {
|
|
||||||
this.code = code;
|
|
||||||
this.msg = msg;
|
|
||||||
this.content = content;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCode(int code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMsg() {
|
|
||||||
return msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMsg(String msg) {
|
|
||||||
this.msg = msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public T getContent() {
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContent(T content) {
|
|
||||||
this.content = content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import com.sun.star.document.UpdateDocMode;
|
|
||||||
import com.yudianbank.extend.ControlDocumentFormatRegistry;
|
|
||||||
import org.artofsolving.jodconverter.OfficeDocumentConverter;
|
|
||||||
import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
|
|
||||||
import org.artofsolving.jodconverter.office.OfficeManager;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建文件转换器
|
|
||||||
*
|
|
||||||
* @author yudian-it
|
|
||||||
* @date 2017/11/13
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class ConverterUtils {
|
|
||||||
|
|
||||||
@Value("${office.home}")
|
|
||||||
String officeHome;
|
|
||||||
// OpenOfficeConnection connection;
|
|
||||||
OfficeManager officeManager;
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void initOfficeManager() {
|
|
||||||
//// connection = new SocketOpenOfficeConnection(host,8100);
|
|
||||||
//// connection.connect();
|
|
||||||
DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
|
|
||||||
configuration.setOfficeHome(officeHome);
|
|
||||||
configuration.setPortNumber(8100);
|
|
||||||
officeManager = configuration.buildOfficeManager();
|
|
||||||
officeManager.start();
|
|
||||||
// 设置任务执行超时为5分钟
|
|
||||||
// configuration.setTaskExecutionTimeout(1000 * 60 * 5L);//
|
|
||||||
// 设置任务队列超时为24小时
|
|
||||||
// configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);//
|
|
||||||
}
|
|
||||||
|
|
||||||
public OfficeDocumentConverter getDocumentConverter() {
|
|
||||||
OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager, new ControlDocumentFormatRegistry());
|
|
||||||
converter.setDefaultLoadProperties(getLoadProperties());
|
|
||||||
return converter;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Map<String,?> getLoadProperties() {
|
|
||||||
Map<String,Object> loadProperties = new HashMap<>(10);
|
|
||||||
loadProperties.put("Hidden", true);
|
|
||||||
loadProperties.put("ReadOnly", true);
|
|
||||||
loadProperties.put("UpdateDocMode", UpdateDocMode.QUIET_UPDATE);
|
|
||||||
loadProperties.put("CharacterSet", Charset.forName("UTF-8").name());
|
|
||||||
return loadProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
public void destroyOfficeManager(){
|
|
||||||
if (null != officeManager && officeManager.isRunning()) {
|
|
||||||
officeManager.stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
public class DeleteFileUtil {
|
|
||||||
/**
|
|
||||||
* 删除单个文件
|
|
||||||
*
|
|
||||||
* @param fileName
|
|
||||||
* 要删除的文件的文件名
|
|
||||||
* @return 单个文件删除成功返回true,否则返回false
|
|
||||||
*/
|
|
||||||
public static boolean deleteFile(String fileName) {
|
|
||||||
File file = new File(fileName);
|
|
||||||
// 如果文件路径所对应的文件存在,并且是一个文件,则直接删除
|
|
||||||
if (file.exists() && file.isFile()) {
|
|
||||||
if (file.delete()) {
|
|
||||||
System.out.println("删除单个文件" + fileName + "成功!");
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
System.out.println("删除单个文件" + fileName + "失败!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
System.out.println("删除单个文件失败:" + fileName + "不存在!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除目录及目录下的文件
|
|
||||||
*
|
|
||||||
* @param dir
|
|
||||||
* 要删除的目录的文件路径
|
|
||||||
* @return 目录删除成功返回true,否则返回false
|
|
||||||
*/
|
|
||||||
public static boolean deleteDirectory(String dir) {
|
|
||||||
// 如果dir不以文件分隔符结尾,自动添加文件分隔符
|
|
||||||
if (!dir.endsWith(File.separator)) {
|
|
||||||
dir = dir + File.separator;
|
|
||||||
}
|
|
||||||
File dirFile = new File(dir);
|
|
||||||
// 如果dir对应的文件不存在,或者不是一个目录,则退出
|
|
||||||
if ((!dirFile.exists()) || (!dirFile.isDirectory())) {
|
|
||||||
System.out.println("删除目录失败:" + dir + "不存在!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
boolean flag = true;
|
|
||||||
// 删除文件夹中的所有文件包括子目录
|
|
||||||
File[] files = dirFile.listFiles();
|
|
||||||
for (int i = 0; i < files.length; i++) {
|
|
||||||
// 删除子文件
|
|
||||||
if (files[i].isFile()) {
|
|
||||||
flag = DeleteFileUtil.deleteFile(files[i].getAbsolutePath());
|
|
||||||
if (!flag)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// 删除子目录
|
|
||||||
else if (files[i].isDirectory()) {
|
|
||||||
flag = DeleteFileUtil.deleteDirectory(files[i]
|
|
||||||
.getAbsolutePath());
|
|
||||||
if (!flag)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!flag) {
|
|
||||||
System.out.println("删除目录失败!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import com.yudianbank.param.ReturnResponse;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import java.io.*;
|
|
||||||
import java.net.*;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yudian-it
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class DownloadUtils {
|
|
||||||
|
|
||||||
@Value("${file.dir}")
|
|
||||||
String fileDir;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 一开始测试的时候发现有些文件没有下载下来,而有些可以;当时也是郁闷了好一阵,但是最终还是不得解
|
|
||||||
* 再次测试的时候,通过前台对比url发现,原来参数中有+号特殊字符存在,但是到后之后却变成了空格,突然恍然大悟
|
|
||||||
* 应该是转义出了问题,url转义中会把+号当成空格来计算,所以才会出现这种情况,遂想要通过整体替换空格为加号,因为url
|
|
||||||
* 中的参数部分是不会出现空格的,但是文件名中就不好确定了,所以只对url参数部分做替换
|
|
||||||
* 注: 针对URLEncoder.encode(s,charset)会将空格转成+的情况需要做下面的替换工作
|
|
||||||
* @param urlAddress
|
|
||||||
* @param type
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public ReturnResponse<String> downLoad(String urlAddress, String type, String fileName){
|
|
||||||
ReturnResponse<String> response = new ReturnResponse<>(0, "下载成功!!!", "");
|
|
||||||
URL url = null;
|
|
||||||
try {
|
|
||||||
urlAddress = replacePlusMark(urlAddress);
|
|
||||||
urlAddress = encodeUrlParam(urlAddress);
|
|
||||||
// 因为tomcat不能处理'+'号,所以讲'+'号替换成'%20%'
|
|
||||||
urlAddress = urlAddress.replaceAll("\\+", "%20");
|
|
||||||
url = new URL(urlAddress);
|
|
||||||
} catch (MalformedURLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
UUID uuid = UUID.randomUUID();
|
|
||||||
if (null == fileName) {
|
|
||||||
fileName = uuid+ "."+type;
|
|
||||||
}else { // 文件后缀不一致时,以type为准(针对simText【将类txt文件转为txt】)
|
|
||||||
fileName = fileName.replace(fileName.substring(fileName.lastIndexOf(".") + 1), type);
|
|
||||||
}
|
|
||||||
String realPath = fileDir + fileName;
|
|
||||||
File dirFile = new File(fileDir);
|
|
||||||
if (!dirFile.exists()) {
|
|
||||||
dirFile.mkdirs();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
URLConnection connection = url.openConnection();
|
|
||||||
InputStream in = connection.getInputStream();
|
|
||||||
|
|
||||||
FileOutputStream os = new FileOutputStream(realPath);
|
|
||||||
byte[] buffer = new byte[4 * 1024];
|
|
||||||
int read;
|
|
||||||
while ((read = in.read(buffer)) > 0) {
|
|
||||||
os.write(buffer, 0, read);
|
|
||||||
}
|
|
||||||
os.close();
|
|
||||||
in.close();
|
|
||||||
response.setContent(realPath);
|
|
||||||
// 同样针对类txt文件,如果成功msg包含的是转换后的文件名
|
|
||||||
response.setMsg(fileName);
|
|
||||||
|
|
||||||
// txt转换文件编码为utf8
|
|
||||||
if("txt".equals(type)){
|
|
||||||
convertTextPlainFileCharsetToUtf8(realPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
response.setCode(1);
|
|
||||||
response.setContent(null);
|
|
||||||
if (e instanceof FileNotFoundException) {
|
|
||||||
response.setMsg("文件不存在!!!");
|
|
||||||
}else {
|
|
||||||
response.setMsg(e.getMessage());
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注:可能是原来因为前端通过encodeURI来编码的,因为通过encodeURI编码+会被转成+号(亦即没有转),
|
|
||||||
* 而通过encodeURIComponent则会转成%2B,这样URLDecoder是可以正确处理的,所以也就没有必要在这里替换了
|
|
||||||
* 转换url参数部分的空格为加号(因为在url编解码的过程中出现+转为空格的情况)
|
|
||||||
* @param urlAddress
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String replacePlusMark(String urlAddress) {
|
|
||||||
if (urlAddress.contains("?")) {
|
|
||||||
String nonParamStr = urlAddress.substring(0,urlAddress.indexOf("?") + 1);
|
|
||||||
String paramStr = urlAddress.substring(nonParamStr.length());
|
|
||||||
return nonParamStr + paramStr.replace(" ", "+");
|
|
||||||
}
|
|
||||||
return urlAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对最有一个路径进行转码
|
|
||||||
* @param urlAddress
|
|
||||||
* http://192.168.2.111:8013/demo/Handle中文.zip
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String encodeUrlParam(String urlAddress) {
|
|
||||||
String newUrl = "";
|
|
||||||
try {
|
|
||||||
String path = "";
|
|
||||||
String param = "";
|
|
||||||
if (urlAddress.contains("?")) {
|
|
||||||
path = urlAddress.substring(0, urlAddress.indexOf("?"));
|
|
||||||
param = urlAddress.substring(urlAddress.indexOf("?"));
|
|
||||||
}else {
|
|
||||||
path = urlAddress;
|
|
||||||
}
|
|
||||||
String lastPath = path.substring(path.lastIndexOf("/") + 1);
|
|
||||||
String leftPath = path.substring(0, path.lastIndexOf("/") + 1);
|
|
||||||
String encodeLastPath = URLEncoder.encode(lastPath, "UTF-8");
|
|
||||||
newUrl += leftPath + encodeLastPath;
|
|
||||||
if (urlAddress.contains("?")) {
|
|
||||||
newUrl += param;
|
|
||||||
}
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return newUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 因为jodConvert2.1不支持ms2013版本的office转换,这里偷懒,尝试看改一下文件类型,让jodConvert2.1去
|
|
||||||
* 处理ms2013,看结果如何,如果问题很大的话只能采取其他方式,如果没有问题,暂时使用该版本来转换
|
|
||||||
* @param type
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String dealWithMS2013(String type) {
|
|
||||||
String newType = null;
|
|
||||||
switch (type){
|
|
||||||
case "docx":
|
|
||||||
newType = "doc";
|
|
||||||
break;
|
|
||||||
case "xlsx":
|
|
||||||
newType = "doc";
|
|
||||||
break;
|
|
||||||
case "pptx":
|
|
||||||
newType = "ppt";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
newType = type;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return newType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 转换文本文件编码为utf8
|
|
||||||
* 探测源文件编码,探测到编码切不为utf8则进行转码
|
|
||||||
* @param filePath 文件路径
|
|
||||||
*/
|
|
||||||
private static void convertTextPlainFileCharsetToUtf8(String filePath) throws IOException {
|
|
||||||
File sourceFile = new File(filePath);
|
|
||||||
if(sourceFile.exists() && sourceFile.isFile() && sourceFile.canRead()) {
|
|
||||||
String encoding = null;
|
|
||||||
try {
|
|
||||||
FileCharsetDetector.Observer observer = FileCharsetDetector.guessFileEncoding(sourceFile);
|
|
||||||
// 为准确探测到编码,不适用猜测的编码
|
|
||||||
encoding = observer.isFound()?observer.getEncoding():null;
|
|
||||||
// 为准确探测到编码,可以考虑使用GBK 大部分文件都是windows系统产生的
|
|
||||||
} catch (IOException e) {
|
|
||||||
// 编码探测失败,
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if(encoding != null && !"UTF-8".equals(encoding)){
|
|
||||||
// 不为utf8,进行转码
|
|
||||||
File tmpUtf8File = new File(filePath+".utf8");
|
|
||||||
Writer writer = new OutputStreamWriter(new FileOutputStream(tmpUtf8File),"UTF-8");
|
|
||||||
Reader reader = new BufferedReader(new InputStreamReader(new FileInputStream(sourceFile),encoding));
|
|
||||||
char[] buf = new char[1024];
|
|
||||||
int read;
|
|
||||||
while ((read = reader.read(buf)) > 0){
|
|
||||||
writer.write(buf, 0, read);
|
|
||||||
}
|
|
||||||
reader.close();
|
|
||||||
writer.close();
|
|
||||||
// 删除源文件
|
|
||||||
sourceFile.delete();
|
|
||||||
// 重命名
|
|
||||||
tmpUtf8File.renameTo(sourceFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import org.mozilla.intl.chardet.nsDetector;
|
|
||||||
import org.mozilla.intl.chardet.nsICharsetDetectionObserver;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文本文件编码探测工具类
|
|
||||||
*
|
|
||||||
* @author HWliao
|
|
||||||
* @date 2017-12-24
|
|
||||||
*/
|
|
||||||
public class FileCharsetDetector {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 传入一个文件(File)对象,检查文件编码
|
|
||||||
*
|
|
||||||
* @param file File对象实例
|
|
||||||
* @return 文件编码,若无,则返回null
|
|
||||||
* @throws FileNotFoundException
|
|
||||||
* @throws IOException
|
|
||||||
*/
|
|
||||||
public static Observer guessFileEncoding(File file)
|
|
||||||
throws FileNotFoundException, IOException {
|
|
||||||
return guessFileEncoding(file, new nsDetector());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <pre>
|
|
||||||
* 获取文件的编码
|
|
||||||
* @param file
|
|
||||||
* File对象实例
|
|
||||||
* @param languageHint
|
|
||||||
* 语言提示区域代码 @see #nsPSMDetector ,取值如下:
|
|
||||||
* 1 : Japanese
|
|
||||||
* 2 : Chinese
|
|
||||||
* 3 : Simplified Chinese
|
|
||||||
* 4 : Traditional Chinese
|
|
||||||
* 5 : Korean
|
|
||||||
* 6 : Dont know(default)
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @return 文件编码,eg:UTF-8,GBK,GB2312形式(不确定的时候,返回可能的字符编码序列);若无,则返回null
|
|
||||||
* @throws FileNotFoundException
|
|
||||||
* @throws IOException
|
|
||||||
*/
|
|
||||||
public static Observer guessFileEncoding(File file, int languageHint)
|
|
||||||
throws FileNotFoundException, IOException {
|
|
||||||
return guessFileEncoding(file, new nsDetector(languageHint));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文件的编码
|
|
||||||
*
|
|
||||||
* @param file
|
|
||||||
* @param det
|
|
||||||
* @return
|
|
||||||
* @throws FileNotFoundException
|
|
||||||
* @throws IOException
|
|
||||||
*/
|
|
||||||
private static Observer guessFileEncoding(File file, nsDetector det)
|
|
||||||
throws FileNotFoundException, IOException {
|
|
||||||
// new Observer
|
|
||||||
Observer observer = new Observer();
|
|
||||||
// set Observer
|
|
||||||
// The Notify() will be called when a matching charset is found.
|
|
||||||
det.Init(observer);
|
|
||||||
|
|
||||||
BufferedInputStream imp = new BufferedInputStream(new FileInputStream(
|
|
||||||
file));
|
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
int len;
|
|
||||||
boolean done = false;
|
|
||||||
boolean isAscii = false;
|
|
||||||
|
|
||||||
while ((len = imp.read(buf, 0, buf.length)) != -1) {
|
|
||||||
// Check if the stream is only ascii.
|
|
||||||
isAscii = det.isAscii(buf, len);
|
|
||||||
if (isAscii) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// DoIt if non-ascii and not done yet.
|
|
||||||
done = det.DoIt(buf, len, false);
|
|
||||||
if (done) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
imp.close();
|
|
||||||
det.DataEnd();
|
|
||||||
|
|
||||||
if (isAscii) {
|
|
||||||
observer.encoding = "ASCII";
|
|
||||||
observer.found = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!observer.isFound()) {
|
|
||||||
String[] prob = det.getProbableCharsets();
|
|
||||||
// // 这里将可能的字符集组合起来返回
|
|
||||||
// for (int i = 0; i < prob.length; i++) {
|
|
||||||
// if (i == 0) {
|
|
||||||
// encoding = prob[i];
|
|
||||||
// } else {
|
|
||||||
// encoding += "," + prob[i];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
if (prob.length > 0) {
|
|
||||||
// 在没有发现情况下,去第一个可能的编码
|
|
||||||
observer.encoding = prob[0];
|
|
||||||
} else {
|
|
||||||
observer.encoding = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return observer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author liaohongwei
|
|
||||||
* @Description: 文件字符编码观察者, 但判断出字符编码时候调用
|
|
||||||
* @date 2016年6月20日 下午2:27:06
|
|
||||||
*/
|
|
||||||
public static class Observer implements nsICharsetDetectionObserver {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields encoding : 字符编码
|
|
||||||
*/
|
|
||||||
private String encoding = null;
|
|
||||||
/**
|
|
||||||
* @Fields found : 是否找到字符集
|
|
||||||
*/
|
|
||||||
private boolean found = false;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void Notify(String charset) {
|
|
||||||
this.encoding = charset;
|
|
||||||
this.found = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEncoding() {
|
|
||||||
return encoding;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isFound() {
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Observer [encoding=" + encoding + ", found=" + found + "]";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import org.redisson.api.RMapCache;
|
|
||||||
import org.redisson.api.RedissonClient;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author yudian-it
|
|
||||||
* @date 2017/11/13
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class FileUtils {
|
|
||||||
|
|
||||||
final String REDIS_FILE_PREVIEW_PDF_KEY = "converted-preview-pdf-file";
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
RedissonClient redissonClient;
|
|
||||||
@Value("${file.dir}")
|
|
||||||
String fileDir;
|
|
||||||
|
|
||||||
@Value("${converted.file.charset}")
|
|
||||||
String charset;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 已转换过的文件集合(redis缓存)
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Map<String, String> listConvertedFiles() {
|
|
||||||
RMapCache<String, String> convertedList = redissonClient.getMapCache(REDIS_FILE_PREVIEW_PDF_KEY);
|
|
||||||
return convertedList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 已转换过的文件,根据文件名获取
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getConvertedFile(String key) {
|
|
||||||
RMapCache<String, String> convertedList = redissonClient.getMapCache(REDIS_FILE_PREVIEW_PDF_KEY);
|
|
||||||
return convertedList.get(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 从url中剥离出文件名
|
|
||||||
* @param url
|
|
||||||
* 格式如:http://keking.ufile.ucloud.com.cn/20171113164107_月度绩效表模板(新).xls?UCloudPublicKey=ucloudtangshd@weifenf.com14355492830001993909323&Expires=&Signature=I D1NOFtAJSPT16E6imv6JWuq0k=
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getFileNameFromURL(String url) {
|
|
||||||
// 因为url的参数中可能会存在/的情况,所以直接url.lastIndexOf("/")会有问题
|
|
||||||
// 所以先从?处将url截断,然后运用url.lastIndexOf("/")获取文件名
|
|
||||||
String noQueryUrl = url.substring(0, url.indexOf("?") != -1 ? url.indexOf("?"): url.length());
|
|
||||||
String fileName = noQueryUrl.substring(noQueryUrl.lastIndexOf("/") + 1);
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文件后缀
|
|
||||||
* @param fileName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getSuffixFromFileName(String fileName) {
|
|
||||||
String suffix = fileName.substring(fileName.lastIndexOf("."));
|
|
||||||
return suffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 从路径中获取
|
|
||||||
* @param path
|
|
||||||
* 类似这种:C:\Users\yudian-it\Downloads
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getFileNameFromPath(String path) {
|
|
||||||
return path.substring(path.lastIndexOf(File.separator) + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> listPictureTypes(){
|
|
||||||
List<String> list = Lists.newArrayList();
|
|
||||||
list.add("jpg");
|
|
||||||
list.add("jpeg");
|
|
||||||
list.add("png");
|
|
||||||
list.add("gif");
|
|
||||||
list.add("bmp");
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> listArchiveTypes(){
|
|
||||||
List<String> list = Lists.newArrayList();
|
|
||||||
list.add("rar");
|
|
||||||
list.add("zip");
|
|
||||||
list.add("jar");
|
|
||||||
list.add("7-zip");
|
|
||||||
list.add("tar");
|
|
||||||
list.add("gzip");
|
|
||||||
list.add("7z");
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> listOfficeTypes() {
|
|
||||||
List<String> list = Lists.newArrayList();
|
|
||||||
list.add("docx");
|
|
||||||
list.add("doc");
|
|
||||||
list.add("xls");
|
|
||||||
list.add("xlsx");
|
|
||||||
list.add("ppt");
|
|
||||||
list.add("pptx");
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取相对路径
|
|
||||||
* @param absolutePath
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getRelativePath(String absolutePath) {
|
|
||||||
return absolutePath.substring(fileDir.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addConvertedFile(String fileName, String value){
|
|
||||||
RMapCache<String, String> convertedList = redissonClient.getMapCache(REDIS_FILE_PREVIEW_PDF_KEY);
|
|
||||||
convertedList.fastPut(fileName, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断文件编码格式
|
|
||||||
* @param path
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getFileEncodeUTFGBK(String path){
|
|
||||||
String enc = Charset.forName("GBK").name();
|
|
||||||
File file = new File(path);
|
|
||||||
InputStream in= null;
|
|
||||||
try {
|
|
||||||
in = new FileInputStream(file);
|
|
||||||
byte[] b = new byte[3];
|
|
||||||
in.read(b);
|
|
||||||
in.close();
|
|
||||||
if (b[0] == -17 && b[1] == -69 && b[2] == -65) {
|
|
||||||
enc = Charset.forName("UTF-8").name();
|
|
||||||
}
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
System.out.println("文件编码格式为:" + enc);
|
|
||||||
return enc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对转换后的文件进行操作(改变编码方式)
|
|
||||||
* @param outFilePath
|
|
||||||
*/
|
|
||||||
public void doActionConvertedFile(String outFilePath) {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
try (InputStream inputStream = new FileInputStream(outFilePath);
|
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, charset))){
|
|
||||||
String line;
|
|
||||||
while(null != (line = reader.readLine())){
|
|
||||||
if (line.contains("charset=gb2312")) {
|
|
||||||
line = line.replace("charset=gb2312", "charset=utf-8");
|
|
||||||
}
|
|
||||||
sb.append(line);
|
|
||||||
}
|
|
||||||
// 添加sheet控制头
|
|
||||||
sb.append("<script src=\"js/jquery-3.0.0.min.js\" type=\"text/javascript\"></script>");
|
|
||||||
sb.append("<script src=\"js/excel.header.js\" type=\"text/javascript\"></script>");
|
|
||||||
sb.append("<link rel=\"stylesheet\" href=\"http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css\">");
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
// 重新写入文件
|
|
||||||
try(FileOutputStream fos = new FileOutputStream(outFilePath);
|
|
||||||
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos))){
|
|
||||||
writer.write(sb.toString());
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
import org.artofsolving.jodconverter.OfficeDocumentConverter;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yudian-it
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class OfficeToPdf {
|
|
||||||
/**
|
|
||||||
* 获取OpenOffice.org 3的安装目录
|
|
||||||
*
|
|
||||||
* @return OpenOffice.org 3的安装目录
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
ConverterUtils converterUtils;
|
|
||||||
/**
|
|
||||||
* 使Office2003-2007全部格式的文档(.doc|.docx|.xls|.xlsx|.ppt|.pptx) 转化为pdf文件<br>
|
|
||||||
*
|
|
||||||
* @param inputFilePath
|
|
||||||
* 源文件路径,如:"e:/test.docx"
|
|
||||||
* @param outputFilePath
|
|
||||||
* 目标文件路径,如:"e:/test_docx.pdf"
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public boolean openOfficeToPDF(String inputFilePath, String outputFilePath) {
|
|
||||||
return office2pdf(inputFilePath, outputFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 转换文件
|
|
||||||
*
|
|
||||||
* @param inputFile
|
|
||||||
* @param outputFilePath_end
|
|
||||||
* @param inputFilePath
|
|
||||||
* @param outputFilePath
|
|
||||||
* @param converter
|
|
||||||
*/
|
|
||||||
public static void converterFile(File inputFile, String outputFilePath_end,
|
|
||||||
String inputFilePath, String outputFilePath,
|
|
||||||
OfficeDocumentConverter converter) {
|
|
||||||
File outputFile = new File(outputFilePath_end);
|
|
||||||
// 假如目标路径不存在,则新建该路径
|
|
||||||
if (!outputFile.getParentFile().exists()) {
|
|
||||||
outputFile.getParentFile().mkdirs();
|
|
||||||
}
|
|
||||||
converter.convert(inputFile, outputFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 使Office2003-2007全部格式的文档(.doc|.docx|.xls|.xlsx|.ppt|.pptx) 转化为pdf文件
|
|
||||||
*
|
|
||||||
* @param inputFilePath
|
|
||||||
* 源文件路径,如:"e:/test.docx"
|
|
||||||
* @param outputFilePath
|
|
||||||
* 目标文件路径,如:"e:/test_docx.pdf"
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public boolean office2pdf(String inputFilePath, String outputFilePath) {
|
|
||||||
boolean flag = false;
|
|
||||||
OfficeDocumentConverter converter = converterUtils.getDocumentConverter();
|
|
||||||
if (null != inputFilePath) {
|
|
||||||
File inputFile = new File(inputFilePath);
|
|
||||||
// 判断目标文件路径是否为空
|
|
||||||
if (null == outputFilePath) {
|
|
||||||
// 转换后的文件路径
|
|
||||||
String outputFilePath_end = getOutputFilePath(inputFilePath);
|
|
||||||
if (inputFile.exists()) {// 找不到源文件, 则返回
|
|
||||||
converterFile(inputFile, outputFilePath_end, inputFilePath,
|
|
||||||
outputFilePath, converter);
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (inputFile.exists()) {// 找不到源文件, 则返回
|
|
||||||
converterFile(inputFile, outputFilePath, inputFilePath,
|
|
||||||
outputFilePath, converter);
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// officeManager.stop();
|
|
||||||
} else {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取输出文件
|
|
||||||
*
|
|
||||||
* @param inputFilePath
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getOutputFilePath(String inputFilePath) {
|
|
||||||
String outputFilePath = inputFilePath.replaceAll("."
|
|
||||||
+ getPostfix(inputFilePath), ".pdf");
|
|
||||||
return outputFilePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取inputFilePath的后缀名,如:"e:/test.pptx"的后缀名为:"pptx"
|
|
||||||
*
|
|
||||||
* @param inputFilePath
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getPostfix(String inputFilePath) {
|
|
||||||
return inputFilePath.substring(inputFilePath.lastIndexOf(".") + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,194 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
|
||||||
import javax.xml.transform.OutputKeys;
|
|
||||||
import javax.xml.transform.Transformer;
|
|
||||||
import javax.xml.transform.TransformerException;
|
|
||||||
import javax.xml.transform.TransformerFactory;
|
|
||||||
import javax.xml.transform.dom.DOMSource;
|
|
||||||
import javax.xml.transform.stream.StreamResult;
|
|
||||||
|
|
||||||
import org.apache.poi.hssf.converter.ExcelToHtmlConverter;
|
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
||||||
import org.apache.poi.hwpf.converter.PicturesManager;
|
|
||||||
import org.apache.poi.hwpf.converter.WordToHtmlConverter;
|
|
||||||
import org.apache.poi.hwpf.usermodel.Picture;
|
|
||||||
import org.apache.poi.hwpf.usermodel.PictureType;
|
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
|
||||||
import org.apache.poi.ss.usermodel.Row;
|
|
||||||
import org.apache.poi.ss.usermodel.Sheet;
|
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
||||||
import org.w3c.dom.Document;
|
|
||||||
|
|
||||||
|
|
||||||
public class PoiExcelToHtml {
|
|
||||||
// String path = getClass().getClassLoader().getResource(".").getPath()+File.separator+"static"+File.separator;
|
|
||||||
public static void excelConvert(URL url) {
|
|
||||||
try {
|
|
||||||
String path = "";
|
|
||||||
|
|
||||||
// http://keking.ufile.ucloud.com.cn/20171101152525_左晓晖2017年9.xls?UCloudPublicKey=ucloudtangshd@weifenf.com14355492830001993909323&Expires=&Signature=1n8ASiYMcfiF30YHxwpzwfqmlM0=
|
|
||||||
// URL url = new URL("http://keking.ufile.ucloud.com.cn/20171101150322_运费贷信审资料(给予客户收集版).xlsx?UCloudPublicKey=ucloudtangshd@weifenf.com14355492830001993909323&Expires=&Signature=RRVFIICITMNFed1LQgB10WdKHiE=");
|
|
||||||
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
|
|
||||||
//设置超时间为3秒
|
|
||||||
conn.setConnectTimeout(3*1000);
|
|
||||||
//防止屏蔽程序抓取而返回403错误
|
|
||||||
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
|
|
||||||
//得到输入流
|
|
||||||
InputStream inputStream = conn.getInputStream();
|
|
||||||
HSSFWorkbook excelBook = new HSSFWorkbook(inputStream);
|
|
||||||
ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument());
|
|
||||||
excelToHtmlConverter.processWorkbook(excelBook);
|
|
||||||
List pics = excelBook.getAllPictures();
|
|
||||||
if (pics != null) {
|
|
||||||
for (int i = 0; i < pics.size(); i++) {
|
|
||||||
Picture pic = (Picture) pics.get(i);
|
|
||||||
try {
|
|
||||||
pic.writeImageContent(new FileOutputStream(path + pic.suggestFullFileName()));
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Document htmlDocument = excelToHtmlConverter.getDocument();
|
|
||||||
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
|
||||||
DOMSource domSource = new DOMSource(htmlDocument);
|
|
||||||
StreamResult streamResult = new StreamResult(outStream);
|
|
||||||
TransformerFactory tf = TransformerFactory.newInstance();
|
|
||||||
Transformer serializer = tf.newTransformer();
|
|
||||||
serializer.setOutputProperty(OutputKeys.ENCODING, "utf-8");
|
|
||||||
serializer.setOutputProperty(OutputKeys.INDENT, "yes");
|
|
||||||
serializer.setOutputProperty(OutputKeys.METHOD, "html");
|
|
||||||
serializer.transform(domSource, streamResult);
|
|
||||||
outStream.close();
|
|
||||||
|
|
||||||
String content = new String(outStream.toByteArray());
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ParserConfigurationException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (TransformerException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* excel07转html
|
|
||||||
* filename:要读取的文件所在文件夹
|
|
||||||
* filepath:文件名
|
|
||||||
* htmlname:生成html名称
|
|
||||||
* path:html存放路径
|
|
||||||
* */
|
|
||||||
public static void excelToHtml () throws Exception{
|
|
||||||
String htmlname="exportExcel"+"07Test"+".html";
|
|
||||||
|
|
||||||
|
|
||||||
URL url = new URL("http://keking.ufile.ucloud.com.cn/20171101150322_运费贷信审资料(给予客户收集版).xlsx?UCloudPublicKey=ucloudtangshd@weifenf.com14355492830001993909323&Expires=&Signature=RRVFIICITMNFed1LQgB10WdKHiE=");
|
|
||||||
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
|
|
||||||
//设置超时间为3秒
|
|
||||||
conn.setConnectTimeout(3*1000);
|
|
||||||
//防止屏蔽程序抓取而返回403错误
|
|
||||||
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
|
|
||||||
//得到输入流
|
|
||||||
InputStream is = conn.getInputStream();
|
|
||||||
|
|
||||||
Workbook workbook = null;
|
|
||||||
// InputStream is = new FileInputStream(filename+"/"+filepath);
|
|
||||||
try {
|
|
||||||
String html="";
|
|
||||||
workbook = new XSSFWorkbook(is);
|
|
||||||
for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) {
|
|
||||||
Sheet sheet = workbook.getSheetAt(numSheet);
|
|
||||||
if (sheet == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
html+="=======================" + sheet.getSheetName() + "=========================<br><br>";
|
|
||||||
|
|
||||||
int firstRowIndex = sheet.getFirstRowNum();
|
|
||||||
int lastRowIndex = sheet.getLastRowNum();
|
|
||||||
html+="<table border='1' align='left'>";
|
|
||||||
Row firstRow = sheet.getRow(firstRowIndex);
|
|
||||||
for (int i = firstRow.getFirstCellNum(); i <= firstRow.getLastCellNum(); i++) {
|
|
||||||
Cell cell = firstRow.getCell(i);
|
|
||||||
String cellValue = getCellValue(cell, true);
|
|
||||||
html+="<th>" + cellValue + "</th>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//行
|
|
||||||
for (int rowIndex = firstRowIndex + 1; rowIndex <= lastRowIndex; rowIndex++) {
|
|
||||||
Row currentRow = sheet.getRow(rowIndex);
|
|
||||||
html+="<tr>";
|
|
||||||
if(currentRow!=null){
|
|
||||||
|
|
||||||
int firstColumnIndex = currentRow.getFirstCellNum();
|
|
||||||
int lastColumnIndex = currentRow.getLastCellNum();
|
|
||||||
//列
|
|
||||||
for (int columnIndex = firstColumnIndex; columnIndex <= lastColumnIndex; columnIndex++) {
|
|
||||||
Cell currentCell = currentRow.getCell(columnIndex);
|
|
||||||
String currentCellValue = getCellValue(currentCell, true);
|
|
||||||
html+="<td>"+currentCellValue + "</td>";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
html+=" ";
|
|
||||||
}
|
|
||||||
html+="</tr>";
|
|
||||||
}
|
|
||||||
html+="</table>";
|
|
||||||
|
|
||||||
|
|
||||||
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
|
||||||
DOMSource domSource = new DOMSource ();
|
|
||||||
StreamResult streamResult = new StreamResult (outStream);
|
|
||||||
|
|
||||||
TransformerFactory tf = TransformerFactory.newInstance();
|
|
||||||
Transformer serializer = tf.newTransformer();
|
|
||||||
serializer.setOutputProperty (OutputKeys.ENCODING, "utf-8");
|
|
||||||
serializer.setOutputProperty (OutputKeys.INDENT, "yes");
|
|
||||||
serializer.setOutputProperty (OutputKeys.METHOD, "html");
|
|
||||||
serializer.transform (domSource, streamResult);
|
|
||||||
outStream.close();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 读取单元格
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static String getCellValue(Cell cell, boolean treatAsStr) {
|
|
||||||
if (cell == null) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (treatAsStr) {
|
|
||||||
cell.setCellType(Cell.CELL_TYPE_STRING);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
|
|
||||||
return String.valueOf(cell.getBooleanCellValue());
|
|
||||||
} else if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
|
|
||||||
return String.valueOf(cell.getNumericCellValue());
|
|
||||||
} else {
|
|
||||||
return String.valueOf(cell.getStringCellValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class ShedulerClean {
|
|
||||||
@Value("${file.dir}")
|
|
||||||
String fileDir;
|
|
||||||
|
|
||||||
// @Scheduled(cron = "0 0 23 * * ?") //每晚23点执行一次
|
|
||||||
public void clean(){
|
|
||||||
System.out.println("执行一次清空文件夹");
|
|
||||||
DeleteFileUtil.deleteDirectory(fileDir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import com.yudianbank.param.ReturnResponse;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 读取类文本文件
|
|
||||||
* @author yudian-it
|
|
||||||
* @date 2017/12/13
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class SimTextUtil {
|
|
||||||
@Value("${file.dir}")
|
|
||||||
String fileDir;
|
|
||||||
@Autowired
|
|
||||||
DownloadUtils downloadUtils;
|
|
||||||
|
|
||||||
public ReturnResponse<String> readSimText(String url, String fileName){
|
|
||||||
ReturnResponse<String> response = downloadUtils.downLoad(url, "txt", fileName);
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.function.ToDoubleFunction;
|
|
||||||
import java.util.function.ToIntFunction;
|
|
||||||
import java.util.function.ToLongFunction;
|
|
||||||
|
|
||||||
import com.github.junrar.Archive;
|
|
||||||
import com.github.junrar.exception.RarException;
|
|
||||||
import com.github.junrar.rarfile.FileHeader;
|
|
||||||
import org.apache.commons.compress.archivers.ArchiveException;
|
|
||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
|
|
||||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
|
||||||
import org.apache.poi.xwpf.converter.core.FileImageExtractor;
|
|
||||||
import org.apache.poi.xwpf.converter.core.FileURIResolver;
|
|
||||||
import org.apache.poi.xwpf.converter.xhtml.XHTMLConverter;
|
|
||||||
import org.apache.poi.xwpf.converter.xhtml.XHTMLOptions;
|
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
||||||
|
|
||||||
public class WordToHtml {
|
|
||||||
/** 这是2007版本 转html 已测试成功的代码 07和03版要用两种代码转 但因为后面说要用
|
|
||||||
* 38 * 2007版本word转换成html
|
|
||||||
* 39 * @throws IOException
|
|
||||||
* 40
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static String Word2007ToHtml(InputStream inputStream) throws IOException {
|
|
||||||
// 1) 加载word文档生成 XWPFDocument对象
|
|
||||||
XWPFDocument document = new XWPFDocument(inputStream);
|
|
||||||
|
|
||||||
// 2) 解析 XHTML配置 (这里设置IURIResolver来设置图片存放的目录)
|
|
||||||
// File imageFolderFile = new File("/Users/zuoxiaohui/IdeaProjects/yudian-preview-boot/yudian-preview-boot/src/main/resources/picture/");
|
|
||||||
File imageFolderFile = new File("/Users/zuoxiaohui/IdeaProjects/yudian-preview-boot/yudian-preview-boot/src/main/resources/static/");
|
|
||||||
XHTMLOptions options = XHTMLOptions.create().URIResolver(new FileURIResolver(imageFolderFile));
|
|
||||||
options.setExtractor(new FileImageExtractor(imageFolderFile));
|
|
||||||
options.setIgnoreStylesIfUnused(false);
|
|
||||||
options.setFragment(true);
|
|
||||||
|
|
||||||
File file = new File("/Users/zuoxiaohui/Test/" + "test.html");
|
|
||||||
// 3) 将 XWPFDocument转换成XHTML
|
|
||||||
OutputStream out = new FileOutputStream(file);
|
|
||||||
XHTMLConverter.getInstance().convert(document, out, options);
|
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
||||||
XHTMLConverter.getInstance().convert(document, baos, options);
|
|
||||||
String content = baos.toString();
|
|
||||||
System.out.println(content);
|
|
||||||
baos.close();
|
|
||||||
return content;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException, ArchiveException, RarException {
|
|
||||||
System.out.println(URLEncoder.encode(" ", "UTF-8"));
|
|
||||||
System.out.println(URLDecoder.decode(" http://keking.ufile.ucloud.com.cn/20171230213253_2017%E5%B9%B4%20%E5%BA%A6%E7%BB%A9%E6%95%88%E8%80%83%E6%A0%B8%E8%A1%A8%E5%8F%8A%E8%AF%84%E4%BC%98%E6%8E%A8%E8%8D%90%E8%A1%A8.xlsxUCloudPublicKey=ucloudtangshd@weifenf.com14355492830001993909323&Expires=&Signature=Pbi/J6UcOZcvGwhAwExe3SpxrGo=", "UTF-8"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,392 +0,0 @@
|
|||||||
package com.yudianbank.utils;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.github.junrar.Archive;
|
|
||||||
import com.github.junrar.exception.RarException;
|
|
||||||
import com.github.junrar.rarfile.FileHeader;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
|
||||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author yudian-it
|
|
||||||
* @date 2017/11/27
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class ZipReader {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
FileUtils fileUtils;
|
|
||||||
@Value("${file.dir}")
|
|
||||||
String fileDir;
|
|
||||||
|
|
||||||
ExecutorService executors = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 读取压缩文件
|
|
||||||
* 文件压缩到统一目录fileDir下,并且命名使用压缩文件名+文件名因为文件名
|
|
||||||
* 可能会重复(在系统中对于同一种类型的材料压缩文件内的文件是一样的,如果文件名
|
|
||||||
* 重复,那么这里会被覆盖[同一个压缩文件中的不同目录中的相同文件名暂时不考虑])
|
|
||||||
* <b>注:</b>
|
|
||||||
* <p>
|
|
||||||
* 文件名命名中的参数的说明:
|
|
||||||
* 1.archiveName,为避免解压的文件中有重名的文件会彼此覆盖,所以加上了archiveName,因为在ufile中archiveName
|
|
||||||
* 是不会重复的。
|
|
||||||
* 2.level,这里层级结构的列表我是通过一个map来构造的,map的key是文件的名字,值是对应的文件,这样每次向map中
|
|
||||||
* 加入节点的时候都会获取父节点是否存在,存在则会获取父节点的value并将当前节点加入到父节点的childList中(这里利用
|
|
||||||
* 的是java语言的引用的特性)。
|
|
||||||
* </p>
|
|
||||||
* @param filePath
|
|
||||||
*/
|
|
||||||
public String readZipFile(String filePath) {
|
|
||||||
String archiveSeparator = "/";
|
|
||||||
Map<String, FileNode> appender = Maps.newHashMap();
|
|
||||||
String archiveFileName = fileUtils.getFileNameFromPath(filePath);
|
|
||||||
try {
|
|
||||||
ZipFile zipFile = new ZipFile(filePath, fileUtils.getFileEncodeUTFGBK(filePath));
|
|
||||||
Enumeration<ZipArchiveEntry> entries = zipFile.getEntries();
|
|
||||||
// 排序
|
|
||||||
entries = sortZipEntries(entries);
|
|
||||||
List<Map<String, ZipArchiveEntry>> entriesToBeExtracted = Lists.newArrayList();
|
|
||||||
while (entries.hasMoreElements()){
|
|
||||||
ZipArchiveEntry entry = entries.nextElement();
|
|
||||||
String fullName = entry.getName();
|
|
||||||
int level = fullName.split(archiveSeparator).length;
|
|
||||||
// 展示名
|
|
||||||
String originName = getLastFileName(fullName, archiveSeparator);
|
|
||||||
String childName = level + "_" + originName;
|
|
||||||
boolean directory = entry.isDirectory();
|
|
||||||
if (!directory) {
|
|
||||||
childName = archiveFileName + "_" + originName;
|
|
||||||
entriesToBeExtracted.add(Collections.singletonMap(childName, entry));
|
|
||||||
}
|
|
||||||
String parentName = getLast2FileName(fullName, archiveSeparator, archiveFileName);
|
|
||||||
parentName = (level-1) + "_" + parentName;
|
|
||||||
FileNode node = new FileNode(originName, childName, parentName, new ArrayList<>(), directory);
|
|
||||||
addNodes(appender, parentName, node);
|
|
||||||
appender.put(childName, node);
|
|
||||||
}
|
|
||||||
// 开启新的线程处理文件解压
|
|
||||||
executors.submit(new ZipExtractorWorker(entriesToBeExtracted, zipFile, filePath));
|
|
||||||
return new ObjectMapper().writeValueAsString(appender.get(""));
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序zipEntries(对原来列表倒序)
|
|
||||||
* @param entries
|
|
||||||
*/
|
|
||||||
private Enumeration<ZipArchiveEntry> sortZipEntries(Enumeration<ZipArchiveEntry> entries) {
|
|
||||||
List<ZipArchiveEntry> sortedEntries = Lists.newArrayList();
|
|
||||||
while(entries.hasMoreElements()){
|
|
||||||
sortedEntries.add(entries.nextElement());
|
|
||||||
}
|
|
||||||
Collections.sort(sortedEntries, Comparator.comparingInt(o -> o.getName().length()));
|
|
||||||
return Collections.enumeration(sortedEntries);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String unRar(String filePath){
|
|
||||||
Map<String, FileNode> appender = Maps.newHashMap();
|
|
||||||
try {
|
|
||||||
Archive archive = new Archive(new File(filePath));
|
|
||||||
List<FileHeader> headers = archive.getFileHeaders();
|
|
||||||
headers = sortedHeaders(headers);
|
|
||||||
String archiveFileName = fileUtils.getFileNameFromPath(filePath);
|
|
||||||
List<Map<String, FileHeader>> headersToBeExtracted = Lists.newArrayList();
|
|
||||||
for (FileHeader header : headers) {
|
|
||||||
String fullName;
|
|
||||||
if (header.isUnicode()) {
|
|
||||||
fullName = header.getFileNameW();
|
|
||||||
}else {
|
|
||||||
fullName = header.getFileNameString();
|
|
||||||
}
|
|
||||||
// 展示名
|
|
||||||
String originName = getLastFileName(fullName, "\\");
|
|
||||||
String childName = originName;
|
|
||||||
boolean directory = header.isDirectory();
|
|
||||||
if (!directory) {
|
|
||||||
childName = archiveFileName + "_" + originName;
|
|
||||||
headersToBeExtracted.add(Collections.singletonMap(childName, header));
|
|
||||||
}
|
|
||||||
String parentName = getLast2FileName(fullName, "\\", archiveFileName);
|
|
||||||
FileNode node = new FileNode(originName, childName, parentName, new ArrayList<>(), directory);
|
|
||||||
addNodes(appender, parentName, node);
|
|
||||||
appender.put(childName, node);
|
|
||||||
}
|
|
||||||
executors.submit(new RarExtractorWorker(headersToBeExtracted, archive, filePath));
|
|
||||||
return new ObjectMapper().writeValueAsString(appender.get(""));
|
|
||||||
} catch (RarException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addNodes(Map<String, FileNode> appender, String parentName, FileNode node) {
|
|
||||||
if (appender.containsKey(parentName)) {
|
|
||||||
appender.get(parentName).getChildList().add(node);
|
|
||||||
}else { // 根节点
|
|
||||||
FileNode nodeRoot = new FileNode(parentName, parentName, "", new ArrayList<>(), true);
|
|
||||||
nodeRoot.getChildList().add(node);
|
|
||||||
appender.put("", nodeRoot);
|
|
||||||
appender.put(parentName, nodeRoot);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<FileHeader> sortedHeaders(List<FileHeader> headers) {
|
|
||||||
List<FileHeader> sortedHeaders = new ArrayList<>();
|
|
||||||
Map<Integer, FileHeader> mapHeaders = new TreeMap<>();
|
|
||||||
headers.forEach(header -> mapHeaders.put(header.getFileNameW().length(), header));
|
|
||||||
for (Map.Entry<Integer, FileHeader> entry : mapHeaders.entrySet()){
|
|
||||||
for (FileHeader header : headers) {
|
|
||||||
if (entry.getKey().intValue() == header.getFileNameW().length()) {
|
|
||||||
sortedHeaders.add(header);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sortedHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取倒数第二个文件(夹)名
|
|
||||||
* @param fullName
|
|
||||||
* @param seperator
|
|
||||||
* 压缩文件解压后,不同的压缩格式分隔符不一样zip是/,而rar是\
|
|
||||||
* @param rootName
|
|
||||||
* 根目录名:如果倒数第二个路径为空,那么赋值为rootName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private static String getLast2FileName(String fullName, String seperator, String rootName) {
|
|
||||||
if (fullName.endsWith(seperator)) {
|
|
||||||
fullName = fullName.substring(0, fullName.length()-1);
|
|
||||||
}
|
|
||||||
// 1.获取剩余部分
|
|
||||||
int endIndex = fullName.lastIndexOf(seperator);
|
|
||||||
String leftPath = fullName.substring(0, endIndex == -1 ? 0 : endIndex);
|
|
||||||
if (null != leftPath && leftPath.length() > 1) {
|
|
||||||
// 2.获取倒数第二个
|
|
||||||
return getLastFileName(leftPath, seperator);
|
|
||||||
}else {
|
|
||||||
return rootName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取最后一个文件(夹)的名字
|
|
||||||
* @param fullName
|
|
||||||
* @param seperator
|
|
||||||
* 压缩文件解压后,不同的压缩格式分隔符不一样zip是/,而rar是\
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private static String getLastFileName(String fullName, String seperator) {
|
|
||||||
if (fullName.endsWith(seperator)) {
|
|
||||||
fullName = fullName.substring(0, fullName.length()-1);
|
|
||||||
}
|
|
||||||
String newName = fullName;
|
|
||||||
if (null != fullName && fullName.contains(seperator)) {
|
|
||||||
newName = fullName.substring(fullName.lastIndexOf(seperator) + 1);
|
|
||||||
}
|
|
||||||
return newName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件节点(区分文件上下级)
|
|
||||||
*/
|
|
||||||
public class FileNode{
|
|
||||||
|
|
||||||
private String originName;
|
|
||||||
private String fileName;
|
|
||||||
private String parentFileName;
|
|
||||||
private boolean directory;
|
|
||||||
|
|
||||||
private List<FileNode> childList;
|
|
||||||
|
|
||||||
public FileNode(String originName, String fileName, String parentFileName, List<FileNode> childList, boolean directory) {
|
|
||||||
this.originName = originName;
|
|
||||||
this.fileName = fileName;
|
|
||||||
this.parentFileName = parentFileName;
|
|
||||||
this.childList = childList;
|
|
||||||
this.directory = directory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileName() {
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileName(String fileName) {
|
|
||||||
this.fileName = fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParentFileName() {
|
|
||||||
return parentFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentFileName(String parentFileName) {
|
|
||||||
this.parentFileName = parentFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<FileNode> getChildList() {
|
|
||||||
return childList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setChildList(List<FileNode> childList) {
|
|
||||||
this.childList = childList;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
try {
|
|
||||||
return new ObjectMapper().writeValueAsString(this);
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOriginName() {
|
|
||||||
return originName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOriginName(String originName) {
|
|
||||||
this.originName = originName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDirectory() {
|
|
||||||
return directory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDirectory(boolean directory) {
|
|
||||||
this.directory = directory;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Zip文件抽取线程
|
|
||||||
*/
|
|
||||||
class ZipExtractorWorker implements Runnable {
|
|
||||||
|
|
||||||
private List<Map<String, ZipArchiveEntry>> entriesToBeExtracted;
|
|
||||||
private ZipFile zipFile;
|
|
||||||
private String filePath;
|
|
||||||
|
|
||||||
public ZipExtractorWorker(List<Map<String, ZipArchiveEntry>> entriesToBeExtracted, ZipFile zipFile, String filePath) {
|
|
||||||
this.entriesToBeExtracted = entriesToBeExtracted;
|
|
||||||
this.zipFile = zipFile;
|
|
||||||
this.filePath = filePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
System.out.println("解析压缩文件开始《《《《《《《《《《《《《《《《《《《《《《《");
|
|
||||||
for (Map<String, ZipArchiveEntry> entryMap : entriesToBeExtracted) {
|
|
||||||
String childName = entryMap.keySet().iterator().next();
|
|
||||||
ZipArchiveEntry entry = entryMap.values().iterator().next();
|
|
||||||
try {
|
|
||||||
extractZipFile(childName, zipFile.getInputStream(entry));
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
zipFile.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (new File(filePath).exists()) {
|
|
||||||
new File(filePath).delete();
|
|
||||||
}
|
|
||||||
System.out.println("解析压缩文件结束《《《《《《《《《《《《《《《《《《《《《《《");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 读取压缩文件并写入到fileDir文件夹下
|
|
||||||
* @param childName
|
|
||||||
* @param zipFile
|
|
||||||
*/
|
|
||||||
private void extractZipFile(String childName, InputStream zipFile) {
|
|
||||||
String outPath = fileDir + childName;
|
|
||||||
try (OutputStream ot = new FileOutputStream(outPath)){
|
|
||||||
byte[] inByte = new byte[1024];
|
|
||||||
int len;
|
|
||||||
while ((-1 != (len = zipFile.read(inByte)))){
|
|
||||||
ot.write(inByte, 0, len);
|
|
||||||
}
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Rar文件抽取
|
|
||||||
*/
|
|
||||||
class RarExtractorWorker implements Runnable {
|
|
||||||
private List<Map<String, FileHeader>> headersToBeExtracted;
|
|
||||||
private Archive archive;
|
|
||||||
/**
|
|
||||||
* 用以删除源文件
|
|
||||||
*/
|
|
||||||
private String filePath;
|
|
||||||
|
|
||||||
public RarExtractorWorker(List<Map<String, FileHeader>> headersToBeExtracted, Archive archive, String filePath) {
|
|
||||||
this.headersToBeExtracted = headersToBeExtracted;
|
|
||||||
this.archive = archive;
|
|
||||||
this.filePath = filePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
System.out.println("解析压缩文件开始《《《《《《《《《《《《《《《《《《《《《《《");
|
|
||||||
for (Map<String, FileHeader> entryMap : headersToBeExtracted) {
|
|
||||||
String childName = entryMap.keySet().iterator().next();
|
|
||||||
extractRarFile(childName, entryMap.values().iterator().next(), archive);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
archive.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (new File(filePath).exists()) {
|
|
||||||
new File(filePath).delete();
|
|
||||||
}
|
|
||||||
System.out.println("解析压缩文件结束《《《《《《《《《《《《《《《《《《《《《《《");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 抽取rar文件到指定目录下
|
|
||||||
* @param childName
|
|
||||||
* @param header
|
|
||||||
* @param archive
|
|
||||||
*/
|
|
||||||
private void extractRarFile(String childName, FileHeader header, Archive archive) {
|
|
||||||
String outPath = fileDir + childName;
|
|
||||||
try(OutputStream ot = new FileOutputStream(outPath)) {
|
|
||||||
archive.extractFile(header, ot);
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (RarException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
package com.yudianbank.web.controller;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.yudianbank.param.ReturnResponse;
|
|
||||||
import com.yudianbank.utils.FileUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author yudian-it
|
|
||||||
* @date 2017/12/1
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
public class FileController {
|
|
||||||
@Value("${file.dir}")
|
|
||||||
String fileDir;
|
|
||||||
@Autowired
|
|
||||||
FileUtils fileUtils;
|
|
||||||
String demoDir = "demo";
|
|
||||||
String demoPath = demoDir + File.separator;
|
|
||||||
|
|
||||||
@RequestMapping(value = "fileUpload", method = RequestMethod.POST)
|
|
||||||
public String fileUpload(@RequestParam("file") MultipartFile file,
|
|
||||||
HttpServletRequest request) throws JsonProcessingException {
|
|
||||||
String fileName = file.getOriginalFilename();
|
|
||||||
// 判断该文件类型是否有上传过,如果上传过则提示不允许再次上传
|
|
||||||
if (existsTypeFile(fileName)) {
|
|
||||||
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(1, "每一种类型只可以上传一个文件,请先删除原有文件再次上传", null));
|
|
||||||
}
|
|
||||||
File outFile = new File(fileDir + demoPath);
|
|
||||||
if (!outFile.exists()) {
|
|
||||||
outFile.mkdirs();
|
|
||||||
}
|
|
||||||
try(InputStream in = file.getInputStream();
|
|
||||||
OutputStream ot = new FileOutputStream(fileDir + demoPath + fileName)){
|
|
||||||
byte[] buffer = new byte[1024];
|
|
||||||
int len;
|
|
||||||
while ((-1 != (len = in.read(buffer)))) {
|
|
||||||
ot.write(buffer, 0, len);
|
|
||||||
}
|
|
||||||
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(0, "SUCCESS", null));
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(1, "FAILURE", null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping(value = "deleteFile", method = RequestMethod.GET)
|
|
||||||
public String deleteFile(String fileName) throws JsonProcessingException {
|
|
||||||
if (fileName.contains("/")) {
|
|
||||||
fileName = fileName.substring(fileName.lastIndexOf("/") + 1);
|
|
||||||
}
|
|
||||||
File file = new File(fileDir + demoPath + fileName);
|
|
||||||
if (file.exists()) {
|
|
||||||
file.delete();
|
|
||||||
}
|
|
||||||
return new ObjectMapper().writeValueAsString(new ReturnResponse<String>(0, "SUCCESS", null));
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping(value = "listFiles", method = RequestMethod.GET)
|
|
||||||
public String getFiles() throws JsonProcessingException {
|
|
||||||
List<Map<String, String>> list = Lists.newArrayList();
|
|
||||||
File file = new File(fileDir + demoPath);
|
|
||||||
if (file.exists()) {
|
|
||||||
Arrays.stream(file.listFiles()).forEach(file1 -> list.add(ImmutableMap.of("fileName", demoDir + "/" + file1.getName())));
|
|
||||||
}
|
|
||||||
return new ObjectMapper().writeValueAsString(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getFileName(String name) {
|
|
||||||
String suffix = name.substring(name.lastIndexOf("."));
|
|
||||||
String nameNoSuffix = name.substring(0, name.lastIndexOf("."));
|
|
||||||
String uuid = UUID.randomUUID().toString();
|
|
||||||
return uuid + "-" + nameNoSuffix + suffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否存在该类型的文件
|
|
||||||
* @return
|
|
||||||
* @param fileName
|
|
||||||
*/
|
|
||||||
private boolean existsTypeFile(String fileName) {
|
|
||||||
boolean result = false;
|
|
||||||
String suffix = fileUtils.getSuffixFromFileName(fileName);
|
|
||||||
File file = new File(fileDir + demoPath);
|
|
||||||
if (file.exists()) {
|
|
||||||
for(File file1 : file.listFiles()){
|
|
||||||
String existsFileSuffix = fileUtils.getSuffixFromFileName(file1.getName());
|
|
||||||
if (suffix.equals(existsFileSuffix)) {
|
|
||||||
result = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
package com.yudianbank.web.controller;
|
|
||||||
|
|
||||||
import com.yudianbank.param.ReturnResponse;
|
|
||||||
import com.yudianbank.utils.*;
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLConnection;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yudian-it
|
|
||||||
*/
|
|
||||||
@Controller
|
|
||||||
public class OnlinePreviewController {
|
|
||||||
@Autowired
|
|
||||||
private OfficeToPdf officeToPdf;
|
|
||||||
@Autowired
|
|
||||||
FileUtils fileUtils;
|
|
||||||
@Autowired
|
|
||||||
DownloadUtils downloadUtils;
|
|
||||||
@Autowired
|
|
||||||
ZipReader zipReader;
|
|
||||||
@Autowired
|
|
||||||
SimTextUtil simTextUtil;
|
|
||||||
@Value("${simText}")
|
|
||||||
String[] simText;
|
|
||||||
|
|
||||||
@Value("${file.dir}")
|
|
||||||
String fileDir;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param url
|
|
||||||
* @param model
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "onlinePreview",method = RequestMethod.GET)
|
|
||||||
public String onlinePreview(String url, Model model, HttpServletRequest req) throws UnsupportedEncodingException {
|
|
||||||
// 路径转码
|
|
||||||
String decodedUrl = URLDecoder.decode(url, "utf-8");
|
|
||||||
String type = typeFromUrl(url);
|
|
||||||
String suffix = suffixFromUrl(url);
|
|
||||||
// 抽取文件并返回文件列表
|
|
||||||
String fileName = fileUtils.getFileNameFromURL(decodedUrl);
|
|
||||||
model.addAttribute("fileType", suffix);
|
|
||||||
if (type.equalsIgnoreCase("picture")) {
|
|
||||||
model.addAttribute("imgurl", url);
|
|
||||||
return "picture";
|
|
||||||
} else if (type.equalsIgnoreCase("simText")){
|
|
||||||
ReturnResponse<String> response = simTextUtil.readSimText(decodedUrl, fileName);
|
|
||||||
if (0 != response.getCode()) {
|
|
||||||
model.addAttribute("msg", response.getMsg());
|
|
||||||
return "fileNotSupported";
|
|
||||||
}
|
|
||||||
model.addAttribute("ordinaryUrl", response.getMsg());
|
|
||||||
return "txt";
|
|
||||||
} else if(type.equalsIgnoreCase("pdf")){
|
|
||||||
model.addAttribute("pdfUrl",url);
|
|
||||||
return "pdf";
|
|
||||||
} else if(type.equalsIgnoreCase("compress")){
|
|
||||||
String fileTree = null;
|
|
||||||
// 判断文件名是否存在(redis缓存读取)
|
|
||||||
if (!StringUtils.hasText(fileUtils.getConvertedFile(fileName))) {
|
|
||||||
ReturnResponse<String> response = downloadUtils.downLoad(decodedUrl, suffix, fileName);
|
|
||||||
if (0 != response.getCode()) {
|
|
||||||
model.addAttribute("msg", response.getMsg());
|
|
||||||
return "fileNotSupported";
|
|
||||||
}
|
|
||||||
String filePath = response.getContent();
|
|
||||||
if ("zip".equalsIgnoreCase(suffix)
|
|
||||||
|| "jar".equalsIgnoreCase(suffix)
|
|
||||||
|| "gzip".equalsIgnoreCase(suffix)) {
|
|
||||||
fileTree = zipReader.readZipFile(filePath);
|
|
||||||
} else if ("rar".equalsIgnoreCase(suffix)) {
|
|
||||||
fileTree = zipReader.unRar(filePath);
|
|
||||||
}
|
|
||||||
fileUtils.addConvertedFile(fileName, fileTree);
|
|
||||||
}else {
|
|
||||||
fileTree = fileUtils.getConvertedFile(fileName);
|
|
||||||
}
|
|
||||||
System.out.println("返回文件tree》》》》》》》》》》》》》》》》》》》");
|
|
||||||
if (null != fileTree) {
|
|
||||||
model.addAttribute("fileTree",fileTree);
|
|
||||||
return "compress";
|
|
||||||
}else {
|
|
||||||
model.addAttribute("msg", "压缩文件类型不受支持,尝试在压缩的时候选择RAR4格式");
|
|
||||||
return "fileNotSupported";
|
|
||||||
}
|
|
||||||
} else if ("office".equalsIgnoreCase(type)) {
|
|
||||||
boolean isHtml = suffix.equalsIgnoreCase("xls")
|
|
||||||
|| suffix.equalsIgnoreCase("xlsx");
|
|
||||||
String pdfName = fileName.substring(0, fileName.lastIndexOf(".") + 1) + (isHtml ? "html" : "pdf");
|
|
||||||
// 判断之前是否已转换过,如果转换过,直接返回,否则执行转换
|
|
||||||
if (!fileUtils.listConvertedFiles().containsKey(pdfName)) {
|
|
||||||
String filePath = fileDir + fileName;
|
|
||||||
if (!new File(filePath).exists()) {
|
|
||||||
ReturnResponse<String> response = downloadUtils.downLoad(decodedUrl, suffix, null);
|
|
||||||
if (0 != response.getCode()) {
|
|
||||||
model.addAttribute("msg", response.getMsg());
|
|
||||||
return "fileNotSupported";
|
|
||||||
}
|
|
||||||
filePath = response.getContent();
|
|
||||||
}
|
|
||||||
String outFilePath = fileDir + pdfName;
|
|
||||||
if (StringUtils.hasText(outFilePath)) {
|
|
||||||
officeToPdf.openOfficeToPDF(filePath, outFilePath);
|
|
||||||
File f = new File(filePath);
|
|
||||||
if (f.exists()) {
|
|
||||||
f.delete();
|
|
||||||
}
|
|
||||||
if (isHtml) {
|
|
||||||
// 对转换后的文件进行操作(改变编码方式)
|
|
||||||
fileUtils.doActionConvertedFile(outFilePath);
|
|
||||||
}
|
|
||||||
// 加入缓存
|
|
||||||
fileUtils.addConvertedFile(pdfName, fileUtils.getRelativePath(outFilePath));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
model.addAttribute("pdfUrl", pdfName);
|
|
||||||
return isHtml ? "html" : "pdf";
|
|
||||||
}else {
|
|
||||||
model.addAttribute("msg", "系统还不支持该格式文件的在线预览," +
|
|
||||||
"如有需要请按下方显示的邮箱地址联系系统维护人员");
|
|
||||||
return "fileNotSupported";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String suffixFromUrl(String url) {
|
|
||||||
String nonPramStr = url.substring(0, url.indexOf("?") != -1 ? url.indexOf("?"): url.length());
|
|
||||||
String fileName = nonPramStr.substring(nonPramStr.lastIndexOf("/") + 1);
|
|
||||||
String fileType = fileName.substring(fileName.lastIndexOf(".") + 1);
|
|
||||||
return fileType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查看文件类型(防止参数中存在.点号或者其他特殊字符,所以先抽取文件名,然后再获取文件类型)
|
|
||||||
* @param url
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String typeFromUrl(String url) {
|
|
||||||
String nonPramStr = url.substring(0, url.indexOf("?") != -1 ? url.indexOf("?"): url.length());
|
|
||||||
String fileName = nonPramStr.substring(nonPramStr.lastIndexOf("/") + 1);
|
|
||||||
String fileType = fileName.substring(fileName.lastIndexOf(".") + 1);
|
|
||||||
if (fileUtils.listPictureTypes().contains(fileType.toLowerCase())) {
|
|
||||||
fileType = "picture";
|
|
||||||
}
|
|
||||||
if (fileUtils.listArchiveTypes().contains(fileType.toLowerCase())) {
|
|
||||||
fileType = "compress";
|
|
||||||
}
|
|
||||||
if (fileUtils.listOfficeTypes().contains(fileType.toLowerCase())) {
|
|
||||||
fileType = "office";
|
|
||||||
}
|
|
||||||
if (Arrays.asList(simText).contains(fileType.toLowerCase())) {
|
|
||||||
fileType = "simText";
|
|
||||||
}
|
|
||||||
return fileType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据url获取文件内容
|
|
||||||
* 当pdfjs读取存在跨域问题的文件时将通过此接口读取
|
|
||||||
* @param urlPath
|
|
||||||
* @param resp
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/getCorsFile", method = RequestMethod.GET)
|
|
||||||
public void getCorsFile(String urlPath, HttpServletResponse resp) {
|
|
||||||
InputStream inputStream = null;
|
|
||||||
try {
|
|
||||||
String strUrl = urlPath.trim();
|
|
||||||
URL url=new URL(strUrl);
|
|
||||||
//打开请求连接
|
|
||||||
URLConnection connection = url.openConnection();
|
|
||||||
HttpURLConnection httpURLConnection=(HttpURLConnection) connection;
|
|
||||||
httpURLConnection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
|
|
||||||
inputStream = httpURLConnection.getInputStream();
|
|
||||||
byte[] bs = new byte[1024];
|
|
||||||
int len;
|
|
||||||
while(-1 != (len = inputStream.read(bs))) {
|
|
||||||
resp.getOutputStream().write(bs, 0, len);
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
if(inputStream != null) {
|
|
||||||
IOUtils.closeQuietly(inputStream);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
app.id=file-preview
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#=============================================#spring Redisson配置#===================================#
|
|
||||||
spring.redisson.address = 192.168.1.204:6379
|
|
||||||
##资源映射路径(因为jar方式运行的原因)
|
|
||||||
file.dir = C:\\Users\\yudian\\Desktop\\dev\\
|
|
||||||
spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir}
|
|
||||||
## openoffice相关配置
|
|
||||||
office.home = C:\\Program Files (x86)\\OpenOffice 4
|
|
||||||
server.tomcat.uri-encoding = UTF-8
|
|
||||||
converted.file.charset = GBK
|
|
||||||
#======================================#文件上传限制#======================================#
|
|
||||||
spring.http.multipart.max-file-size=100MB
|
|
||||||
## 支持的类文本格式的文件类型
|
|
||||||
simText = txt,html,xml,java,properties,mp3,mp4,sql
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#=============================================#spring Redisson配置#===================================#
|
|
||||||
spring.redisson.address = 192.168.1.204:6379
|
|
||||||
spring.redisson.database = 3
|
|
||||||
##资源映射路径(因为jar方式运行的原因)
|
|
||||||
file.dir = /data/filepreview/
|
|
||||||
spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${file.dir}
|
|
||||||
## openoffice相关配置
|
|
||||||
openOfficePath = 123
|
|
||||||
office.home = /opt/openoffice4
|
|
||||||
server.tomcat.uri-encoding = utf-8
|
|
||||||
converted.file.charset = utf-8
|
|
||||||
spring.http.multipart.max-file-size = 100MB
|
|
||||||
## 支持的类文本格式的文件类型
|
|
||||||
simText = txt,html,xml,java,properties,sql,js,md,json,conf,ini,vue,php,py,bat,gitignore,log,htm,mp3,mp4,css,cnf
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
server.port = 8012
|
|
||||||
spring.http.encoding.charset = utf8
|
|
||||||
## Freemarker 配置
|
|
||||||
spring.freemarker.template-loader-path = classpath:/web/
|
|
||||||
spring.freemarker.cache = false
|
|
||||||
spring.freemarker.charset = UTF-8
|
|
||||||
spring.freemarker.check-template-location = true
|
|
||||||
spring.freemarker.content-type = text/html
|
|
||||||
spring.freemarker.expose-request-attributes = true
|
|
||||||
spring.freemarker.expose-session-attributes = true
|
|
||||||
spring.freemarker.request-context-attribute = request
|
|
||||||
spring.freemarker.suffix = .ftl
|
|
||||||
|
|
||||||
#默认环境
|
|
||||||
spring.profiles.active=dev
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration>
|
|
||||||
<property name="LOG_FILE" value="@logging.path@/app.log"></property>
|
|
||||||
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
|
||||||
<jmxConfigurator/>
|
|
||||||
<logger name="org.springframework.web" level="info"/>
|
|
||||||
<appender name="stash" class="net.logstash.logback.appender.LogstashSocketAppender">
|
|
||||||
<port>10800</port>
|
|
||||||
<host>192.168.1.109</host>
|
|
||||||
<includeCallerData>true</includeCallerData>
|
|
||||||
<customFields>{"app_name":"@appName@"}</customFields>
|
|
||||||
</appender>
|
|
||||||
<root level="INFO">
|
|
||||||
<!--<appender-ref ref="dailyRollingFile"/>
|
|
||||||
<appender-ref ref="consoleRolling"/>-->
|
|
||||||
<appender-ref ref="stash"/>
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
env_base_config = {
|
|
||||||
server_base_url:'http://127.0.0.1:8012/',
|
|
||||||
}
|
|
||||||
env_config = {
|
|
||||||
server_base_url:env_base_config.server_base_url,
|
|
||||||
server_preview_url:env_base_config.server_base_url + 'onlinePreview?url=',
|
|
||||||
server_delete_url:env_base_config.server_base_url + 'deleteFile?fileName=',
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,179 +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=Pot buk mukato
|
|
||||||
previous_label=Mukato
|
|
||||||
next.title=Pot buk malubo
|
|
||||||
next_label=Malubo
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
|
|
||||||
page.title=Pot buk
|
|
||||||
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
|
|
||||||
# representing the total number of pages in the document.
|
|
||||||
of_pages=pi {{pagesCount}}
|
|
||||||
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
|
|
||||||
# will be replaced by a number representing the currently visible page,
|
|
||||||
# respectively a number representing the total number of pages in the document.
|
|
||||||
page_of_pages=({{pageNumber}} me {{pagesCount}})
|
|
||||||
|
|
||||||
zoom_out.title=Jwik Matidi
|
|
||||||
zoom_out_label=Jwik Matidi
|
|
||||||
zoom_in.title=Kwot Madit
|
|
||||||
zoom_in_label=Kwot Madit
|
|
||||||
zoom.title=Kwoti
|
|
||||||
presentation_mode.title=Lokke i kit me tyer
|
|
||||||
presentation_mode_label=Kit me tyer
|
|
||||||
open_file.title=Yab Pwail
|
|
||||||
open_file_label=Yab
|
|
||||||
print.title=Go
|
|
||||||
print_label=Go
|
|
||||||
download.title=Gam
|
|
||||||
download_label=Gam
|
|
||||||
bookmark.title=Neno ma kombedi (lok onyo yab i dirica manyen)
|
|
||||||
bookmark_label=Neno ma kombedi
|
|
||||||
|
|
||||||
# Secondary toolbar and context menu
|
|
||||||
tools.title=Gintic
|
|
||||||
tools_label=Gintic
|
|
||||||
first_page.title=Cit i pot buk mukwongo
|
|
||||||
first_page.label=Cit i pot buk mukwongo
|
|
||||||
first_page_label=Cit i pot buk mukwongo
|
|
||||||
last_page.title=Cit i pot buk magiko
|
|
||||||
last_page.label=Cit i pot buk magiko
|
|
||||||
last_page_label=Cit i pot buk magiko
|
|
||||||
page_rotate_cw.title=Wire i tung lacuc
|
|
||||||
page_rotate_cw.label=Wire i tung lacuc
|
|
||||||
page_rotate_cw_label=Wire i tung lacuc
|
|
||||||
page_rotate_ccw.title=Wire i tung lacam
|
|
||||||
page_rotate_ccw.label=Wire i tung lacam
|
|
||||||
page_rotate_ccw_label=Wire i tung lacam
|
|
||||||
|
|
||||||
cursor_hand_tool.title=Cak gitic me cing
|
|
||||||
|
|
||||||
# Document properties dialog box
|
|
||||||
document_properties.title=Jami me gin acoya…
|
|
||||||
document_properties_label=Jami me gin acoya…
|
|
||||||
document_properties_file_name=Nying pwail:
|
|
||||||
document_properties_file_size=Dit pa pwail:
|
|
||||||
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
|
|
||||||
document_properties_kb={{size_kb}} KB ({{size_b}} bytes)
|
|
||||||
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in megabytes, respectively in bytes.
|
|
||||||
document_properties_mb={{size_mb}} MB ({{size_b}} bytes)
|
|
||||||
document_properties_title=Wiye:
|
|
||||||
document_properties_author=Ngat mucoyo:
|
|
||||||
document_properties_subject=Subjek:
|
|
||||||
document_properties_keywords=Lok mapire tek:
|
|
||||||
document_properties_creation_date=Nino dwe me cwec:
|
|
||||||
document_properties_modification_date=Nino dwe me yub:
|
|
||||||
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
|
|
||||||
# will be replaced by the creation/modification date, and time, of the PDF file.
|
|
||||||
document_properties_date_string={{date}}, {{time}}
|
|
||||||
document_properties_creator=Lacwec:
|
|
||||||
document_properties_producer=Layub PDF:
|
|
||||||
document_properties_version=Kit PDF:
|
|
||||||
document_properties_page_count=Kwan me pot buk:
|
|
||||||
document_properties_close=Lor
|
|
||||||
|
|
||||||
print_progress_message=Yubo coc me agoya…
|
|
||||||
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
|
|
||||||
# a numerical per cent value.
|
|
||||||
print_progress_percent={{progress}}%
|
|
||||||
print_progress_close=Juki
|
|
||||||
|
|
||||||
# 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=Lok gintic ma inget
|
|
||||||
toggle_sidebar_label=Lok gintic ma inget
|
|
||||||
document_outline_label=Pek pa gin acoya
|
|
||||||
attachments.title=Nyut twec
|
|
||||||
attachments_label=Twec
|
|
||||||
thumbs.title=Nyut cal
|
|
||||||
thumbs_label=Cal
|
|
||||||
findbar.title=Nong iye gin acoya
|
|
||||||
findbar_label=Nong
|
|
||||||
|
|
||||||
# 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=Pot buk {{page}}
|
|
||||||
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
|
|
||||||
# number.
|
|
||||||
thumb_page_canvas=Cal me pot buk {{page}}
|
|
||||||
|
|
||||||
# Find panel button title and messages
|
|
||||||
find_input.title=Nong
|
|
||||||
find_input.placeholder=Nong i dokumen…
|
|
||||||
find_previous.title=Nong timme pa lok mukato
|
|
||||||
find_previous_label=Mukato
|
|
||||||
find_next.title=Nong timme pa lok malubo
|
|
||||||
find_next_label=Malubo
|
|
||||||
find_highlight=Wer weng
|
|
||||||
find_match_case_label=Lok marwate
|
|
||||||
find_reached_top=Oo iwi gin acoya, omede ki i tere
|
|
||||||
find_reached_bottom=Oo i agiki me gin acoya, omede ki iwiye
|
|
||||||
find_not_found=Lok pe ononge
|
|
||||||
|
|
||||||
# Error panel labels
|
|
||||||
error_more_info=Ngec Mukene
|
|
||||||
error_less_info=Ngec Manok
|
|
||||||
error_close=Lor
|
|
||||||
# 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=Kwena: {{message}}
|
|
||||||
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
|
|
||||||
# trace.
|
|
||||||
error_stack=Can kikore {{stack}}
|
|
||||||
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
|
|
||||||
error_file=Pwail: {{file}}
|
|
||||||
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
|
|
||||||
error_line=Rek: {{line}}
|
|
||||||
rendering_error=Bal otime i kare me nyuto pot buk.
|
|
||||||
|
|
||||||
# Predefined zoom values
|
|
||||||
page_scale_width=Lac me iye pot buk
|
|
||||||
page_scale_fit=Porre me pot buk
|
|
||||||
page_scale_auto=Kwot pire kene
|
|
||||||
page_scale_actual=Dite kikome
|
|
||||||
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
|
|
||||||
# numerical scale value.
|
|
||||||
page_scale_percent={{scale}}%
|
|
||||||
|
|
||||||
# Loading indicator messages
|
|
||||||
loading_error_indicator=Bal
|
|
||||||
loading_error=Bal otime kun cano PDF.
|
|
||||||
invalid_file_error=Pwail me PDF ma pe atir onyo obale woko.
|
|
||||||
missing_file_error=Pwail me PDF tye ka rem.
|
|
||||||
unexpected_response_error=Lagam mape kigeno pa lapok tic.
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (text_annotation_type.alt): 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.alt=[{{type}} Lok angea manok]
|
|
||||||
password_label=Ket mung me donyo me yabo pwail me PDF man.
|
|
||||||
password_invalid=Mung me donyo pe atir. Tim ber i tem doki.
|
|
||||||
password_ok=OK
|
|
||||||
password_cancel=Juki
|
|
||||||
|
|
||||||
printing_not_supported=Ciko: Layeny ma pe teno goyo liweng.
|
|
||||||
printing_not_ready=Ciko: PDF pe ocane weng me agoya.
|
|
||||||
web_fonts_disabled=Kijuko dit pa coc me kakube woko: pe romo tic ki dit pa coc me PDF ma kiketo i kine.
|
|
||||||
document_colors_not_allowed=Pe ki yee ki gin acoya me PDF me tic ki rangi gi kengi: Kijuko woko “Yee pot buk me yero rangi mamegi kengi” ki i layeny.
|
|
||||||
@@ -1,130 +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=Krataafa baako a etwa mu
|
|
||||||
previous_label=Ekyiri-baako
|
|
||||||
next.title=Krataafa a edi so baako
|
|
||||||
next_label=Dea-ɛ-di-so-baako
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
|
|
||||||
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
|
|
||||||
# representing the total number of pages in the document.
|
|
||||||
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
|
|
||||||
# will be replaced by a number representing the currently visible page,
|
|
||||||
# respectively a number representing the total number of pages in the document.
|
|
||||||
|
|
||||||
zoom_out.title=Zuum pue
|
|
||||||
zoom_out_label=Zuum ba abɔnten
|
|
||||||
zoom_in.title=Zuum kɔ mu
|
|
||||||
zoom_in_label=Zuum kɔ mu
|
|
||||||
zoom.title=Zuum
|
|
||||||
presentation_mode.title=Sesa kɔ Yɛkyerɛ Tebea mu
|
|
||||||
presentation_mode_label=Yɛkyerɛ Tebea
|
|
||||||
open_file.title=Bue Fael
|
|
||||||
open_file_label=Bue
|
|
||||||
print.title=Prente
|
|
||||||
print_label=Prente
|
|
||||||
download.title=Twe
|
|
||||||
download_label=Twe
|
|
||||||
bookmark.title=Seisei nhwɛ (fa anaaso bue wɔ tokuro foforo mu)
|
|
||||||
bookmark_label=Seisei nhwɛ
|
|
||||||
|
|
||||||
# Secondary toolbar and context menu
|
|
||||||
|
|
||||||
|
|
||||||
# Document properties dialog box
|
|
||||||
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
|
|
||||||
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in megabytes, respectively in bytes.
|
|
||||||
document_properties_title=Ti asɛm:
|
|
||||||
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
|
|
||||||
# will be replaced by the creation/modification date, and time, of the PDF file.
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
|
|
||||||
# a numerical per cent value.
|
|
||||||
|
|
||||||
# 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=Sɔ anaaso dum saedbaa
|
|
||||||
toggle_sidebar_label=Sɔ anaaso dum saedbaa
|
|
||||||
document_outline_label=Dɔkomɛnt bɔbea
|
|
||||||
thumbs.title=Kyerɛ mfoniwaa
|
|
||||||
thumbs_label=Mfoniwaa
|
|
||||||
findbar.title=Hu wɔ dɔkomɛnt no mu
|
|
||||||
|
|
||||||
# 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=Krataafa {{page}}
|
|
||||||
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
|
|
||||||
# number.
|
|
||||||
thumb_page_canvas=Krataafa ne mfoniwaa {{page}}
|
|
||||||
|
|
||||||
# Find panel button title and messages
|
|
||||||
find_previous.title=San hu fres wɔ ekyiri baako
|
|
||||||
find_previous_label=Ekyiri baako
|
|
||||||
find_next.title=San hu fres no wɔ enim baako
|
|
||||||
find_next_label=Ndiso
|
|
||||||
find_highlight=Hyɛ bibiara nso
|
|
||||||
find_match_case_label=Fa susu kaase
|
|
||||||
find_reached_top=Edu krataafa ne soro, atoa so efiri ase
|
|
||||||
find_reached_bottom=Edu krataafa n'ewiei, atoa so efiri soro
|
|
||||||
find_not_found=Ennhu fres
|
|
||||||
|
|
||||||
# Error panel labels
|
|
||||||
error_more_info=Infɔmehyɛn bio a wɔka ho
|
|
||||||
error_less_info=Te infɔmehyɛn bio a wɔka ho so
|
|
||||||
# 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{{vɛɛhyen}} (nsi: {{si}})
|
|
||||||
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
|
|
||||||
# english string describing the error.
|
|
||||||
error_message=Nkrato: {{message}}
|
|
||||||
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
|
|
||||||
# trace.
|
|
||||||
error_stack=Staake: {{stack}}
|
|
||||||
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
|
|
||||||
error_file=Fael: {{file}}
|
|
||||||
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
|
|
||||||
error_line=Laen: {{line}}
|
|
||||||
rendering_error=Mfomso bae wɔ bere a wɔ rekyerɛ krataafa no.
|
|
||||||
|
|
||||||
# Predefined zoom values
|
|
||||||
page_scale_width=Krataafa tɛtrɛtɛ
|
|
||||||
page_scale_fit=Krataafa ehimtwa
|
|
||||||
page_scale_auto=Zuum otomatik
|
|
||||||
page_scale_actual=Kɛseyɛ ankasa
|
|
||||||
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
|
|
||||||
# numerical scale value.
|
|
||||||
|
|
||||||
# Loading indicator messages
|
|
||||||
loading_error_indicator=Mfomso
|
|
||||||
loading_error=Mfomso bae wɔ bere a wɔreloode PDF no.
|
|
||||||
invalid_file_error=PDF fael no nndi mu anaaso ho atɔ kyima.
|
|
||||||
missing_file_error=PDF fael no ayera.
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (text_annotation_type.alt): 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.alt=[{{type}} Tɛkst-nyiano]
|
|
||||||
password_ok=OK
|
|
||||||
|
|
||||||
printing_not_supported=Kɔkɔbɔ: Brawsa yi nnhyɛ daa mma prent ho kwan.
|
|
||||||
printing_not_ready=Kɔkɔbɔ: Wɔnntwee PDF fael no nyinara mmbaee ama wo ɛ tumi aprente.
|
|
||||||
web_fonts_disabled=Ɔedum wɛb-mfɔnt: nntumi mmfa PDF mfɔnt a wɔhyɛ mu nndi dwuma.
|
|
||||||
document_colors_not_allowed=Wɔmma ho kwan sɛ PDF adɔkomɛnt de wɔn ara wɔn ahosu bɛdi dwuma: wɔ adum 'Ma ho kwan ma nkrataafa mpaw wɔn ara wɔn ahosu' wɔ brawsa yi mu.
|
|
||||||
@@ -1,184 +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=الصفحة السابقة
|
|
||||||
previous_label=السابقة
|
|
||||||
next.title=الصفحة التالية
|
|
||||||
next_label=التالية
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
|
|
||||||
page.title=صفحة
|
|
||||||
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
|
|
||||||
# representing the total number of pages in the document.
|
|
||||||
of_pages=من {{pagesCount}}
|
|
||||||
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
|
|
||||||
# will be replaced by a number representing the currently visible page,
|
|
||||||
# respectively a number representing the total number of pages in the document.
|
|
||||||
page_of_pages=({{pageNumber}} من {{pagesCount}})
|
|
||||||
|
|
||||||
zoom_out.title=بعّد
|
|
||||||
zoom_out_label=بعّد
|
|
||||||
zoom_in.title=قرّب
|
|
||||||
zoom_in_label=قرّب
|
|
||||||
zoom.title=التقريب
|
|
||||||
presentation_mode.title=انتقل لوضع العرض التقديمي
|
|
||||||
presentation_mode_label=وضع العرض التقديمي
|
|
||||||
open_file.title=افتح ملفًا
|
|
||||||
open_file_label=افتح
|
|
||||||
print.title=اطبع
|
|
||||||
print_label=اطبع
|
|
||||||
download.title=نزّل
|
|
||||||
download_label=نزّل
|
|
||||||
bookmark.title=المنظور الحالي (انسخ أو افتح في نافذة جديدة)
|
|
||||||
bookmark_label=المنظور الحالي
|
|
||||||
|
|
||||||
# Secondary toolbar and context menu
|
|
||||||
tools.title=الأدوات
|
|
||||||
tools_label=الأدوات
|
|
||||||
first_page.title=اذهب إلى الصفحة الأولى
|
|
||||||
first_page.label=اذهب إلى الصفحة الأولى
|
|
||||||
first_page_label=اذهب إلى الصفحة الأولى
|
|
||||||
last_page.title=اذهب إلى الصفحة الأخيرة
|
|
||||||
last_page.label=اذهب إلى الصفحة الأخيرة
|
|
||||||
last_page_label=اذهب إلى الصفحة الأخيرة
|
|
||||||
page_rotate_cw.title=أدر باتجاه عقارب الساعة
|
|
||||||
page_rotate_cw.label=أدر باتجاه عقارب الساعة
|
|
||||||
page_rotate_cw_label=أدر باتجاه عقارب الساعة
|
|
||||||
page_rotate_ccw.title=أدر بعكس اتجاه عقارب الساعة
|
|
||||||
page_rotate_ccw.label=أدر بعكس اتجاه عقارب الساعة
|
|
||||||
page_rotate_ccw_label=أدر بعكس اتجاه عقارب الساعة
|
|
||||||
|
|
||||||
cursor_text_select_tool.title=فعّل أداة اختيار النص
|
|
||||||
cursor_text_select_tool_label=أداة اختيار النص
|
|
||||||
cursor_hand_tool.title=فعّل أداة اليد
|
|
||||||
cursor_hand_tool_label=أداة اليد
|
|
||||||
|
|
||||||
# Document properties dialog box
|
|
||||||
document_properties.title=خصائص المستند…
|
|
||||||
document_properties_label=خصائص المستند…
|
|
||||||
document_properties_file_name=اسم الملف:
|
|
||||||
document_properties_file_size=حجم الملف:
|
|
||||||
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
|
|
||||||
document_properties_kb={{size_kb}} ك.بايت ({{size_b}} بايت)
|
|
||||||
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in megabytes, respectively in bytes.
|
|
||||||
document_properties_mb={{size_mb}} م.بايت ({{size_b}} بايت)
|
|
||||||
document_properties_title=العنوان:
|
|
||||||
document_properties_author=المؤلف:
|
|
||||||
document_properties_subject=الموضوع:
|
|
||||||
document_properties_keywords=الكلمات الأساسية:
|
|
||||||
document_properties_creation_date=تاريخ الإنشاء:
|
|
||||||
document_properties_modification_date=تاريخ التعديل:
|
|
||||||
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
|
|
||||||
# will be replaced by the creation/modification date, and time, of the PDF file.
|
|
||||||
document_properties_date_string={{date}}، {{time}}
|
|
||||||
document_properties_creator=المنشئ:
|
|
||||||
document_properties_producer=منتج PDF:
|
|
||||||
document_properties_version=إصدارة PDF:
|
|
||||||
document_properties_page_count=عدد الصفحات:
|
|
||||||
document_properties_close=أغلق
|
|
||||||
|
|
||||||
print_progress_message=يُحضّر المستند للطباعة…
|
|
||||||
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
|
|
||||||
# a numerical per cent value.
|
|
||||||
print_progress_percent={{progress}}٪
|
|
||||||
print_progress_close=ألغِ
|
|
||||||
|
|
||||||
# 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_notification.title=بدّل ظهور الشريط الجانبي (يحتوي المستند على مخطط أو مرفقات)
|
|
||||||
toggle_sidebar_label=بدّل ظهور الشريط الجانبي
|
|
||||||
document_outline.title=اعرض فهرس المستند (نقر مزدوج لتمديد أو تقليص كل العناصر)
|
|
||||||
document_outline_label=مخطط المستند
|
|
||||||
attachments.title=اعرض المرفقات
|
|
||||||
attachments_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}}
|
|
||||||
|
|
||||||
# Find panel button title and messages
|
|
||||||
find_input.title=ابحث
|
|
||||||
find_input.placeholder=ابحث في المستند…
|
|
||||||
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 ن{{version}} (بناء: {{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=الحجم الحقيقي
|
|
||||||
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
|
|
||||||
# numerical scale value.
|
|
||||||
page_scale_percent={{scale}}٪
|
|
||||||
|
|
||||||
# Loading indicator messages
|
|
||||||
loading_error_indicator=عطل
|
|
||||||
loading_error=حدث عطل أثناء تحميل ملف PDF.
|
|
||||||
invalid_file_error=ملف PDF تالف أو غير صحيح.
|
|
||||||
missing_file_error=ملف PDF غير موجود.
|
|
||||||
unexpected_response_error=استجابة خادوم غير متوقعة.
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (text_annotation_type.alt): 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.alt=[تعليق {{type}}]
|
|
||||||
password_label=أدخل لكلمة السر لفتح هذا الملف.
|
|
||||||
password_invalid=كلمة سر خطأ. من فضلك أعد المحاولة.
|
|
||||||
password_ok=حسنا
|
|
||||||
password_cancel=ألغِ
|
|
||||||
|
|
||||||
printing_not_supported=تحذير: لا يدعم هذا المتصفح الطباعة بشكل كامل.
|
|
||||||
printing_not_ready=تحذير: ملف PDF لم يُحمّل كاملًا للطباعة.
|
|
||||||
web_fonts_disabled=خطوط الوب مُعطّلة: تعذّر استخدام خطوط PDF المُضمّنة.
|
|
||||||
document_colors_not_allowed=ليس مسموحًا لملفات PDF باستخدام ألوانها الخاصة: خيار ”اسمح للصفحات باختيار ألوانها الخاصة“ ليس مُفعّلًا في المتصفح.
|
|
||||||
@@ -1,167 +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=পূৰ্বৱৰ্তী পৃষ্ঠা
|
|
||||||
previous_label=পূৰ্বৱৰ্তী
|
|
||||||
next.title=পৰৱৰ্তী পৃষ্ঠা
|
|
||||||
next_label=পৰৱৰ্তী
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
|
|
||||||
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
|
|
||||||
# representing the total number of pages in the document.
|
|
||||||
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
|
|
||||||
# will be replaced by a number representing the currently visible page,
|
|
||||||
# respectively a number representing the total number of pages in the document.
|
|
||||||
|
|
||||||
zoom_out.title=জুম আউট
|
|
||||||
zoom_out_label=জুম আউট
|
|
||||||
zoom_in.title=জুম ইন
|
|
||||||
zoom_in_label=জুম ইন
|
|
||||||
zoom.title=জুম কৰক
|
|
||||||
presentation_mode.title=উপস্থাপন অৱস্থালে যাওক
|
|
||||||
presentation_mode_label=উপস্থাপন অৱস্থা
|
|
||||||
open_file.title=ফাইল খোলক
|
|
||||||
open_file_label=খোলক
|
|
||||||
print.title=প্ৰিন্ট কৰক
|
|
||||||
print_label=প্ৰিন্ট কৰক
|
|
||||||
download.title=ডাউনল'ড কৰক
|
|
||||||
download_label=ডাউনল'ড কৰক
|
|
||||||
bookmark.title=বৰ্তমান দৃশ্য (কপি কৰক অথবা নতুন উইন্ডোত খোলক)
|
|
||||||
bookmark_label=বৰ্তমান দৃশ্য
|
|
||||||
|
|
||||||
# Secondary toolbar and context menu
|
|
||||||
tools.title=সঁজুলিসমূহ
|
|
||||||
tools_label=সঁজুলিসমূহ
|
|
||||||
first_page.title=প্ৰথম পৃষ্ঠাত যাওক
|
|
||||||
first_page.label=প্ৰথম পৃষ্ঠাত যাওক
|
|
||||||
first_page_label=প্ৰথম পৃষ্ঠাত যাওক
|
|
||||||
last_page.title=সৰ্বশেষ পৃষ্ঠাত যাওক
|
|
||||||
last_page.label=সৰ্বশেষ পৃষ্ঠাত যাওক
|
|
||||||
last_page_label=সৰ্বশেষ পৃষ্ঠাত যাওক
|
|
||||||
page_rotate_cw.title=ঘড়ীৰ দিশত ঘুৰাওক
|
|
||||||
page_rotate_cw.label=ঘড়ীৰ দিশত ঘুৰাওক
|
|
||||||
page_rotate_cw_label=ঘড়ীৰ দিশত ঘুৰাওক
|
|
||||||
page_rotate_ccw.title=ঘড়ীৰ ওলোটা দিশত ঘুৰাওক
|
|
||||||
page_rotate_ccw.label=ঘড়ীৰ ওলোটা দিশত ঘুৰাওক
|
|
||||||
page_rotate_ccw_label=ঘড়ীৰ ওলোটা দিশত ঘুৰাওক
|
|
||||||
|
|
||||||
|
|
||||||
# Document properties dialog box
|
|
||||||
document_properties.title=দস্তাবেজৰ বৈশিষ্ট্যসমূহ…
|
|
||||||
document_properties_label=দস্তাবেজৰ বৈশিষ্ট্যসমূহ…
|
|
||||||
document_properties_file_name=ফাইল নাম:
|
|
||||||
document_properties_file_size=ফাইলৰ আকাৰ:
|
|
||||||
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
|
|
||||||
document_properties_kb={{size_kb}} KB ({{size_b}} bytes)
|
|
||||||
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in megabytes, respectively in bytes.
|
|
||||||
document_properties_mb={{size_mb}} MB ({{size_b}} bytes)
|
|
||||||
document_properties_title=শীৰ্ষক:
|
|
||||||
document_properties_author=লেখক:
|
|
||||||
document_properties_subject=বিষয়:
|
|
||||||
document_properties_keywords=কিৱাৰ্ডসমূহ:
|
|
||||||
document_properties_creation_date=সৃষ্টিৰ তাৰিখ:
|
|
||||||
document_properties_modification_date=পৰিবৰ্তনৰ তাৰিখ:
|
|
||||||
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
|
|
||||||
# will be replaced by the creation/modification date, and time, of the PDF file.
|
|
||||||
document_properties_date_string={{date}}, {{time}}
|
|
||||||
document_properties_creator=সৃষ্টিকৰ্তা:
|
|
||||||
document_properties_producer=PDF উৎপাদক:
|
|
||||||
document_properties_version=PDF সংস্কৰণ:
|
|
||||||
document_properties_page_count=পৃষ্ঠাৰ গণনা:
|
|
||||||
document_properties_close=বন্ধ কৰক
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
|
|
||||||
# a numerical per cent value.
|
|
||||||
|
|
||||||
# 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=কাষবাৰ টগল কৰক
|
|
||||||
document_outline_label=দস্তাবেজ আউটলাইন
|
|
||||||
attachments.title=এটাচমেন্টসমূহ দেখুৱাওক
|
|
||||||
attachments_label=এটাচমেন্টসমূহ
|
|
||||||
thumbs.title=থাম্বনেইলসমূহ দেখুৱাওক
|
|
||||||
thumbs_label=থাম্বনেইলসমূহ
|
|
||||||
findbar.title=দস্তাবেজত সন্ধান কৰক
|
|
||||||
|
|
||||||
# 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}}
|
|
||||||
|
|
||||||
# Find panel button title and messages
|
|
||||||
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=প্ৰকৃত আকাৰ
|
|
||||||
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
|
|
||||||
# numerical scale value.
|
|
||||||
|
|
||||||
# Loading indicator messages
|
|
||||||
loading_error_indicator=ত্ৰুটি
|
|
||||||
loading_error=PDF ল'ড কৰোতে এটা ত্ৰুটি দেখা দিলে।
|
|
||||||
invalid_file_error=অবৈধ অথবা ক্ষতিগ্ৰস্থ PDF file।
|
|
||||||
missing_file_error=সন্ধানহিন PDF ফাইল।
|
|
||||||
unexpected_response_error=অপ্ৰত্যাশিত চাৰ্ভাৰ প্ৰতিক্ৰিয়া।
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (text_annotation_type.alt): 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.alt=[{{type}} টোকা]
|
|
||||||
password_label=এই PDF ফাইল খোলিবলৈ পাছৱৰ্ড সুমুৱাওক।
|
|
||||||
password_invalid=অবৈধ পাছৱৰ্ড। অনুগ্ৰহ কৰি পুনৰ চেষ্টা কৰক।
|
|
||||||
password_ok=ঠিক আছে
|
|
||||||
|
|
||||||
printing_not_supported=সতৰ্কবাৰ্তা: প্ৰিন্টিং এই ব্ৰাউছাৰ দ্বাৰা সম্পূৰ্ণভাৱে সমৰ্থিত নহয়।
|
|
||||||
printing_not_ready=সতৰ্কবাৰ্তা: PDF প্ৰিন্টিংৰ বাবে সম্পূৰ্ণভাৱে ল'ডেড নহয়।
|
|
||||||
web_fonts_disabled=ৱেব ফন্টসমূহ অসামৰ্থবান কৰা আছে: অন্তৰ্ভুক্ত PDF ফন্টসমূহ ব্যৱহাৰ কৰিবলে অক্ষম।
|
|
||||||
document_colors_not_allowed=PDF দস্তাবেজসমূহৰ সিহতৰ নিজস্ব ৰঙ ব্যৱহাৰ কৰাৰ অনুমতি নাই: ব্ৰাউছাৰত 'পৃষ্ঠাসমূহক সিহতৰ নিজস্ব ৰঙ নিৰ্বাচন কৰাৰ অনুমতি দিয়ক' অসামৰ্থবান কৰা আছে।
|
|
||||||
@@ -1,177 +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áxina anterior
|
|
||||||
previous_label=Anterior
|
|
||||||
next.title=Páxina siguiente
|
|
||||||
next_label=Siguiente
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
|
|
||||||
page.title=Páxina
|
|
||||||
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
|
|
||||||
# representing the total number of pages in the document.
|
|
||||||
of_pages=de {{pagesCount}}
|
|
||||||
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
|
|
||||||
# will be replaced by a number representing the currently visible page,
|
|
||||||
# respectively a number representing the total number of pages in the document.
|
|
||||||
page_of_pages=({{pageNumber}} de {{pagesCount}})
|
|
||||||
|
|
||||||
zoom_out.title=Reducir
|
|
||||||
zoom_out_label=Reducir
|
|
||||||
zoom_in.title=Aumentar
|
|
||||||
zoom_in_label=Aumentar
|
|
||||||
zoom.title=Tamañu
|
|
||||||
presentation_mode.title=
|
|
||||||
presentation_mode_label=
|
|
||||||
open_file.title=Abrir ficheru
|
|
||||||
open_file_label=Abrir
|
|
||||||
print.title=Imprentar
|
|
||||||
print_label=Imprentar
|
|
||||||
download.title=Descargar
|
|
||||||
download_label=Descargar
|
|
||||||
bookmark.title=Vista actual (copiar o abrir nuna nueva ventana)
|
|
||||||
bookmark_label=Vista actual
|
|
||||||
|
|
||||||
# Secondary toolbar and context menu
|
|
||||||
tools.title=Ferramientes
|
|
||||||
tools_label=Ferramientes
|
|
||||||
first_page.title=Dir a la primer páxina
|
|
||||||
first_page.label=Dir a la primer páxina
|
|
||||||
first_page_label=Dir a la primer páxina
|
|
||||||
last_page.title=Dir a la postrer páxina
|
|
||||||
last_page.label=Dir a la cabera páxina
|
|
||||||
last_page_label=Dir a la postrer páxina
|
|
||||||
page_rotate_cw.title=Xirar en sen horariu
|
|
||||||
page_rotate_cw.label=
|
|
||||||
page_rotate_cw_label=Xirar en sen horariu
|
|
||||||
page_rotate_ccw.title=Xirar en sen antihorariu
|
|
||||||
page_rotate_ccw.label=
|
|
||||||
page_rotate_ccw_label=Xirar en sen antihorariu
|
|
||||||
|
|
||||||
|
|
||||||
# Document properties dialog box
|
|
||||||
document_properties.title=Propiedaes del documentu…
|
|
||||||
document_properties_label=Propiedaes del documentu…
|
|
||||||
document_properties_file_name=Nome de ficheru:
|
|
||||||
document_properties_file_size=Tamañu de ficheru:
|
|
||||||
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
|
|
||||||
document_properties_kb={{size_kb}} KB ({{size_b}} bytes)
|
|
||||||
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in megabytes, respectively in bytes.
|
|
||||||
document_properties_mb={{size_mb}} MB ({{size_b}} bytes)
|
|
||||||
document_properties_title=Títulu:
|
|
||||||
document_properties_author=Autor:
|
|
||||||
document_properties_subject=Asuntu:
|
|
||||||
document_properties_keywords=Pallabres clave:
|
|
||||||
document_properties_creation_date=Data de creación:
|
|
||||||
document_properties_modification_date=Data de modificación:
|
|
||||||
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
|
|
||||||
# will be replaced by the creation/modification date, and time, of the PDF file.
|
|
||||||
document_properties_date_string={{date}}, {{time}}
|
|
||||||
document_properties_creator=Creador:
|
|
||||||
document_properties_producer=Productor PDF:
|
|
||||||
document_properties_version=Versión PDF:
|
|
||||||
document_properties_page_count=Númberu de páxines:
|
|
||||||
document_properties_close=Zarrar
|
|
||||||
|
|
||||||
print_progress_message=Tresnando documentu pa imprentar…
|
|
||||||
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
|
|
||||||
# a numerical per cent value.
|
|
||||||
print_progress_percent={{progress}}%
|
|
||||||
print_progress_close=Encaboxar
|
|
||||||
|
|
||||||
# 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=Camudar barra llateral
|
|
||||||
toggle_sidebar_label=Camudar barra llateral
|
|
||||||
document_outline.title=Amosar esquema del documentu (duble clic pa espander/contrayer tolos elementos)
|
|
||||||
document_outline_label=Esquema del documentu
|
|
||||||
attachments.title=Amosar axuntos
|
|
||||||
attachments_label=Axuntos
|
|
||||||
thumbs.title=Amosar miniatures
|
|
||||||
thumbs_label=Miniatures
|
|
||||||
findbar.title=Guetar nel documentu
|
|
||||||
findbar_label=Guetar
|
|
||||||
|
|
||||||
# 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áxina {{page}}
|
|
||||||
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
|
|
||||||
# number.
|
|
||||||
thumb_page_canvas=Miniatura de la páxina {{page}}
|
|
||||||
|
|
||||||
# Find panel button title and messages
|
|
||||||
find_previous.title=Alcontrar l'anterior apaición de la fras
|
|
||||||
find_previous_label=Anterior
|
|
||||||
find_next.title=Alcontrar la siguiente apaición d'esta fras
|
|
||||||
find_next_label=Siguiente
|
|
||||||
find_highlight=Remarcar toos
|
|
||||||
find_match_case_label=Coincidencia de mayús./minús.
|
|
||||||
find_reached_top=Algamóse'l principiu del documentu, siguir dende'l final
|
|
||||||
find_reached_bottom=Algamóse'l final del documentu, siguir dende'l principiu
|
|
||||||
find_not_found=Frase non atopada
|
|
||||||
|
|
||||||
# Error panel labels
|
|
||||||
error_more_info=Más información
|
|
||||||
error_less_info=Menos información
|
|
||||||
error_close=Zarrar
|
|
||||||
# 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=Mensaxe: {{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=Ficheru: {{file}}
|
|
||||||
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
|
|
||||||
error_line=Llinia: {{line}}
|
|
||||||
rendering_error=Hebo un fallu al renderizar la páxina.
|
|
||||||
|
|
||||||
# Predefined zoom values
|
|
||||||
page_scale_width=Anchor de la páxina
|
|
||||||
page_scale_fit=Axuste de la páxina
|
|
||||||
page_scale_auto=Tamañu automáticu
|
|
||||||
page_scale_actual=Tamañu actual
|
|
||||||
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
|
|
||||||
# numerical scale value.
|
|
||||||
page_scale_percent={{scale}}%
|
|
||||||
|
|
||||||
# Loading indicator messages
|
|
||||||
loading_error_indicator=Fallu
|
|
||||||
loading_error=Hebo un fallu al cargar el PDF.
|
|
||||||
invalid_file_error=Ficheru PDF inválidu o corruptu.
|
|
||||||
missing_file_error=Nun hai ficheru PDF.
|
|
||||||
unexpected_response_error=Rempuesta inesperada del sirvidor.
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (text_annotation_type.alt): 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.alt=[Anotación {{type}}]
|
|
||||||
password_label=Introduz la contraseña p'abrir esti ficheru PDF
|
|
||||||
password_invalid=Contraseña non válida. Vuelvi a intentalo.
|
|
||||||
password_ok=Aceutar
|
|
||||||
password_cancel=Encaboxar
|
|
||||||
|
|
||||||
printing_not_supported=Alvertencia: La imprentación entá nun ta sofitada dafechu nesti restolador.
|
|
||||||
printing_not_ready=Avisu: Esti PDF nun se cargó completamente pa poder imprentase.
|
|
||||||
web_fonts_disabled=Les fontes web tán desactivaes: ye imposible usar les fontes PDF embebíes.
|
|
||||||
document_colors_not_allowed=Los documentos PDF nun tienen permisu pa usar les sos colores: «Permitir que les páxines escueyan les sos colores» ta desactivao nel restolador.
|
|
||||||
@@ -1,184 +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=Əvvəlki səhifə
|
|
||||||
previous_label=Əvvəlkini tap
|
|
||||||
next.title=Növbəti səhifə
|
|
||||||
next_label=İrəli
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
|
|
||||||
page.title=Səhifə
|
|
||||||
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
|
|
||||||
# representing the total number of pages in the document.
|
|
||||||
of_pages=/ {{pagesCount}}
|
|
||||||
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
|
|
||||||
# will be replaced by a number representing the currently visible page,
|
|
||||||
# respectively a number representing the total number of pages in the document.
|
|
||||||
page_of_pages=({{pageNumber}} / {{pagesCount}})
|
|
||||||
|
|
||||||
zoom_out.title=Uzaqlaş
|
|
||||||
zoom_out_label=Uzaqlaş
|
|
||||||
zoom_in.title=Yaxınlaş
|
|
||||||
zoom_in_label=Yaxınlaş
|
|
||||||
zoom.title=Yaxınlaşdırma
|
|
||||||
presentation_mode.title=Təqdimat Rejiminə Keç
|
|
||||||
presentation_mode_label=Təqdimat Rejimi
|
|
||||||
open_file.title=Fayl Aç
|
|
||||||
open_file_label=Aç
|
|
||||||
print.title=Yazdır
|
|
||||||
print_label=Yazdır
|
|
||||||
download.title=Yüklə
|
|
||||||
download_label=Yüklə
|
|
||||||
bookmark.title=Hazırkı görünüş (köçür və ya yeni pəncərədə aç)
|
|
||||||
bookmark_label=Hazırki görünüş
|
|
||||||
|
|
||||||
# Secondary toolbar and context menu
|
|
||||||
tools.title=Alətlər
|
|
||||||
tools_label=Alətlər
|
|
||||||
first_page.title=İlk Səhifəyə get
|
|
||||||
first_page.label=İlk Səhifəyə get
|
|
||||||
first_page_label=İlk Səhifəyə get
|
|
||||||
last_page.title=Son Səhifəyə get
|
|
||||||
last_page.label=Son Səhifəyə get
|
|
||||||
last_page_label=Son Səhifəyə get
|
|
||||||
page_rotate_cw.title=Saat İstiqamətində Fırlat
|
|
||||||
page_rotate_cw.label=Saat İstiqamətində Fırlat
|
|
||||||
page_rotate_cw_label=Saat İstiqamətində Fırlat
|
|
||||||
page_rotate_ccw.title=Saat İstiqamətinin Əksinə Fırlat
|
|
||||||
page_rotate_ccw.label=Saat İstiqamətinin Əksinə Fırlat
|
|
||||||
page_rotate_ccw_label=Saat İstiqamətinin Əksinə Fırlat
|
|
||||||
|
|
||||||
cursor_text_select_tool.title=Yazı seçmə alətini aktivləşdir
|
|
||||||
cursor_text_select_tool_label=Yazı seçmə aləti
|
|
||||||
cursor_hand_tool.title=Əl alətini aktivləşdir
|
|
||||||
cursor_hand_tool_label=Əl aləti
|
|
||||||
|
|
||||||
# Document properties dialog box
|
|
||||||
document_properties.title=Sənəd xüsusiyyətləri…
|
|
||||||
document_properties_label=Sənəd xüsusiyyətləri…
|
|
||||||
document_properties_file_name=Fayl adı:
|
|
||||||
document_properties_file_size=Fayl ölçüsü:
|
|
||||||
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
|
|
||||||
document_properties_kb={{size_kb}} KB ({{size_b}} bayt)
|
|
||||||
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in megabytes, respectively in bytes.
|
|
||||||
document_properties_mb={{size_mb}} MB ({{size_b}} bayt)
|
|
||||||
document_properties_title=Başlık:
|
|
||||||
document_properties_author=Müəllif:
|
|
||||||
document_properties_subject=Mövzu:
|
|
||||||
document_properties_keywords=Açar sözlər:
|
|
||||||
document_properties_creation_date=Yaradılış Tarixi :
|
|
||||||
document_properties_modification_date=Dəyişdirilmə Tarixi :
|
|
||||||
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
|
|
||||||
# will be replaced by the creation/modification date, and time, of the PDF file.
|
|
||||||
document_properties_date_string={{date}}, {{time}}
|
|
||||||
document_properties_creator=Yaradan:
|
|
||||||
document_properties_producer=PDF yaradıcısı:
|
|
||||||
document_properties_version=PDF versiyası:
|
|
||||||
document_properties_page_count=Səhifə sayı:
|
|
||||||
document_properties_close=Qapat
|
|
||||||
|
|
||||||
print_progress_message=Sənəd çap üçün hazırlanır…
|
|
||||||
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
|
|
||||||
# a numerical per cent value.
|
|
||||||
print_progress_percent={{progress}}%
|
|
||||||
print_progress_close=Ləğv et
|
|
||||||
|
|
||||||
# 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=Yan Paneli Aç/Bağla
|
|
||||||
toggle_sidebar_notification.title=Yan paneli çevir (sənəddə icmal/bağlama var)
|
|
||||||
toggle_sidebar_label=Yan Paneli Aç/Bağla
|
|
||||||
document_outline.title=Sənədin eskizini göstər (bütün bəndləri açmaq/yığmaq üçün iki dəfə klikləyin)
|
|
||||||
document_outline_label=Sənəd strukturu
|
|
||||||
attachments.title=Bağlamaları göstər
|
|
||||||
attachments_label=Bağlamalar
|
|
||||||
thumbs.title=Kiçik şəkilləri göstər
|
|
||||||
thumbs_label=Kiçik şəkillər
|
|
||||||
findbar.title=Sənəddə Tap
|
|
||||||
findbar_label=Tap
|
|
||||||
|
|
||||||
# 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=Səhifə{{page}}
|
|
||||||
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
|
|
||||||
# number.
|
|
||||||
thumb_page_canvas={{page}} səhifəsinin kiçik vəziyyəti
|
|
||||||
|
|
||||||
# Find panel button title and messages
|
|
||||||
find_input.title=Tap
|
|
||||||
find_input.placeholder=Sənəddə tap…
|
|
||||||
find_previous.title=Bir öncəki uyğun gələn sözü tapır
|
|
||||||
find_previous_label=Geri
|
|
||||||
find_next.title=Bir sonrakı uyğun gələn sözü tapır
|
|
||||||
find_next_label=İrəli
|
|
||||||
find_highlight=İşarələ
|
|
||||||
find_match_case_label=Böyük/kiçik hərfə həssaslıq
|
|
||||||
find_reached_top=Sənədin yuxarısına çatdı, aşağıdan davam edir
|
|
||||||
find_reached_bottom=Sənədin sonuna çatdı, yuxarıdan davam edir
|
|
||||||
find_not_found=Uyğunlaşma tapılmadı
|
|
||||||
|
|
||||||
# Error panel labels
|
|
||||||
error_more_info=Daha çox məlumati
|
|
||||||
error_less_info=Daha az məlumat
|
|
||||||
error_close=Qapat
|
|
||||||
# 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}} (yığma: {{build}})
|
|
||||||
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
|
|
||||||
# english string describing the error.
|
|
||||||
error_message=İsmarıc: {{message}}
|
|
||||||
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
|
|
||||||
# trace.
|
|
||||||
error_stack=Stek: {{stack}}
|
|
||||||
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
|
|
||||||
error_file=Fayl: {{file}}
|
|
||||||
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
|
|
||||||
error_line=Sətir: {{line}}
|
|
||||||
rendering_error=Səhifə göstərilərkən səhv yarandı.
|
|
||||||
|
|
||||||
# Predefined zoom values
|
|
||||||
page_scale_width=Səhifə genişliyi
|
|
||||||
page_scale_fit=Səhifəni sığdır
|
|
||||||
page_scale_auto=Avtomatik yaxınlaşdır
|
|
||||||
page_scale_actual=Hazırki Həcm
|
|
||||||
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
|
|
||||||
# numerical scale value.
|
|
||||||
page_scale_percent={{scale}}%
|
|
||||||
|
|
||||||
# Loading indicator messages
|
|
||||||
loading_error_indicator=Səhv
|
|
||||||
loading_error=PDF yüklenərkən bir səhv yarandı.
|
|
||||||
invalid_file_error=Səhv və ya zədələnmiş olmuş PDF fayl.
|
|
||||||
missing_file_error=PDF fayl yoxdur.
|
|
||||||
unexpected_response_error=Gözlənilməz server cavabı.
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (text_annotation_type.alt): 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.alt=[{{type}} Annotasiyası]
|
|
||||||
password_label=Bu PDF faylı açmaq üçün şifrəni daxil edin.
|
|
||||||
password_invalid=Şifrə yanlışdır. Bir daha sınayın.
|
|
||||||
password_ok=Tamam
|
|
||||||
password_cancel=Ləğv et
|
|
||||||
|
|
||||||
printing_not_supported=Xəbərdarlıq: Çap bu səyyah tərəfindən tam olaraq dəstəklənmir.
|
|
||||||
printing_not_ready=Xəbərdarlıq: PDF çap üçün tam yüklənməyib.
|
|
||||||
web_fonts_disabled=Web Şriftlər söndürülüb: yerləşdirilmiş PDF şriftlərini istifadə etmək mümkün deyil.
|
|
||||||
document_colors_not_allowed=PDF sənədlərə öz rənglərini işlətməyə icazə verilmir: “Səhifələrə öz rənglərini istifadə etməyə icazə ver”mə səyyahda söndürülüb.
|
|
||||||
@@ -1,184 +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=Папярэдняя старонка
|
|
||||||
previous_label=Папярэдняя
|
|
||||||
next.title=Наступная старонка
|
|
||||||
next_label=Наступная
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
|
|
||||||
page.title=Старонка
|
|
||||||
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
|
|
||||||
# representing the total number of pages in the document.
|
|
||||||
of_pages=з {{pagesCount}}
|
|
||||||
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
|
|
||||||
# will be replaced by a number representing the currently visible page,
|
|
||||||
# respectively a number representing the total number of pages in the document.
|
|
||||||
page_of_pages=({{pageNumber}} з {{pagesCount}})
|
|
||||||
|
|
||||||
zoom_out.title=Паменшыць
|
|
||||||
zoom_out_label=Паменшыць
|
|
||||||
zoom_in.title=Павялічыць
|
|
||||||
zoom_in_label=Павялічыць
|
|
||||||
zoom.title=Павялічэнне тэксту
|
|
||||||
presentation_mode.title=Пераключыцца ў рэжым паказу
|
|
||||||
presentation_mode_label=Рэжым паказу
|
|
||||||
open_file.title=Адкрыць файл
|
|
||||||
open_file_label=Адкрыць
|
|
||||||
print.title=Друкаваць
|
|
||||||
print_label=Друкаваць
|
|
||||||
download.title=Сцягнуць
|
|
||||||
download_label=Сцягнуць
|
|
||||||
bookmark.title=Цяперашняя праява (скапіяваць або адчыніць у новым акне)
|
|
||||||
bookmark_label=Цяперашняя праява
|
|
||||||
|
|
||||||
# Secondary toolbar and context menu
|
|
||||||
tools.title=Прылады
|
|
||||||
tools_label=Прылады
|
|
||||||
first_page.title=Перайсці на першую старонку
|
|
||||||
first_page.label=Перайсці на першую старонку
|
|
||||||
first_page_label=Перайсці на першую старонку
|
|
||||||
last_page.title=Перайсці на апошнюю старонку
|
|
||||||
last_page.label=Перайсці на апошнюю старонку
|
|
||||||
last_page_label=Перайсці на апошнюю старонку
|
|
||||||
page_rotate_cw.title=Павярнуць па сонцу
|
|
||||||
page_rotate_cw.label=Павярнуць па сонцу
|
|
||||||
page_rotate_cw_label=Павярнуць па сонцу
|
|
||||||
page_rotate_ccw.title=Павярнуць супраць сонца
|
|
||||||
page_rotate_ccw.label=Павярнуць супраць сонца
|
|
||||||
page_rotate_ccw_label=Павярнуць супраць сонца
|
|
||||||
|
|
||||||
cursor_text_select_tool.title=Уключыць прыладу выбару тэксту
|
|
||||||
cursor_text_select_tool_label=Прылада выбару тэксту
|
|
||||||
cursor_hand_tool.title=Уключыць ручную прыладу
|
|
||||||
cursor_hand_tool_label=Ручная прылада
|
|
||||||
|
|
||||||
# Document properties dialog box
|
|
||||||
document_properties.title=Уласцівасці дакумента…
|
|
||||||
document_properties_label=Уласцівасці дакумента…
|
|
||||||
document_properties_file_name=Назва файла:
|
|
||||||
document_properties_file_size=Памер файла:
|
|
||||||
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
|
|
||||||
document_properties_kb={{size_kb}} КБ ({{size_b}} байт)
|
|
||||||
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in megabytes, respectively in bytes.
|
|
||||||
document_properties_mb={{size_mb}} МБ ({{size_b}} байт)
|
|
||||||
document_properties_title=Загаловак:
|
|
||||||
document_properties_author=Аўтар:
|
|
||||||
document_properties_subject=Тэма:
|
|
||||||
document_properties_keywords=Ключавыя словы:
|
|
||||||
document_properties_creation_date=Дата стварэння:
|
|
||||||
document_properties_modification_date=Дата змянення:
|
|
||||||
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
|
|
||||||
# will be replaced by the creation/modification date, and time, of the PDF file.
|
|
||||||
document_properties_date_string={{date}}, {{time}}
|
|
||||||
document_properties_creator=Стваральнік:
|
|
||||||
document_properties_producer=Вырабнік PDF:
|
|
||||||
document_properties_version=Версія PDF:
|
|
||||||
document_properties_page_count=Колькасць старонак:
|
|
||||||
document_properties_close=Закрыць
|
|
||||||
|
|
||||||
print_progress_message=Падрыхтоўка дакумента да друку…
|
|
||||||
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
|
|
||||||
# a numerical per cent value.
|
|
||||||
print_progress_percent={{progress}}%
|
|
||||||
print_progress_close=Скасаваць
|
|
||||||
|
|
||||||
# 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_notification.title=Паказаць/схаваць бакавую панэль (дакумент мае змест/укладанні)
|
|
||||||
toggle_sidebar_label=Паказаць/схаваць бакавую панэль
|
|
||||||
document_outline.title=Паказаць структуру дакумента (двайная пстрычка, каб разгарнуць /згарнуць усе элементы)
|
|
||||||
document_outline_label=Структура дакумента
|
|
||||||
attachments.title=Паказаць далучэнні
|
|
||||||
attachments_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}}
|
|
||||||
|
|
||||||
# Find panel button title and messages
|
|
||||||
find_input.title=Шукаць
|
|
||||||
find_input.placeholder=Шукаць у дакуменце…
|
|
||||||
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 в{{version}} (зборка: {{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=Сапраўдны памер
|
|
||||||
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
|
|
||||||
# numerical scale value.
|
|
||||||
page_scale_percent={{scale}}%
|
|
||||||
|
|
||||||
# Loading indicator messages
|
|
||||||
loading_error_indicator=Памылка
|
|
||||||
loading_error=Здарылася памылка падчас загрузкі PDF.
|
|
||||||
invalid_file_error=Няспраўны або пашкоджаны файл PDF.
|
|
||||||
missing_file_error=Адсутны файл PDF.
|
|
||||||
unexpected_response_error=Нечаканы адказ сервера.
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (text_annotation_type.alt): 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.alt=[{{type}} Annotation]
|
|
||||||
password_label=Увядзіце пароль, каб адкрыць гэты файл PDF.
|
|
||||||
password_invalid=Нядзейсны пароль. Паспрабуйце зноў.
|
|
||||||
password_ok=Добра
|
|
||||||
password_cancel=Скасаваць
|
|
||||||
|
|
||||||
printing_not_supported=Папярэджанне: друк не падтрымліваецца цалкам гэтым браўзерам.
|
|
||||||
printing_not_ready=Увага: PDF не сцягнуты цалкам для друкавання.
|
|
||||||
web_fonts_disabled=Шрыфты Сеціва забаронены: немагчыма ўжываць укладзеныя шрыфты PDF.
|
|
||||||
document_colors_not_allowed=PDF-дакументам не дазволена выкарыстоўваць свае колеры: у браўзеры адключаны параметр "Дазволіць вэб-сайтам выкарыстоўваць свае колеры".
|
|
||||||
@@ -1,184 +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=Предишна страница
|
|
||||||
previous_label=Предишна
|
|
||||||
next.title=Следваща страница
|
|
||||||
next_label=Следваща
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
|
|
||||||
page.title=Страница
|
|
||||||
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
|
|
||||||
# representing the total number of pages in the document.
|
|
||||||
of_pages=от {{pagesCount}}
|
|
||||||
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
|
|
||||||
# will be replaced by a number representing the currently visible page,
|
|
||||||
# respectively a number representing the total number of pages in the document.
|
|
||||||
page_of_pages=({{pageNumber}} от {{pagesCount}})
|
|
||||||
|
|
||||||
zoom_out.title=Намаляване
|
|
||||||
zoom_out_label=Намаляване
|
|
||||||
zoom_in.title=Увеличаване
|
|
||||||
zoom_in_label=Увеличаване
|
|
||||||
zoom.title=Мащабиране
|
|
||||||
presentation_mode.title=Превключване към режим на представяне
|
|
||||||
presentation_mode_label=Режим на представяне
|
|
||||||
open_file.title=Отваряне на файл
|
|
||||||
open_file_label=Отваряне
|
|
||||||
print.title=Отпечатване
|
|
||||||
print_label=Отпечатване
|
|
||||||
download.title=Изтегляне
|
|
||||||
download_label=Изтегляне
|
|
||||||
bookmark.title=Текущ изглед (копиране или отваряне в нов прозорец)
|
|
||||||
bookmark_label=Текущ изглед
|
|
||||||
|
|
||||||
# Secondary toolbar and context menu
|
|
||||||
tools.title=Инструменти
|
|
||||||
tools_label=Инструменти
|
|
||||||
first_page.title=Към първата страница
|
|
||||||
first_page.label=Към първата страница
|
|
||||||
first_page_label=Към първата страница
|
|
||||||
last_page.title=Към последната страница
|
|
||||||
last_page.label=Към последната страница
|
|
||||||
last_page_label=Към последната страница
|
|
||||||
page_rotate_cw.title=Завъртане по часовниковата стрелка
|
|
||||||
page_rotate_cw.label=Завъртане по часовниковата стрелка
|
|
||||||
page_rotate_cw_label=Завъртане по часовниковата стрелка
|
|
||||||
page_rotate_ccw.title=Завъртане обратно на часовниковата стрелка
|
|
||||||
page_rotate_ccw.label=Завъртане обратно на часовниковата стрелка
|
|
||||||
page_rotate_ccw_label=Завъртане обратно на часовниковата стрелка
|
|
||||||
|
|
||||||
cursor_text_select_tool.title=Включване на инструмента за избор на текст
|
|
||||||
cursor_text_select_tool_label=Инструмент за избор на текст
|
|
||||||
cursor_hand_tool.title=Включване на инструмента ръка
|
|
||||||
cursor_hand_tool_label=Инструмент ръка
|
|
||||||
|
|
||||||
# Document properties dialog box
|
|
||||||
document_properties.title=Свойства на документа…
|
|
||||||
document_properties_label=Свойства на документа…
|
|
||||||
document_properties_file_name=Име на файл:
|
|
||||||
document_properties_file_size=Големина на файл:
|
|
||||||
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
|
|
||||||
document_properties_kb={{size_kb}} КБ ({{size_b}} байта)
|
|
||||||
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
|
|
||||||
# will be replaced by the PDF file size in megabytes, respectively in bytes.
|
|
||||||
document_properties_mb={{size_mb}} МБ ({{size_b}} байта)
|
|
||||||
document_properties_title=Заглавие:
|
|
||||||
document_properties_author=Автор:
|
|
||||||
document_properties_subject=Тема:
|
|
||||||
document_properties_keywords=Ключови думи:
|
|
||||||
document_properties_creation_date=Дата на създаване:
|
|
||||||
document_properties_modification_date=Дата на промяна:
|
|
||||||
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
|
|
||||||
# will be replaced by the creation/modification date, and time, of the PDF file.
|
|
||||||
document_properties_date_string={{date}}, {{time}}
|
|
||||||
document_properties_creator=Създател:
|
|
||||||
document_properties_producer=PDF произведен от:
|
|
||||||
document_properties_version=PDF версия:
|
|
||||||
document_properties_page_count=Брой страници:
|
|
||||||
document_properties_close=Затваряне
|
|
||||||
|
|
||||||
print_progress_message=Подготвяне на документа за отпечатване…
|
|
||||||
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
|
|
||||||
# a numerical per cent value.
|
|
||||||
print_progress_percent={{progress}}%
|
|
||||||
print_progress_close=Отказ
|
|
||||||
|
|
||||||
# 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_notification.title=Превключване на страничната лента (документи със структура/прикачени файлове)
|
|
||||||
toggle_sidebar_label=Превключване на страничната лента
|
|
||||||
document_outline.title=Показване на структурата на документа (двукратно щракване за свиване/разгъване на всичко)
|
|
||||||
document_outline_label=Структура на документа
|
|
||||||
attachments.title=Показване на притурките
|
|
||||||
attachments_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}}
|
|
||||||
|
|
||||||
# Find panel button title and messages
|
|
||||||
find_input.title=Търсене
|
|
||||||
find_input.placeholder=Търсене в документа…
|
|
||||||
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 версия {{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=Действителен размер
|
|
||||||
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
|
|
||||||
# numerical scale value.
|
|
||||||
page_scale_percent={{scale}}%
|
|
||||||
|
|
||||||
# Loading indicator messages
|
|
||||||
loading_error_indicator=Грешка
|
|
||||||
loading_error=Получи се грешка при зареждане на PDF-а.
|
|
||||||
invalid_file_error=Невалиден или повреден PDF файл.
|
|
||||||
missing_file_error=Липсващ PDF файл.
|
|
||||||
unexpected_response_error=Неочакван отговор от сървъра.
|
|
||||||
|
|
||||||
# LOCALIZATION NOTE (text_annotation_type.alt): 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.alt=[Анотация {{type}}]
|
|
||||||
password_label=Въведете парола за отваряне на този PDF файл.
|
|
||||||
password_invalid=Невалидна парола. Моля, опитайте отново.
|
|
||||||
password_ok=Добре
|
|
||||||
password_cancel=Отказ
|
|
||||||
|
|
||||||
printing_not_supported=Внимание: Този браузър няма пълна поддръжка на отпечатване.
|
|
||||||
printing_not_ready=Внимание: Този PDF файл не е напълно зареден за печат.
|
|
||||||
web_fonts_disabled=Уеб-шрифтовете са забранени: разрешаване на използването на вградените PDF шрифтове.
|
|
||||||
document_colors_not_allowed=На PDF-документите не е разрешено да използват собствени цветове: „Разрешаване на страниците да избират собствени цветове“ е изключено в браузъра.
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user