OL Learn

Adding PDF Keywords with AlambicEdit

Dear Sirs.

I’m trying to add Keywords to PDF file but I can’t figure out how AlambicEdit handles them,

The manual says, that Keywords property of IPDFInfos is a string and “Multiple keywords are separated with semi-colons.”. When I run following code:

info = pdf.GetInfos()
info.Keywords = “testkeyword 1;testkeyword2”
pdf.SetInfos(info)
pdf.Save(True)
pdf.Close()

what I get is something like this:
image

I noticed, that if I insert single string keyword, in Acrobat Reader it’s shown properly. If the keyword contains a space, it’s repeated with space removed.

If I seperate the keywords with semicolon, the result is as above. If I separate the keywords with comma, the result is like this:
image

What is the logic behind the keywords inserting? How can I insert two or more keywords, without having them modified in any way?

Best regards.

I was using following VBscript code successfully in the past:

set MyPDFInfos = CreateObject(“AlambicEdit.PdfInfos”)
set MyPDF = Watch.GetPDFEditObject
MyPDF.Open Watch.GetJobFilename, False

MyPDFInfos.Keywords = “KeyWord1;Keyword2”

MyPDF.SetInfos MyPDFInfos
MyPDF.Save False
MyPDF.Close

@piotr.mioduszewski: this is a known display error in Acrobat Reader. If you open the PDF file with another reader (e.g., Google Chrome, Foxit), then the keywords are displayed properly.