galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.14k stars 169 forks source link

Document properties "Keywords" #256

Closed matex1024 closed 6 years ago

matex1024 commented 6 years ago

First of all, very good job, it's one of the most detailed library for pdf generation in node js. During adding metadata, based on your test file/SettingInfoValuesTest.js, I tried to add Keywords to my pdf. The problem is the keywords are converted to single string and it doesn't matter If I define it as newInfo.keywords = ['keyword1','keyword2','keyword3'] or that newInfo.keywords = keyword1+','+keyword2+','+keyword3. Based on PDF Keywords in properties, the output should looks like keyword1,keyword2,keyword3 instead of "keyword1,keyword2,keyword3" I didn't look too much in C++ lib but I think its quite simple change, I just don't know in which cpp file it's stored. I hope it will help, thank you for help or maybe I'm doing something wrong :).

chunyenHuang commented 6 years ago

https://github.com/galkahana/HummusJS/blob/02730266893d288ac6a88148c8f624c41519236e/src/deps/PDFWriter/InfoDictionary.cpp#L68

https://github.com/galkahana/HummusJS/blob/02730266893d288ac6a88148c8f624c41519236e/src/InfoDictionaryDriver.cpp#L324 screen shot 2018-03-16 at 4 39 25 pm

matex1024 commented 6 years ago

Thank you make sense now.