Hi,

I am using vb.net with itextsharp to insert metadata into PDFs. It is
working well but when I insert keywords the resulting PDF has quotes around
the keywords.

Am I doing something wrong? Is there anyway to remove the quotes?

Here is the code:

Imports System.IO
Imports iTextSharp.text
Imports iTextSharp.text.pdf

Public Title As String
Public Subject As String
Public Author As String
Public Year As String
Public KeyWords As String
Public SourcePDF As String
Public DestPDF As String

Private Sub InjectPDF(ByVal SourcePDF As String, ByVal DestPDF As String)
        Dim reader As New PdfReader(SourcePDF)
        Dim mydocument As New Document
        Dim writer As PdfWriter = PdfWriter.GetInstance(mydocument, New
FileStream(DestPDF, FileMode.Create, FileAccess.Write))
        mydocument.AddTitle(Title)
        mydocument.AddSubject(Subject)
        mydocument.AddAuthor(Author)
        mydocument.AddKeywords(KeyWords)
        mydocument.Open()
        Dim cb As PdfContentByte = writer.DirectContent
        Dim x As Integer
        For x = 1 To reader.NumberOfPages
            mydocument.NewPage()
            Dim ANewPage As PdfImportedPage = writer.GetImportedPage(reader,
x)
            cb.AddTemplate(ANewPage, 0, 0)
        Next
        mydocument.Close()
End Sub

Any suggestions or help would be appreciated.

Thanks,
Brian
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to