Posted By: sbc | Sep 26th, 2005 @ 4:33 AM
page 3 of 3
Comments: 55 | Views: 116468
Hi , 
i want to insert an image into PDF dynamically.
I have a XML as input  and used dtd for formatting it which and iam using XMLparser to parse the xml with hash table.
similar to this link has http://www.ridgway.co.za/archive/2005/07/31/itextsharpxmltopdfexample.aspx

Here is the code i had

Document document = new Document();
MemoryStream m = new MemoryStream();
System.Collections.Hashtable tagmap = new Hashtable();

XmlPeer peer = new XmlPeer(ElementTags.CHUNK, "EmployeeName");
peer.Content = "CandidateFirstName ";
tagmap.Add(peer.Alias, peer);

XmlParser.Parse(document, HttpContext.Current.Server.MapPath("~/sample.xml"), tagmap);

Response.OutputStream.Write(m.GetBuffer(), 0, m.GetBuffer().Length);
Response.OutputStream.Flush();
Response.OutputStream.Close();

The above program is working perfectly and all i need is  HOW to display images dynamically on the streamed PDF file.
Can you help me with this??

Thanks

Prashanth K

Hi

Can anyone tell me how and with what software I can create a template PDF file with form fields?
Acrobat reader no longer allows you to do it and I cant get my hands on the older versions.
Is there a freeware app out there that can help me do this?

I'm creating the invoicing portion of an internal site for my company and I need a template invoice which I can just populate with client details and the work to be billed.

Thanks,
Neil
Jack Dong .NET
Jack Dong .NET
code coolie

hi,everyone
I want draw Bezier Lines for PDF with iTextsharp.

But i did not konw how to do it.

whether some friends konw that, pls tell me.

my email:
     dlonghow@163.com

or msn:
     dlonghow@hotmail.com


Thank you everyone.

Spanish

 

Amigo Muchas Gracias el Código me sirvió para leer unos campos de un archivo pdf que tengo, necesitaba extraer los valores de esos campos para carcularlos y luego ingresarlos en otro archivo pdf, de verdad Muchas Gracias, le hice las siguientes modinicaciones.

 

 

Imports

Imports

Imports

Imports

Imports

Imports

Imports

Imports

Imports

 

Public

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim m As MemoryStream = New MemoryStream()'

which document to open Dim file As String = ("c:\prueba.pdf")

 

 

Dim reader As PdfReader = New PdfReader(file)

 

' then create a PdfStamper from the created reader to modify the form fields

Dim outStamper As PdfStamper = New PdfStamper(reader, m)Dim name1 As String = outStamper.AcroFields.GetField("Texto2") 'este es le nombre del campo de texto pdf

TextBox1.Text = TextBox1.Text & name1

 

End

End Sub Class

 

 

 

System System.IO iTextSharp.text iTextSharp.text.pdf System.Data System.Text System.Drawing System.ComponentModel System.Collections Class Form1

 

Spanish

Muchas gracias amigo, el codigo me sirvió de mucho, lo imprementé de la siguiente manera...

 

Imports

Imports

Imports

Imports

Imports

Imports

Imports

Imports

Imports

 

Public

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim m As MemoryStream = New MemoryStream()' which document to open

Dim file As String = ("c:\prueba.pdf")

Dim reader As PdfReader = New PdfReader(file)'

 

 

 

TextBox1.Text = TextBox1.Text & name1

 

End

 

 

Dim outStamper As PdfStamper = New PdfStamper(reader, m)Dim name1 As String = outStamper.AcroFields.GetField("Texto2") 'este es le nombre del campo de texto pdf End Sub Class

 

 

 

System System.IO iTextSharp.text iTextSharp.text.pdf System.Data System.Text System.Drawing System.ComponentModel System.Collections Class Form1

Thanks, that worked out fine. Pity the documentation is not that good, but as a side effect I found out about generating a document from Xml or via document.Add.

---------------------------------------------------

nuoc hoa | nuoc hoa nam | nuoc hoa nu

 

page 3 of 3
Comments: 55 | Views: 116468
Microsoft Communities