Hello,

Please help me. Its urgent for me. i want to create treeview in object data
model. i m using this example which is given below. Please suggest me how
can i do for treeview. Please Help me:-


PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(RESULT,
FileMode.Create));
                writer.SetTagged();

                document.Open();
                PdfContentByte cb = writer.DirectContent;
                
                PdfStructureTreeRoot tree = writer.StructureTreeRoot;
                
                
                PdfStructureElement se = new PdfStructureElement(tree, new
PdfName("Figure"));


                PdfStructureElement element = new PdfStructureElement(se,
new PdfName("Element1"));
                PdfDictionary userproperties = new PdfDictionary();
                userproperties.Put(PdfName.O, PdfName.USERPROPERTIES);
                userproperties.Put(PdfName.S, new PdfName("Figure"));
                PdfArray properties = new PdfArray();
                PdfDictionary property1 = new PdfDictionary();
                property1.Put(PdfName.N, new PdfString("Name1"));
                property1.Put(PdfName.V, new PdfString("Value1"));
                properties.Add(property1);
                PdfDictionary property2 = new PdfDictionary();
                property2.Put(PdfName.N, new PdfString("Name2"));
                property2.Put(PdfName.V, new PdfString("Value2"));
                properties.Add(property2);
                PdfDictionary property3 = new PdfDictionary();
                property3.Put(PdfName.N, new PdfString("Name3"));
                property3.Put(PdfName.V, new PdfString("Value3"));
                properties.Add(property3);
                userproperties.Put(PdfName.P, properties);
                element.Put(PdfName.A, userproperties);






                PdfLayer lay1 = new PdfLayer("My object", writer);

                cb.BeginMarkedContentSequence(element);
                cb.BeginLayer(lay1);
                cb.SetColorFill(Color.BLUE);
                cb.Rectangle(50, 50, 200, 200);
                cb.Fill();
                cb.EndLayer();
                cb.EndMarkedContentSequence();


                PdfStructureElement se1 = new PdfStructureElement(tree, new
PdfName("Figure"));
                PdfStructureElement element1 = new PdfStructureElement(se1,
new PdfName("Element2"));
                //PdfDictionary userproperties = new PdfDictionary();
                userproperties.Put(PdfName.O, PdfName.USERPROPERTIES);
                userproperties.Put(PdfName.S, new PdfName("Figure"));
                PdfArray properties1 = new PdfArray();
                PdfDictionary property11 = new PdfDictionary();
                property11.Put(PdfName.N, new PdfString("Name1"));
                property11.Put(PdfName.V, new PdfString("Value1"));
                properties1.Add(property11);
                PdfDictionary property22 = new PdfDictionary();
                property22.Put(PdfName.N, new PdfString("Name2"));
                property22.Put(PdfName.V, new PdfString("Value2"));
                properties1.Add(property22);
                PdfDictionary property33 = new PdfDictionary();
                property33.Put(PdfName.N, new PdfString("Name3"));
                property33.Put(PdfName.V, new PdfString("Value3"));
                properties1.Add(property33);
                userproperties.Put(PdfName.P, properties);
                element1.Put(PdfName.A, userproperties);

                PdfLayer lay11 = new PdfLayer("My object1111", writer);

                cb.BeginMarkedContentSequence(element1);
                cb.BeginLayer(lay11);
                cb.SetColorFill(Color.RED);
                cb.Rectangle(110, 250, 100, 200);
                cb.Fill();
                cb.EndLayer();
                cb.EndMarkedContentSequence();




-- 
View this message in context: 
http://www.nabble.com/In-Object-Data-model-How-to-create-treeview-tp25486012p25486012.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to