HummusJS icon indicating copy to clipboard operation
HummusJS copied to clipboard

Add metadata in pdf file using hummus.js

Open tajinder-debut opened this issue 5 years ago • 2 comments

Thanks for writing this awesome library.

I am trying to add metadata in pdf file as key-value pair. Like we can add additional metadata from Acrobat manually. How can we add it through hummus.js??

I have referred https://github.com/galkahana/HummusJS/issues/237 but could not figure out anything. Initially we tried to add out metadata key using .writeKey method but code gave certain error whereas if we trying to write value in already existing key then it creates a file but does not add that value in existing metadata key.

So I tried to add metadata key and valuw and then value to already existing key but did not have any luck in. Any guidelines will be helpful.

Appreciate in advance.

tajinder-debut avatar Apr 18 '19 12:04 tajinder-debut

https://github.com/chunyenHuang/hummusRecipe/blob/master/lib/info.js#L21 https://github.com/galkahana/HummusJS/blob/b699d6a01ba027428120cbe5b1c16813bed0521d/tests/SettingInfoValuesTest.js

chunyenHuang avatar Apr 18 '19 16:04 chunyenHuang

Hi, thank you very very much about writing this awesome lib, is helping me a lot!

I have the same problem that tajinder-debut but I couldn't solve it with those links you @chunyenHuang gave us. I am working on nodejs and I tried with "custom" function but it doesn't add any information.

AddCustomInfo(req, res) { const output = __dirname + "/output/newModificated.pdf"; const pdfDoc = new HummusRecipe(directory, output); pdfDoc.custom("angle","100"); pdfDoc.custom("sense","f"); res.json({ok: true}); } Altought is creating the pdf "newModificated.pdf", this looks the same to the original, without modifications. I want to add some metadata information in order to read it later. am I going by the right way?

Thank you very much in advance!

PD: I tried with Hummus but I couldn't solve it, that why in this example I am using HummusRecipe.

JulianNicolas avatar Oct 26 '19 18:10 JulianNicolas