GithubHelp home page GithubHelp logo

Comments (7)

vbuch avatar vbuch commented on May 21, 2024

Did you add it?

from node-signpdf.

angeltg83 avatar angeltg83 commented on May 21, 2024

I can't,
I have a pdf created with another library, this is my code,

let signer = require('node-signpdf').default;

console.log('\n\n\nsigner', signer);
let URL_PDF = "/home/xxx/Desktop/PDF_FIRMA/prueba.pdf";
let TOKEN_P12 = "/home/xx/Desktop/PDF_FIRMA/PLAN VITAL VITALPLAN S.A.P12";

var pdfBuffer = fs.readFileSync(URL_PDF);

console.log('pdfBuffer', pdfBuffer);

const signedPdf = signer.sign(
  pdfBuffer,
  fs.readFileSync(TOKEN_P12),
  { passphrase: 'pass.31', asn1StrictParsing: true, },
);

// return res.json(signer);

Screenshot from 2019-06-30 09-34-05

Please help!!

from node-signpdf.

vbuch avatar vbuch commented on May 21, 2024

.sign expects the placeholder to be there. read the readme. Also take a look here: #22

from node-signpdf.

angeltg83 avatar angeltg83 commented on May 21, 2024

use the helper of your plainAddPlaceholder library, as the code is shown

var signer = require('node-signpdf').default;
var placeholder = require('node-signpdf').plainAddPlaceholder.default;
var fs = require('fs');
var PATH_TO_PDF_FILE = "prueba.pdf";
var PATH_TO_P12_CERTIFICATE = "/pc/TOKEN.P12";

console.log('signer UUU ', placeholder);

var pdfBuffer = fs.readFileSync(PATH_TO_PDF_FILE),
  pdfBuffer = placeholder({
    pdfBuffer,
    reason: '',
    signatureLength: 1612,
  });



var signedPdf = signer.sign(
  // fs.readFileSync(PATH_TO_PDF_FILE),
  pdfBuffer,
  fs.readFileSync(PATH_TO_P12_CERTIFICATE), {
    passphrase: 'pas.311',
    asn1StrictParsing: true,
  }
);

console.log('signedPdf ', signedPdf);

fs.writeFileSync('PC/Firmando[PDF]/21820[RQ000009]FIRMADO.pdf', signedPdf);

and then show the error:

Screenshot from 2019-07-05 18-37-09

please!!, help,

from node-signpdf.

vbuch avatar vbuch commented on May 21, 2024

Well, this is not yet supported as the error says. Your pdf already contains annotations and i have not written code to handle that situation... If someone has the time to do it, a PR would be more than welcome.

from node-signpdf.

angeltg83 avatar angeltg83 commented on May 21, 2024

I already made it, edited the library and I was successful. only that the pdf when verifying it with adobe the signature is obtained inconsistent.

from node-signpdf.

vbuch avatar vbuch commented on May 21, 2024

No activity. Closing.

from node-signpdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.