Skip to content

Commit be8a293

Browse files
authored
Merge pull request #3 from jeidison/develop
Develop
2 parents 943f71c + 6f76afa commit be8a293

354 files changed

Lines changed: 31833 additions & 224 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
composer.lock
3-
vendor
3+
.phpunit.result.cache
4+
vendor

README.md

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,58 @@ This package is only wrapper of [JSignPdf](http://jsignpdf.sourceforge.net/) to
44

55
### Installation:
66

7-
```sh
7+
```bash
88
$ composer require jeidison/jsignpdf-php
99
```
10-
11-
### Warning
12-
This package use JAVA for sign PDFs
1310

1411
Examples:
1512

1613
```php
1714
use Jeidison\JSignPDF\JSignPDF;
15+
use Jeidison\JSignPDF\Sign\JSignParam;
16+
17+
$param = JSignParam::instance();
18+
$param->setCertificate(file_get_contents('/path/to/file/certificate.pfx'));
19+
$param->setPdf(file_get_contents('/path/to/file/pdf_to_sign.pdf'));
20+
$param->setPassword('certificate_password');
1821

19-
try {
20-
$jSignPdf = new JSignPDF();
21-
$jSignPdf->setCertificate(file_get_contents('caminho_do_seu_certificado_aqui.pfx'));
22-
$jSignPdf->setPassword('senha_do_seu_certificado_aqui');
23-
$jSignPdf->setPdf(file_get_contents('caminho_do_pdf_que_voce_quer_assinar.pdf'));
24-
$fileSigned = $jSignPdf->sign()->output();
25-
file_put_contents('caminho_onde_voce_quer_salvar_aqui.pdf', $fileSigned);
26-
} catch (Exception $e) {
27-
var_dump($e);
28-
}
22+
$jSignPdf = new JSignPDF($param);
23+
$fileSigned = $jSignPdf->sign();
24+
file_put_contents('/path/to/file/file_signed.pdf', $fileSigned);
2925
```
3026

31-
### Without composer:
27+
With Java Installed:
28+
```php
3229

33-
- Download Repository
34-
- Unzip file
30+
...
3531

36-
```php
37-
<?php
32+
$param->setIsUseJavaInstalled(true);
3833

39-
require_once "path/to/JSignPDF.php";
34+
...
35+
```
4036

41-
use Jeidison\JSignPDF\JSignPDF;
37+
File signed as base64:
38+
```php
39+
...
40+
$param->setIsOutputTypeBase64(true);
41+
...
42+
$fileSignedAsBase64 = $jSignPdf->sign();
43+
file_put_contents('/path/to/file/file_signed.pdf', base64_decode($fileSignedAsBase64));
44+
```
45+
46+
Change temp directory:
47+
```php
48+
...
49+
$param->setTempPath('/path/temp/to/sign/files/');
50+
...
51+
```
4252

43-
try {
44-
$jSignPdf = new JSignPDF();
45-
$jSignPdf->setCertificate(file_get_contents('caminho_do_seu_certificado_aqui.pfx'));
46-
$jSignPdf->setPassword('senha_do_seu_certificado_aqui');
47-
$jSignPdf->setPdf(file_get_contents('caminho_do_pdf_que_voce_quer_assinar.pdf'));
48-
$fileSigned = $jSignPdf->sign()->output();
49-
file_put_contents('caminho_onde_voce_quer_salvar_aqui.pdf', $fileSigned);
50-
} catch (Exception $e) {
51-
var_dump($e);
52-
}
53+
Change parameters of JSignPDF:
54+
```php
55+
...
56+
$param->setJSignParameters("-a -kst PKCS12 -ts https://freetsa.org/tsr");
57+
...
5358
```
59+
60+
## Credits
61+
- [Jeidison Farias](https://github.com/jeidison)

bin/jre1.8.0_241_linux/COPYRIGHT

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Copyright � 1993, 2020, Oracle and/or its affiliates.
2+
All rights reserved.
3+
4+
This software and related documentation are provided under a
5+
license agreement containing restrictions on use and
6+
disclosure and are protected by intellectual property laws.
7+
Except as expressly permitted in your license agreement or
8+
allowed by law, you may not use, copy, reproduce, translate,
9+
broadcast, modify, license, transmit, distribute, exhibit,
10+
perform, publish, or display any part, in any form, or by
11+
any means. Reverse engineering, disassembly, or
12+
decompilation of this software, unless required by law for
13+
interoperability, is prohibited.
14+
15+
The information contained herein is subject to change
16+
without notice and is not warranted to be error-free. If you
17+
find any errors, please report them to us in writing.
18+
19+
If this is software or related documentation that is
20+
delivered to the U.S. Government or anyone licensing it on
21+
behalf of the U.S. Government, the following notice is
22+
applicable:
23+
24+
U.S. GOVERNMENT END USERS: Oracle programs, including any
25+
operating system, integrated software, any programs
26+
installed on the hardware, and/or documentation, delivered
27+
to U.S. Government end users are "commercial computer
28+
software" pursuant to the applicable Federal Acquisition
29+
Regulation and agency-specific supplemental regulations. As
30+
such, use, duplication, disclosure, modification, and
31+
adaptation of the programs, including any operating system,
32+
integrated software, any programs installed on the hardware,
33+
and/or documentation, shall be subject to license terms and
34+
license restrictions applicable to the programs. No other
35+
rights are granted to the U.S. Government.
36+
37+
This software or hardware is developed for general use in a
38+
variety of information management applications. It is not
39+
developed or intended for use in any inherently dangerous
40+
applications, including applications that may create a risk
41+
of personal injury. If you use this software or hardware in
42+
dangerous applications, then you shall be responsible to
43+
take all appropriate fail-safe, backup, redundancy, and
44+
other measures to ensure its safe use. Oracle Corporation
45+
and its affiliates disclaim any liability for any damages
46+
caused by use of this software or hardware in dangerous
47+
applications.
48+
49+
Oracle and Java are registered trademarks of Oracle and/or
50+
its affiliates. Other names may be trademarks of their
51+
respective owners.
52+
53+
Intel and Intel Xeon are trademarks or registered trademarks
54+
of Intel Corporation. All SPARC trademarks are used under
55+
license and are trademarks or registered trademarks of SPARC
56+
International, Inc. AMD, Opteron, the AMD logo, and the AMD
57+
Opteron logo are trademarks or registered trademarks of
58+
Advanced Micro Devices. UNIX is a registered trademark of
59+
The Open Group.
60+
61+
This software or hardware and documentation may provide
62+
access to or information on content, products, and services
63+
from third parties. Oracle Corporation and its affiliates
64+
are not responsible for and expressly disclaim all
65+
warranties of any kind with respect to third-party content,
66+
products, and services. Oracle Corporation and its
67+
affiliates will not be responsible for any loss, costs, or
68+
damages incurred due to your access to or use of third-party
69+
content, products, or services.

bin/jre1.8.0_241_linux/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please refer to https://java.com/otnlicense

bin/jre1.8.0_241_linux/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please refer to http://java.com/licensereadme

0 commit comments

Comments
 (0)