Skip to content

Garbled characters when Japanese is used for signature information #267

Description

@heoquay70

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
    }
  });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions