PDFStamper.Close() throws XMLException "invalid character in the given encoding. Row 11, position 175."

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PDFStamper.Close() throws XMLException "invalid character in the given encoding. Row 11, position 175."

Zwonimir
 

 in System.Xml.XmlTextReaderImpl.Throw(Exception e)
   in System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   in System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res)
   in System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
   in System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
   in System.Xml.XmlTextReaderImpl.ReadData()
   in System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
   in System.Xml.XmlTextReaderImpl.ParseAttributes()
   in System.Xml.XmlTextReaderImpl.ParseElement()
   in System.Xml.XmlTextReaderImpl.ParseElementContent()
   in System.Xml.XmlTextReaderImpl.Read()
   in System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   in System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   in System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   in System.Xml.XmlDocument.Load(XmlReader reader)
   in System.Xml.XmlDocument.Load(Stream inStream)
   in iTextSharp.xmp.impl.XmpMetaParser.ParseXmlFromBytebuffer(ByteBuffer buffer, ParseOptions options)
   in iTextSharp.xmp.impl.XmpMetaParser.ParseXml(Object input, ParseOptions options)
   in iTextSharp.xmp.impl.XmpMetaParser.Parse(Object input, ParseOptions options)
   in iTextSharp.xmp.XmpMetaFactory.ParseFromBuffer(Byte[] buffer, ParseOptions options)
   in iTextSharp.xmp.XmpMetaFactory.ParseFromBuffer(Byte[] buffer)
   in iTextSharp.text.pdf.PdfStamperImp.Close(IDictionary`2 moreInfo)
   in iTextSharp.text.pdf.PdfStamper.Close()


Hallo guyz,

I've this error just with one kind of pdf, while all the other pdf files are ok, and I can throw this exception just executing this simple code:


MemoryStream ms = new MemoryStream();
PdfReader.unethicalreading = true;
PdfReader reader = new PdfReader(stream);
PdfStamper stamper = new PdfStamper(reader, ms);
stamper.Close();
stamper.Dispose();
reader.Close();
reader.Dispose();

... where stream contains the streamed pdf file.

I attach to this post the pdf file that gives me this error.

Thank you guys, hope we'll find a solution to this :)

Zwonimir

XMLerror.pdf
Reply | Threaded
Open this post in threaded view
|

Re: PDFStamper.Close() throws XMLException "invalid character in the given encoding. Row 11, position 175."

Zwonimir
It works with iTextSharp 5.3.5, not with version 5.4.4.

Zwonimir