PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Quotes are inserted in Keywords property
https://forum.pdfsharp.net/viewtopic.php?f=3&t=3082
Page 1 of 1

Author:  Henning [ Tue Mar 31, 2015 2:17 pm ]
Post subject:  Quotes are inserted in Keywords property

Hi

I noticed when using the below sample code:
Code:
document.Info.Keywords = "keyword1, keyword2";


... that the resulting keyword field in Acrobat Reader 11.0.10 gets surrounded by quotes. Is this a bug, or how do I remove them?

Attachment:
pdfKeywords.PNG
pdfKeywords.PNG [ 11.05 KiB | Viewed 12020 times ]


As you can see this occurs in v1.32, and I also tested v1.50 with the same result.

Author:  Thomas Hoevel [ Tue Mar 31, 2015 2:53 pm ]
Post subject:  Re: Quotes are inserted in Keywords property

Hi!

Could it be that Adobe Reader shows the quotes for items with a comma?

I have quotes for "Author", but not for "Keywords":
Attachment:
forum_15-03-31.png
forum_15-03-31.png [ 14.62 KiB | Viewed 12015 times ]


Please try again without comma.

Author:  Henning [ Tue Mar 31, 2015 3:07 pm ]
Post subject:  Re: Quotes are inserted in Keywords property

I don't think so. It is possible for me to create a document with two keywords (one comma) in Adobe Acrobat without the resulting quotes.

Author:  Thomas Hoevel [ Tue Mar 31, 2015 3:34 pm ]
Post subject:  Re: Quotes are inserted in Keywords property

You can open the PDF file created with PDFsharp with e.g. Microsoft Wordpad.

In the file from my screen shot above there are no quotes in the Author field:
Code:
/CreationDate(D:20150331144251+02'00')
/Creator(QBX Online Version 14.331.1420.0 \(qbx-online.de\))
/Author(empira Software GmbH, Troisdorf)
/Keywords(Erstellt mit empira Krankenhaus-Qualitätsbericht-Manager QBX Online)
/Subject(Kontrolldokument zur Datenbankversion des Qualitätsberichts \(XML\))
/Title(Musterklinik)
/Producer(PDFsharp 1.50.3685-sl \(www.pdfsharp.com\))


So in this case Adobe Reader adds the quotes at display time.

Henning wrote:
It is possible for me to create a document with two keywords (one comma) in Adobe Acrobat without the resulting quotes.
Please post such a file so I can see how they do it.

Author:  Henning [ Wed Apr 01, 2015 8:18 am ]
Post subject:  Re: Quotes are inserted in Keywords property

It appears it is done by using XML to set the properties. This also shows how to specify the copyright properties which are the requirements for my current projekt if possible.

Is thery any current API to edit this XML?

I have attached the original pdf, the pdf edited with Acrobat and the pdf edited with PDFsharp.
Code:
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:08:04        ">
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <rdf:Description rdf:about=""
          xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
      <pdf:CreationDate--Text>12/12/2003 17:30:12</pdf:CreationDate--Text>
      <pdf:Keywords>keyword1, keyword2</pdf:Keywords>
      <pdf:Producer>GNU Ghostscript 7.05</pdf:Producer>
    </rdf:Description>
    <rdf:Description rdf:about=""
          xmlns:xmp="http://ns.adobe.com/xap/1.0/">
      <xmp:CreatorTool>Pdf995</xmp:CreatorTool>
      <xmp:ModifyDate>2015-04-01T09:56:09+02:00</xmp:ModifyDate>
      <xmp:CreateDate>2015-04-01T09:40:42+02:00</xmp:CreateDate>
      <xmp:MetadataDate>2015-04-01T09:56:09+02:00</xmp:MetadataDate>
    </rdf:Description>
    <rdf:Description rdf:about=""
          xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/">
      <xmpRights:Marked>True</xmpRights:Marked>
      <xmpRights:WebStatement>http://en.wikipedia.org/wiki/Copyright</xmpRights:WebStatement>
    </rdf:Description>
    <rdf:Description rdf:about=""
          xmlns:illustrator="http://ns.adobe.com/illustrator/1.0/">
      <illustrator:StartupProfile>Print</illustrator:StartupProfile>
    </rdf:Description>
    <rdf:Description rdf:about=""
          xmlns:dc="http://purl.org/dc/elements/1.1/">
      <dc:format>application/pdf</dc:format>
      <dc:creator>
        <rdf:Seq>
          <rdf:li>Author</rdf:li>
        </rdf:Seq>
      </dc:creator>
      <dc:title>
        <rdf:Alt>
          <rdf:li xml:lang="x-default">Test</rdf:li>
        </rdf:Alt>
      </dc:title>
      <dc:rights>
        <rdf:Alt>
          <rdf:li xml:lang="x-default">Copyright notice</rdf:li>
        </rdf:Alt>
      </dc:rights>
      <dc:subject>
        <rdf:Bag>
          <rdf:li>keyword1</rdf:li>
          <rdf:li>keyword2</rdf:li>
        </rdf:Bag>
      </dc:subject>
    </rdf:Description>
    <rdf:Description rdf:about=""
          xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
      <xmpMM:DocumentID>uuid:2c970c7b-0117-459d-af87-4c53e08c979f</xmpMM:DocumentID>
      <xmpMM:InstanceID>uuid:96a64fec-34d1-4163-ac05-b0177a69f6f5</xmpMM:InstanceID>
    </rdf:Description>
  </rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>


Attachments:
PDFProperties.zip [18.46 KiB]
Downloaded 506 times
pdfCopyrightProperties.png
pdfCopyrightProperties.png [ 22.58 KiB | Viewed 12006 times ]

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/