Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Lib-PDF
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
JS Toolbox
Lib-PDF
Commits
2a3ca79f
Commit
2a3ca79f
authored
2 years ago
by
Zdravko Iliev
Browse files
Options
Downloads
Patches
Plain Diff
fix params
parent
38e90c71
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dist/utils.d.ts
+1
-1
1 addition, 1 deletion
dist/utils.d.ts
dist/utils.js
+5
-5
5 additions, 5 deletions
dist/utils.js
src/utils.ts
+10
-10
10 additions, 10 deletions
src/utils.ts
with
16 additions
and
16 deletions
dist/utils.d.ts
+
1
−
1
View file @
2a3ca79f
export
declare
const
TimestampAndEnableLTV
:
(
in_docpath
:
any
,
tsa_url
:
any
,
in_trusted_
cert
_p
ath
:
any
,
in_appearance_img_path
:
any
,
coords
:
any
)
=>
Promise
<
any
>
;
export
declare
const
TimestampAndEnableLTV
:
(
docBuffer
:
ArrayBuffer
,
cert
P
ath
:
string
,
certTSAUrl
:
string
,
imgBytes
:
ArrayBuffer
,
coords
:
any
)
=>
Promise
<
ArrayBuffer
>
;
This diff is collapsed.
Click to expand it.
dist/utils.js
+
5
−
5
View file @
2a3ca79f
...
...
@@ -11,13 +11,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
TimestampAndEnableLTV
=
void
0
;
const
pdfnet_node_1
=
require
(
"
@pdftron/pdfnet-node
"
);
const
TimestampAndEnableLTV
=
(
in_docpath
,
tsa_url
,
in_trusted_
cert
_p
ath
,
in_appearance_img_path
,
coords
)
=>
__awaiter
(
void
0
,
void
0
,
void
0
,
function
*
()
{
const
doc
=
yield
pdfnet_node_1
.
PDFNet
.
PDFDoc
.
createFromBuffer
(
in_docpath
);
const
TimestampAndEnableLTV
=
(
docBuffer
,
cert
P
ath
,
certTSAUrl
,
imgBytes
,
coords
)
=>
__awaiter
(
void
0
,
void
0
,
void
0
,
function
*
()
{
const
doc
=
yield
pdfnet_node_1
.
PDFNet
.
PDFDoc
.
createFromBuffer
(
docBuffer
);
doc
.
initSecurityHandler
();
const
tst_config
=
yield
pdfnet_node_1
.
PDFNet
.
TimestampingConfiguration
.
createFromURL
(
tsa_u
rl
);
const
tst_config
=
yield
pdfnet_node_1
.
PDFNet
.
TimestampingConfiguration
.
createFromURL
(
certTSAU
rl
);
const
opts
=
yield
pdfnet_node_1
.
PDFNet
.
VerificationOptions
.
create
(
pdfnet_node_1
.
PDFNet
.
VerificationOptions
.
SecurityLevel
.
e_compatibility_and_archiving
);
yield
opts
.
addTrustedCertificateUString
(
in_trusted_
cert
_p
ath
);
const
img
=
yield
pdfnet_node_1
.
PDFNet
.
Image
.
createFromMemory2
(
doc
,
i
n_appearance_img_path
);
yield
opts
.
addTrustedCertificateUString
(
cert
P
ath
);
const
img
=
yield
pdfnet_node_1
.
PDFNet
.
Image
.
createFromMemory2
(
doc
,
i
mgBytes
);
//make this dynamic with canvas lib
const
imgWidth
=
300
;
const
imgHeight
=
300
;
...
...
This diff is collapsed.
Click to expand it.
src/utils.ts
+
10
−
10
View file @
2a3ca79f
import
{
PDFNet
}
from
"
@pdftron/pdfnet-node
"
;
export
const
TimestampAndEnableLTV
=
async
(
in_docpath
,
tsa_url
,
in_trusted_cert_path
,
i
n_appearance_img_path
,
coords
)
=>
{
const
doc
=
await
PDFNet
.
PDFDoc
.
createFromBuffer
(
in_docpath
);
docBuffer
:
ArrayBuffer
,
certPath
:
string
,
certTSAUrl
:
string
,
i
mgBytes
:
ArrayBuffer
,
coords
:
any
)
:
Promise
<
ArrayBuffer
>
=>
{
const
doc
=
await
PDFNet
.
PDFDoc
.
createFromBuffer
(
docBuffer
);
doc
.
initSecurityHandler
();
const
tst_config
=
await
PDFNet
.
TimestampingConfiguration
.
createFromURL
(
tsa_u
rl
certTSAU
rl
);
const
opts
=
await
PDFNet
.
VerificationOptions
.
create
(
PDFNet
.
VerificationOptions
.
SecurityLevel
.
e_compatibility_and_archiving
);
await
opts
.
addTrustedCertificateUString
(
in_trusted_
cert
_p
ath
);
await
opts
.
addTrustedCertificateUString
(
cert
P
ath
);
const
img
=
await
PDFNet
.
Image
.
createFromMemory2
(
doc
,
i
n_appearance_img_path
);
const
img
=
await
PDFNet
.
Image
.
createFromMemory2
(
doc
,
i
mgBytes
);
//make this dynamic with canvas lib
const
imgWidth
=
300
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment