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
49c8f2ee
Commit
49c8f2ee
authored
2 years ago
by
Zdravko Iliev
Browse files
Options
Downloads
Patches
Plain Diff
shutdown the lib only for node
parent
63357a8e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
__tests__/outputs/tron/abacus-two-signatures-im11age.pdf
+1682
-0
1682 additions, 0 deletions
__tests__/outputs/tron/abacus-two-signatures-im11age.pdf
dist/pdfParser.js
+4
-2
4 additions, 2 deletions
dist/pdfParser.js
src/pdfParser.ts
+5
-2
5 additions, 2 deletions
src/pdfParser.ts
with
1691 additions
and
4 deletions
__tests__/outputs/tron/abacus-two-signatures-im11age.pdf
0 → 100644
+
1682
−
0
View file @
49c8f2ee
File added
This diff is collapsed.
Click to expand it.
dist/pdfParser.js
+
4
−
2
View file @
49c8f2ee
...
...
@@ -70,7 +70,7 @@ class PDFparser {
});
this
.
insertQrCode
=
(
imgBytes
,
url
,
coords
,
scaleFactor
,
licenseKey
,
certPath
,
certTSAUrl
)
=>
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
let
lib
,
buf
;
if
(
typeof
window
!==
`
undefined
`
)
{
if
(
typeof
window
!==
"
undefined
"
)
{
lib
=
window
.
PDFNet
;
}
else
{
...
...
@@ -85,7 +85,9 @@ class PDFparser {
console
.
log
(
error
);
throw
new
errors_1
.
GeneralError
(
"
Could Not sign pdf
"
);
}
yield
lib
.
shutdown
();
if
(
typeof
window
===
"
undefined
"
)
{
yield
lib
.
shutdown
();
}
return
buf
;
});
this
.
document
=
document
;
...
...
This diff is collapsed.
Click to expand it.
src/pdfParser.ts
+
5
−
2
View file @
49c8f2ee
...
...
@@ -67,7 +67,7 @@ class PDFparser {
certTSAUrl
:
string
):
Promise
<
ArrayBuffer
>
=>
{
let
lib
,
buf
;
if
(
typeof
window
!==
`
undefined
`
)
{
if
(
typeof
window
!==
"
undefined
"
)
{
lib
=
window
.
PDFNet
;
}
else
{
const
pdflib
=
await
import
(
"
@pdftron/pdfnet-node
"
);
...
...
@@ -89,7 +89,10 @@ class PDFparser {
throw
new
GeneralError
(
"
Could Not sign pdf
"
);
}
await
lib
.
shutdown
();
if
(
typeof
window
===
"
undefined
"
)
{
await
lib
.
shutdown
();
}
return
buf
;
};
}
...
...
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