Closed ashirman closed 4 years ago
I'm looking on mobile but I have a small concern: those used to be instances of String and not strings. I am lrettybsure there was a good reason for that lying somewhere in pdfkit. There was some logic in there that checked if var isnatceof String. That was when this code was initially written. Not sure if things changed. Can you check that?
Not sure if things changed. Can you check that?
Indeed, there are some places where pdfkit
check instance of given strings. eg
// String literals are converted to the PDF name type
if (typeof object === 'string') {
return "/".concat(object); // String objects are converted to PDF strings (UTF-16)
} else if (object instanceof String) {
so I feel it is better to wrap passed strings as String
eg ContactInfo: new String(contactInfo)
so we could rely on internal behaviour of pdfkit
. PR has beed updated properly please take a look.
Would be nice if you could include tests that check if the data is actually stored in a resulting pdf.
Would be nice if you could include tests that check if the data is actually stored in a resulting pdf.
I put couple tests to be able to check pdfkitAddPlaceholder
method behaviour.
the build has been restored and now changes are ready to be merged. Could you please do that?
currently
pdfkitAddPlaceholder
API allows to customise onlyreason
field for generated signature.Makes sense to extend it so we could have chance to set also
contactInfo
,name
,location
fields of signature. Changes are backward compatible so users do not need to explicitly pass these values if they do not wish to do it.