SetMetaData method

Discussions about PDF management.
Post Reply
Chess
Posts: 22
Joined: Mon Apr 23, 2012 6:02 pm

SetMetaData method

Post by Chess » Fri Jun 29, 2012 5:34 pm

Hello,

I try to use this function for insert XMP meta in a PDF document. I provide metadata file has attachement. When I create a new PDF, using the SetMetaData function, all seem fine. When I open my PDF file (with Acrobat 9 (not the reader)), I don't see my XMP data (File -> Properties -> Metadata... -> Advanced ). If I open the PDF file for view raw content (ex : with notepad++), I can see my XMP struct (<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
...)

Note that it's a custom XMP, and it work with Pdflib PLOP. I suppose that some xml tag may be added or remove to work with GdPicture PDF plugin, but I don't know what I should do for correctly working.

Have you a sample code that set XMP metadata (custom XMP or standard (ex : DC, ...) that show how to use correctly SetMetaData function.

Thanks,
Attachments
input.zip
XMP metadata file
(750 Bytes) Downloaded 331 times

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: SetMetaData method

Post by Loïc » Mon Jul 09, 2012 12:10 pm

Hello,

All is working fine for me.

Here the snippet I've used with the V9:

Code: Select all

    Using oGdPicturePDF As New GdPicturePDF
            oGdPicturePDF.LoadFromFile("c:\test.pdf", True)

            Dim oFile As New FileInfo("c:\input.txt")
            Using oFileStream As FileStream = oFile.OpenRead()
                Dim lBytes As Integer = CInt(oFileStream.Length)
                Dim data(lBytes - 1) As Byte
                oFileStream.Read(data, 0, lBytes)
                oGdPicturePDF.SetMetadata(System.Text.Encoding.GetEncoding(1252).GetString(data))
            End Using
            oGdPicturePDF.SaveToFileInc("c:\test.pdf")
        End Using

And here what I obtain:
metadata.png

Kind regards,

Loïc

Chess
Posts: 22
Joined: Mon Apr 23, 2012 6:02 pm

Re: SetMetaData method

Post by Chess » Tue Jul 10, 2012 6:06 pm

Thanks for help.

It seem that it work with non PDF/A file. With PDF/A, my custom schema (foobar machines) disappears. I suppose that my xml data have some mistake for PDF/A struct.

Regards,

Chess.

palachance
Posts: 3
Joined: Mon Feb 18, 2013 8:37 pm

Re: SetMetaData method

Post by palachance » Mon Feb 18, 2013 9:08 pm

Hi

We are facing similar problem.
Is it confirmed that custom Xmp meta won't work with PDF/A ?

Thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests