mergeDocument.Draw() error

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  mergeDocument.Draw() error

DynamicPDF CoreSuite for .NET (v7) Forum

 Jun 30 2014 3:11 PM
Hi,
I'm getting an error "'xmp' is an undeclared prefix. Line 5, position 256" when I call Draw()

MergeDocument mergeDocument = new MergeDocument(filePathAndName, MergeOptions.All);
byte[] documentBytes = mergeDocument.Draw();

This happens when I try to read in word document that was renamed to have .pdf extention. I can open this document in Adobe just fine though.

Here's full call stack
System.Xml.XmlException: 'xmp' is an undeclared prefix. Line 5, position 256.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at zz93.fp.a(DocumentWriter A_0)
   at ceTe.DynamicPDF.IO.DocumentResourceList.b(DocumentWriter A_0)
   at zz93.c4.r()
   at ceTe.DynamicPDF.Document.Draw(Stream stream)
   at ceTe.DynamicPDF.Document.Draw()

Why does DynamicPDF not able to parse it? Is there anything I can do to this document programmatically to get this to work?
Thanks.
 Jun 30 2014 4:52 PM
Posted by a ceTe Software moderator
Hello,

Please email the following information to support@cete.com so we can look into it further.

1. PDF document.
2. Version & build number of DynamicPDF dll used.

Thanks,
ceTe Software Support Team.
 Nov 29 2016 11:36 AM
Posted by a ceTe Software moderator
Hello,

After analyzing the PDF document, it has been found to contain incorrect XMP metadata that is not in conformance with PDF specification. Our product does not have the capability to fix the conformance issues of such PDFs. To read this kind of PDF, use the following workaround to ignore the XMP metadata using MergeOptions class while reading the PDF.

                MergeOptions opt = new MergeOptions();
                opt.XmpMetadata = false;
                MergeDocument  document = new MergeDocument(“input.pdf”, opt);
                document.Draw("output.pdf");

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 7:38 AM.