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.
mergeDocument.Draw() error
Re: mergeDocument.Draw() error
Support · Jun 30, 2014Hello,
Please email the following information to [^a|mailto:support@cete.com|opennewwindow|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.
Re: mergeDocument.Draw() error
Support · Nov 29, 2016Hello,
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.