Hi,
When I add a text (keyword) in the Keyword property of the PDF that already has an existing keyword(s) it will automatically displays the double-quotation marks (").
However, using the same program statements above to add the text but in a PDF that does NOT have any text in the Keywords property yet, there are no double-quotes.
As an example, here are the lines to insert the text:
var pdfDocument = new Document(filename);
//specify document information
var docInfo = new DocumentInfo(pdfDocument);
var sbUpdatedKeywords = docInfo.Keywords;
sbUpdatedKeywords += !string.IsNullOrEmpty(sbUpdatedKeywords) ? cKeywordsConcat + keywords : keywords;
</em></font></p><p><font style="background-color: rgb(211, 211, 211);" size="2" face="Tahoma"><em>docInfo.Keywords = sbUpdatedKeywords;
</em></font></p><p><font style="background-color: rgb(211, 211, 211);" size="2" face="Tahoma"><em>//save output document
</em></font></p><p><font style="background-color: rgb(211, 211, 211);" size="2" face="Tahoma"><em>pdfDocument.Save(filename);</em></font></p><p><font>Also, when I view the raw PDF content using a hex or text editor, the Keywords does NOT have quotation marks even if it displays otherwise.</font></p><p>So, what can I do to "specify" don't show the quotation marks in any way (if that is possible)?</p><p> </p>
Hi Tilal,
Thank you for your response.
I'm using the latest version which I got on New year's day; and that is 8.8.0.
So, in my initial statement to reproduce the issue you need to have a PDF document that has a keyword already in it before you execute the code snippet I've provided.
If you run in against a document that does NOT have keywords yet, then you won't see the double-quotations.
Are these requirements been met with your testing? Otherwise please do so again.
Thanks,
John
Hi John,
Thanks for your feedback. Yes I have followed your direction to test the issue, HelloWorldKeyword.pdf already has a keyword and new keyword appended in HellowWorldKeyword1.pdf. Can you please share your sample input/output PDF documents? So we will investigate it further and provide you more information.
We are sorry for the inconvenience caused.
Best Regards,
OK, I've narrowed it down.
If I used either of the following, as my delimiters it will enclose the entire keyword string with double quotations.
1. comma
2. CR/LF
Why is it? And, importantly is there a workaround it since it is a requirement to use CR/LF as the delimiter for multiple keywords in my application?
I've included sample PDFs as well for your perusal.
Thank you for quick response.
Cheers,
John
Hi John,
Thanks for your feedback. You can use Envoirnment.NewLine for CR/LF as following. Moreover, we have noticed the double qoutes issue in case of comma or CR/LF and logged it as PDFNEWNET-36283 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue resolution progress via this forum thread.
var keywords = " hello world" + Environment.NewLine + " keyword";
We are sorry for the inconvenience caused.
Best Regards,
Thank you, looking forward to the fix, and hopefully very soon.
Hi John,
Thanks for your patience. We have further investigated the issue and found that actually keywords don’t have double quotes. The fact is that Adobe Reader adds double quotes when it shows pdf properties, this happens if keywords contain special symbols or delimiters like commas, semicolons.
Best Regards,
The issues you have found earlier (filed as PDFNEWNET-36283) have been fixed in Aspose.Pdf for .NET 9.0.0.