Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF open but signature not displaying. #112

Open
Paul75 opened this issue Aug 8, 2020 · 4 comments
Open

PDF open but signature not displaying. #112

Paul75 opened this issue Aug 8, 2020 · 4 comments

Comments

@Paul75
Copy link

Paul75 commented Aug 8, 2020

hello,

I have a PDF it read but not all in document appear. In the document I have a signature that not display. It display good with app Adobe Acrobat Reader. With other (only test one) ng2-pdf-viewer it display good ...

Thanks

@codehippie1
Copy link
Contributor

Can you try with mozilla's pdf.js directly. This angular component uses pdf.js behind the scenes

@codehippie1
Copy link
Contributor

@Paul75 Also, can you send me the file you are trying with?

@LAlves91
Copy link

Hi @Paul75 !

This library uses a local copy of PDF.js underneath. Currently, this copy is of PDF.js v2.2.171, which is the cause of your problem: PDF.js didn't display Digital Signature Widgets until v2.9.359 (implemented on pull request #13214).

In order to display digital signatures, you'll have to use your own version of pdf.worker.js (I'm still studying this library's code, so I don't know if there's a simple way of doing it), with a minor modification:

@@ -28213,8 +28213,9 @@ function () {
             case 'Ch':
               return new ChoiceWidgetAnnotation(parameters);
           }
-
-          (0, _util.warn)('Unimplemented widget field type "' + fieldType + '", ' + 'falling back to base field type.');
+          if (fieldType !== 'Sig') {
+            (0, _util.warn)('Unimplemented widget field type "' + fieldType + '", ' + 'falling back to base field type.');
+          }
           return new WidgetAnnotation(parameters);
 
         case 'Popup':
@@ -28684,7 +28685,7 @@ function (_Annotation) {
     if (data.fieldType === 'Sig') {
       data.fieldValue = null;
 
-      _this2.setFlags(_util.AnnotationFlag.HIDDEN);
+      // _this2.setFlags(_util.AnnotationFlag.HIDDEN);
     }
 
     return _this2;

From what I've seen so far, you'll have to assign the path of your worker to PDF.js:

import * as PDFJS from 'path/to/pdfjs/build/pdf';

PDFJS.GlobalWorkerOptions['workerSrc'] = 'path/to/your/worker.js';

Cheers!

@clainchoupi
Copy link

Hi guys,
I have a similar issue for one of my project.

Do you know if it is related to the use of an old version of PDF.js ?
Is there a workaround for this issue ?

Let me know if I can be of any help :P
Cheers
Pierre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants