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

Garbled characters when Japanese is used for signature information #267

Open
heoquay70 opened this issue Sep 3, 2024 · 2 comments
Open

Comments

@heoquay70
Copy link

heoquay70 commented Sep 3, 2024

Describe the bug and the expected behaviour
pdflibAddPlaceholder.ts
If Japanese is used for signature information,
When the signature information screen is opened with PDF software or a browser,

Is it a bug in signing or in the helpers?
placeholder-pdf-lib
pdflibAddPlaceholder.js

To Reproduce
How about modifying the following part?

  const signatureDict = doc.context.obj({
    Type: 'Sig',
    Filter: 'Adobe.PPKLite',
    SubFilter: subFilter,
    ByteRange: byteRange,
    Contents: placeholder,
    Reason: _pdfLib.PDFString.of(reason), ---> Reason: _pdfLib.PDFHexString.fromText(reason),
    M: _pdfLib.PDFString.fromDate(signingTime !== null && signingTime !== void 0 ? signingTime : new Date()),
    ContactInfo: _pdfLib.PDFString.of(contactInfo), ---> ContactInfo: _pdfLib.PDFHexString.fromText(contactInfo),
    Name: _pdfLib.PDFString.of(name), ---> Name: _pdfLib.PDFHexString.fromText(name),
    Location: _pdfLib.PDFString.of(location), ---> Location: _pdfLib.PDFHexString.fromText(location),
    Prop_Build: {
      Filter: {
        Name: 'Adobe.PPKLite'
      },
      ...appBuild
    }
  });
@vbuch
Copy link
Owner

vbuch commented Sep 4, 2024

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

3 participants
@vbuch @heoquay70 and others