-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathREADME.orig
86 lines (69 loc) · 2.56 KB
/
README.orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
about:
extensions of mupdf. by 88911562@qq.com
extension functions:
1)add pdf signature with image appearance.
2)add pdf signature with path appearance.
3)insert image to pdf.
4)add hand draw annotation to pdf.
5)annotation can added with password, and check password on deleting annotation.
the all above functions could be used on windows, ios, android platform, and for java, c++ language.
samples,look at:
mupdf_path/source/z/pdf/samples/pdf_samples.c
compile samples:
$cd mupdf_path/source/z/pdf/
$./compile.sh
then you can run sample:
$./pdftest
note:
pdf signature samples may needs certificate, there is a test certificate at:
mupdf_path/source/z/pdf/samples/user/zl.pfx
and it's password is '111111'
you must reset the path of pdf file, signature image, certificate
, in pdf_samples.c
the source code is like:
#define RES_PATH "ResourecePath"
#define RES_Image_file RES_PATH"/esp_saved.png"
#define RES_Pdf_file RES_PATH"/pdffile/test.pdf"
#define RES_Cert_file RES_PATH"/user/zl.pfx"
compile mupdf core library on windows,mac,linux platform:
first step:
compile your openssl lib, get 2 library: libcrypto.a, libssl.a
second:
copy to mupdf_dir_path/thirdparty/openssl/platform/ dir
platform is: ios, macos, win, linux
finnally:
$cd mupdf_dir_path
$make -f Makefile HAVE_LIBCRYPTO=yes HAVE_OPENSSL_SSL=yes build=debug
you can use "HAVE_OPENSSL=yes" to replace "HAVE_LIBCRYPTO=yes HAVE_OPENSSL_SSL=yes"
if everything is ok, you can get libmupdf.a at mupdf_dir_path/build/release(debug)/
now you can use libmupdf.a to add image/(hand draw) signature, add image, add
hand draw annotations....
do not forget:
when compile application, you must link openssl library.
example:
gcc ./test_pdf_signature.c -LPathofOpensslLib -lcrypto -lssl -lmupdf
compile mupdf for android:
must install ndk, and compile neeeded architecture openssl lib.
then, excute the following command:
$cd mupdf_dir_path/platform/android/viewer/
$make -C ../../.. generate
$ndk-build
you can get dynamic lib for android at: mupdf_dir_path/platform/android/viewer/lib
for ios:
you can open the project at(mupdf_dir_path/platform/ios) with xcode directly.
select the Mupdf_openssl_sign target to compile.
the ios application's directory like this:
app_path/Documents
+/imagefiles
image_files
+/pfxfiles
certificate_files
.....
pdffiles.pdf
.....
the test directory is created at:
mupdf_path/platform/ios/Documents/
you can use this folder directly.
all extensions by 88911562@qq.com
mupdf official website:
www.mupdf.com