PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 18, 2019 1:18 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Mar 31, 2015 2:17 pm 
Offline

Joined: Tue Mar 31, 2015 2:02 pm
Posts: 3
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 4915 times ]


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


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 31, 2015 2:53 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2952
Location: Cologne, Germany
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 4910 times ]


Please try again without comma.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 31, 2015 3:07 pm 
Offline

Joined: Tue Mar 31, 2015 2:02 pm
Posts: 3
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 31, 2015 3:34 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2952
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 01, 2015 8:18 am 
Offline

Joined: Tue Mar 31, 2015 2:02 pm
Posts: 3
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 138 times
pdfCopyrightProperties.png
pdfCopyrightProperties.png [ 22.58 KiB | Viewed 4901 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group