Using XmpMetadata

Using XmpMetadata

Forum member · Sep 18, 2008
Hi there, I'm evaluating DynamicPDF and have tried to create a simple PDF document that includes metadata. I've found that when Document.Draw(String) is called the following exceptions is thrown: DateTimeInvalidLocalFormat If I don't set any metadata explicitly I still see the exception, for example: Document document = new Document(); // Draw some shapes document.XmpMetadata = new XmpMetadata(); document.Draw(@"c:\myfiles\temp.pdf"); So my questions are do you know about this bug? And when is it likely to be resolved? Aside from this problem I'm finding DynamicPDF a very useful library. Thanks, Damien

Re: Using XmpMetadata

Support · Sep 18, 2008
Hello Damien, The code you have given above will throw an exception saying the document has no pages. We are able to run the code by adding page to the document without any problem. Following is the sample code we used. Document document = new Document(); document.Pages.Add(new Page()); document.XmpMetadata = new XmpMetadata(); document.Draw(@"C:\Temp\xmp.pdf"); Can you please send over a sample code which can recreate the error at our end to our [^a|mailto:support@cete.com|Support Team^] so that they can look into it further. Thanks, ceTe Software Support Team.

Re: Using XmpMetadata

Forum member · Sep 23, 2008
Okay I've tried your example: Document document = new Document(); document.Pages.Add(new Page()); document.XmpMetadata = new XmpMetadata(); document.Draw(@"e:\temp\foo.pdf"); The Draw function is throwing DateTimeInvalidLocalFormat was detected Message: A UTC DateTime is being converted to text in a format that is only correct for local times. This can happen when calling DateTime.ToString using the 'z' format specifier, which will include a local time zone offset in the output. In that case, either use the 'Z' format specifier, which designates a UTC time, or use the 'o' format string, which is the recommended way to persist a DateTime in text. This can also occur when passing a DateTime to be serialized by XmlConvert or DataSet. If using XmlConvert.ToString, pass in XmlDateTimeSerializationMode.RoundtripKind to serialize correctly. If using DataSet, set the DateTimeMode on the DataColumn object to DataSetDateTime.Utc.

Re: Using XmpMetadata

Support · Sep 23, 2008
Hello, We are able to run the same code without any problem. What version and build of our product are you using? Please make sure that you have the latest build. You can get the latest build from our CustomerArea by logging in using your current serial number. Thanks, ceTe Software Support Team.

Re: Using XmpMetadata

Forum member · Sep 23, 2008
I'm evaluating Generator v5.0.1 for .Net 2.0 at the moment to see what it can and can't do and I think v5.0.1 is the newest available version for me. There doesn't appear to be much useful on MSDN about the exception and I find that it only occurs when I try and set document metadata. I've also tried changing the regional settings on my machine to no avail. A PDF file gets created but it can't be openned because its "corrupted". Is the raw PDF any use for diagnosis? The CreationDate in the PDF file is set to: 1 0 obj<</Producer(DynamicPDF v5.0.1 for .NET)/CreationDate(D:20080923160813Z)>> In the metadata examples the CreationDate is a property of the BasicSchema class. There isn't a CreationDate public property defined in the help library entry for this class?

Re: Using XmpMetadata

Support · Sep 23, 2008
Hello, We are able to run this code in a web application and we are getting an error in console application. What application are you using? We will forward this issue over to developers to look into it further. We will post the updates in this forum as soon as we hear something from them. Thanks, ceTe Software Support Team.

Re: Using XmpMetadata

Support · Oct 3, 2008
Hello, We have fixed this issue and now you can add an empty XmpMetaData object to the document in a console application also without any problem. Please send an email to our [^a|mailto:support@cete.com|Support Team^] so that they can send you the latest dll with fix. Thanks, ceTe Software Support Team.