vue-pdf icon indicating copy to clipboard operation
vue-pdf copied to clipboard

Unable to display signature

Open gongxi036 opened this issue 5 years ago • 9 comments

 - vue-pdf version: 4.0.7
 - vue.js version: 2.6.10
 - webpack version: 4.28.4
 - browser version: Chrome 
 - OS version: Windows

hello, On the last page of the pdf,there should be a user signature,but it disappeared.

gongxi036 avatar Jun 18 '19 14:06 gongxi036

as

in there, there should be a user signature, but it disappeared. How to solve this problem.

gongxi036 avatar Jun 19 '19 02:06 gongxi036

I have the same problem, signatures that doesn't display in the pdf. It's completely blank.

oliviervanbulck avatar Oct 03 '19 10:10 oliviervanbulck

change pdfjs-dist -> pdf.worker.js /if (data.fieldType === 'Sig') { _this2.setFlags(_util.AnnotationFlag.HIDDEN); }/

bruncelee avatar Oct 29 '19 10:10 bruncelee

Any update on this issue?

kwyz avatar Jan 28 '20 12:01 kwyz

O have the same problem, is not a problem with vue-pdf is a problem with pdfjs-dist as @bruncelee said. You can do a modification to pdfjs-dist yourself or you can replace the version of pdfjs-dist for the one I have fork on my repo. Hope it helps

lisandrop05 avatar Feb 22 '20 02:02 lisandrop05

Hello,Is there any progress on this issue? change pdfjs-dist -> pdf.worker.js is No effect

xusJs avatar Apr 27 '20 03:04 xusJs

Hello,Is there any progress on this issue? change pdfjs-dist -> pdf.worker.js is No effect

https://github.com/lisandrop05/pdfjs-dist/commit/127439126553a8ed48c40d455aaa80ad6f1a61e8

in this commit I fixit, now my version of pdfjs-dist, show signature fields, as you can see in commit, I changed build/pdf.worker.js and lib/core/annotation.js hope it helps

lisandrop05 avatar Apr 27 '20 16:04 lisandrop05

I also have this problem and I Comment the file pdfjs-dist/build/pdf.worker.js line 23178 judge the value of data.fieldType and set this.flags=2,and it`s works finally

ecnatsiDehTog avatar Jun 22 '20 06:06 ecnatsiDehTog

go to pdfjs-dist/build/pdf.worker.js and with find phrase tool type: 'Unimplemented widget field type'

you should see code like this:

switch (fieldType) {
     case "Tx":
          return new TextWidgetAnnotation(parameters);

     case "Btn":
          return new ButtonWidgetAnnotation(parameters);

     case "Ch":
          return new ChoiceWidgetAnnotation(parameters);
}
(0, _util.warn)(`Unimplemented widget field type "${fieldType}", ` + "falling back to base field type.");

if you don't have case "Sig" (in my case, i didn't had it), you must add it like image widget

switch (fieldType) {
     case "Tx":
          return new TextWidgetAnnotation(parameters);

     case "Btn":
          return new ButtonWidgetAnnotation(parameters);

     case "Ch":
          return new ChoiceWidgetAnnotation(parameters);

     case "Sig":
          return new SquareAnnotation(parameters);
}
(0, _util.warn)(`Unimplemented widget field type "${fieldType}", ` + "falling back to base field type.");

this modify works for me.

this will render signatures like images, just remember if you add/remove packages with npm or yarn, this modify will overwrite, do this before build application

TaTo30 avatar Aug 24 '21 00:08 TaTo30