Afternoon All,
I am wondering if anyone can help with a problem I am having with the
iTextSharp project.
I am using the XML.Parser to insert an XML Document into a PDF. The
problem is that I want further pages added to the PDf after the XML has
been included to one page, but get an error saying the document is now
closed and no further elements can be added to it.
The code is below:
byte[] byteArray = new byte[XML.Length];
System.Text.ASCIIEncoding encoding = new
System.Text.ASCIIEncoding();
byteArray = encoding.GetBytes(XML);
MemoryStream memoryStream2 = new MemoryStream(byteArray);
XmlDocument doc1 = new XmlDocument();
doc1.Load(memoryStream2);
ITextHandler h = new ITextHandler(document);
XmlParser.Parse(document, doc1);
I get the error with the below when trying to add the content to the
newly created page:
document.SetPageSize(PageSize.A1.Rotate());
document.NewPage();
Paragraph p4 = new Paragraph("Hello WORLD", FontFactory.GetFont("Arial",
13));
document.Add(p4);
Regards,
Dan.
Daniel Foster
Developer
STYLES&WOOD Ltd
T: 0115 969 4713
DD: 0115 969 4826
www.stylesandwood.co.uk
S&W STOREPLANNING S&W STOREFIT S&W STORECARE S&W STOREDATA
COMMITTED TO CUSTOMER SERVICE, PERFECT DELIVERY AND INNOVATION
Confidentiality: This e-mail and its attachments are intended for the above
named only and may be confidential. If they have come to you in error you must
take no action based on them, nor must you copy or show them to anyone; please
reply to this e-mail and highlight the error to the sender.
Security Warning: Please note that this e-mail has been created in the
knowledge that Internet e-mail is not a 100% secure communications medium. We
advise that you understand and observe this lack of security when e-mailing us.
Viruses: This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses although we advise that in
keeping with good computing practice the recipient should ensure they are
actually virus free.
STYLES&WOOD LIMITED
REGISTRATION NO. 1568060
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar