Welcome Guest Search | Active Topics | Sign In | Register

Duplicate Json in Keywords Options
KG
Posted: Wednesday, October 25, 2023 12:28:21 AM
Rank: Newbie
Groups: Member

Joined: 10/18/2023
Posts: 5
We are storing Json string of an object to Keywords in PDF using C#. Json is duplicated as shown below in the Keywords section although it returns only one item when reading it back from the PDF.
Is it a known bug?

"{""AccountNumber"":""123456"",""PortfolioName"":""Portfolio1"",""LetterTemplateType"":""Template1"",""CreationDate"":""24/10/2023 12:19:07""}"; "{""AccountNumber"":""123456"",""PortfolioName"":""Portfolio1"",""LetterTemplateType"":""Template1"",""CreationDate"":""24/10/2023 12:19:07""}"
eo_support
Posted: Wednesday, October 25, 2023 9:48:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

Can you provide a test project to duplicate the problem? Please see here for more details on sending test project to us:

https://www.essentialobjects.com/forum/test_project.aspx

Once we have the test project, we will debug into it and see what we can find.

Thanks!

KG
Posted: Wednesday, October 25, 2023 10:01:28 AM
Rank: Newbie
Groups: Member

Joined: 10/18/2023
Posts: 5
I dont have any test project for this. But if you add any json string to Keywords and view the PDF, you can see the duplicated Json as shown above.
eo_support
Posted: Wednesday, October 25, 2023 10:16:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
KG wrote:
But if you add any json string to Keywords and view the PDF, you can see the duplicated Json as shown above.


Can you explain in details exactly how you do that in each step? How do you "add json string to Keywords"? And how do you "View the PDF"? And where do you see the duplicated Json as shown above?
KG
Posted: Wednesday, October 25, 2023 10:51:12 AM
Rank: Newbie
Groups: Member

Joined: 10/18/2023
Posts: 5
I have used the below code to generate the PDF and added Json string to Keywords. Once the file is generated, please use Acrobat pdf reader to see the duplicated json in Keywords.

var pdfStream = new MemoryStream();
PdfDocument pdfDocument = new PdfDocument();
pdfDocument.Info.Keywords = "{\"AccountNumber\":\"123456\",\"PortfolioName\":\"Portfolio1\",\"LetterTemplateType\":\"Template1\",\"CreationDate\":\"25/10/2023 15:45:02\"}";
HtmlToPdf.ConvertHtml("test", pdfDocument);
pdfDocument.Save(pdfStream);
eo_support
Posted: Wednesday, October 25, 2023 11:28:19 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

This appears to be a bug of Adobe Reader. If you view the result PDF file in Adobe Reader, you will see double keywords. However if you view the PDF in another PDF viewer, it will not show double. For example, you can open the PDF with Google Chrome, then click the PDF Viewer's menu button (three vertical dots), then click "Document Properties", you will see the Keywords are displayed correctly. You can also open the PDF file with a text editor, and you will see the Keywords property at the begining of the file with only one copy.

Thanks!
KG
Posted: Wednesday, October 25, 2023 11:31:31 AM
Rank: Newbie
Groups: Member

Joined: 10/18/2023
Posts: 5
Yes, I noticed that after sending the code to you. Thanks for looking into it.
eo_support
Posted: Wednesday, October 25, 2023 12:51:45 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
You are very welcome. Please feel free to let us know if you run into anything else.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.