hi

here my code

public void getPDF()
        {
            try
            {

                string pdfTemplate = 
System.Web.HttpContext.Current.Server.MapPath("~/Admin/doc/invoice/1.pdf");

                PdfReader pdfReader = null;

                // Create the form filler
                FileStream pdfOutputFile = new FileStream(pdfTemplate, 
FileMode.Create);

                string path = 
System.Web.HttpContext.Current.Server.MapPath("~/Admin/doc/invoice/existing.pdf");
                pdfReader = new PdfReader(path);

                PdfStamper pdfStamper = null;

                pdfStamper = new PdfStamper(pdfReader, pdfOutputFile);

                // Get the form fields
                AcroFields testForm = pdfStamper.AcroFields;

                // Fill the form
                testForm.SetField("T1", "lasantha"); //
                testForm.SetField("T2", "lasantha");
                
                PdfContentByte overContent = pdfStamper.GetOverContent(1);

                pdfStamper.FormFlattening = true;

                pdfStamper.Close();

                pdfReader.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

and my requirement is how can we add a gridview with data to the PDF.as a 
example we assume gridview has 3 rows.then create the textfeild for each data 
column and we can bind it from code.but gridview rows are dynamically increase 
decrease.

and another one, i successfully created a GridView to PDF from this code

        protected void generatepdfbtn_Click(object sender, EventArgs e)
        {
   
                Response.ContentType = "application/pdf";
                Response.AddHeader("content-disposition", 
"attachment;filename=Transactions.pdf");
               
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                StringWriter sw = new StringWriter();
                HtmlTextWriter hw = new HtmlTextWriter(sw);
                //transactiongrid.AllowPaging = false;
                //transactiongrid.DataBind();
                transactiongrid.RenderControl(hw);
                StringReader sr = new StringReader(sw.ToString());
                Document pdfDoc = new Document(PageSize.A1, 10f, 10f, 10f, 0f);
                HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
                PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
                pdfDoc.Open();
                htmlparser.Parse(sr);
                pdfDoc.Close();
                Response.Write(pdfDoc);
                Response.End();
            
        }
 
i need to put the gridview to my existing PDF file. i think my question is 
clear now.

thanks

> From: [email protected]
> Subject: iText-questions Digest, Vol 57, Issue 93
> To: [email protected]
> Date: Tue, 22 Feb 2011 08:34:28 +0000
> 
> Send iText-questions mailing list submissions to
>       [email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.sourceforge.net/lists/listinfo/itext-questions
> or, via email, send a message with subject or body 'help' to
>       [email protected]
> 
> You can reach the person managing the list at
>       [email protected]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of iText-questions digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: iText-questions Digest, Vol 57, Issue 92
>       (Lasantha Peththawadu)
>    2. Re: iText-questions Digest, Vol 57, Issue 92 (1T3XT BVBA)
>    3. Mixing national characters - What version of    iText do I need?
>       ([email protected])
>    4. Re: iText-questions Digest, Vol 57, Issue 92
>       (Lasantha Peththawadu)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 22 Feb 2011 14:13:08 +0600
> From: Lasantha Peththawadu <[email protected]>
> Subject: Re: [iText-questions] iText-questions Digest, Vol 57, Issue
>       92
> To: itextsharp itextsharp <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> 
> hi
> i have a gridview in my aspx page. I need to add that grid to the pdf. I'm 
> using a PDF template with TextFeilds. currently i added data to predefined 
> TextFeilds sucessfully. but coudn't add the gridview. We can't push the 
> gridview like we adding text to textfeilds. what can i do.
> 
> > From: [email protected]
> > Subject: iText-questions Digest, Vol 57, Issue 92
> > To: [email protected]
> > Date: Tue, 22 Feb 2011 08:01:48 +0000
> > 
> > Send iText-questions mailing list submissions to
> >     [email protected]
> > 
> > To subscribe or unsubscribe via the World Wide Web, visit
> >     https://lists.sourceforge.net/lists/listinfo/itext-questions
> > or, via email, send a message with subject or body 'help' to
> >     [email protected]
> > 
> > You can reach the person managing the list at
> >     [email protected]
> > 
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of iText-questions digest..."
> > 
> > 
> > Today's Topics:
> > 
> >    1. Re: Editiable PDF (1T3XT BVBA)
> >    2. Re: iTextSharp (1T3XT BVBA)
> > 
> > 
> > ----------------------------------------------------------------------
> > 
> > Message: 1
> > Date: Tue, 22 Feb 2011 08:59:16 +0100
> > From: 1T3XT BVBA <[email protected]>
> > Subject: Re: [iText-questions] Editiable PDF
> > To: Post all your questions about iText here
> >     <[email protected]>
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset="iso-8859-1"
> > 
> > Hello,
> > you have posted a mail to [email protected] but you 
> > weren't subscribed.
> > You are receiving this answer because I've added your mail address in Bcc:
> > I will do this only once! Further answers will be sent to the 
> > mailing-list only (you won't receive them if you don't subscribe). 
> > Further questions to the mailing-list will be rejected unless you 
> > subscribe. Further questions sent to the 1t3xt address will be ignored. 
> > Please understand that, as long as you don't subscribe, somebody has to 
> > MANUALLY approve your mail among a huge load of SPAM. You can help us 
> > avoid this boring administrative job by following the rules: 
> > http://itextpdf.com/support.php
> > 
> > Op 22/02/2011 0:33, Howard Falcon schreef:
> > >
> > > I have made a PDF form using Adobe 9 Pro.I can edit the form using Pro 
> > > or the Adobe Reader.I am using .Net and have an application that fills 
> > > in some of the form with data from a database, however, when bring up 
> > > the PDF using PDF Reader / PDF Stamper I cannot make changes to the 
> > > form.Is there a setting that I am missing.The Stamper has 
> > > FormFlattening = true;
> > >
> > 
> > Let me see if I understand correctly:
> > 1. you create a form using Acrobat. (Are you sure you're not using Adobe 
> > LiveCycle Designer? Are you using AcroForm or XFA technology?)
> > 2. you fill it out programmatically using iText (PdfReader/PdfStamper) 
> > and you flatten the form (you remove the interactivity).
> > 3. you open the PDF that has been filled out and flattened, and as 
> > you've removed the form, people can no longer fill out any fields 
> > (because there are no more fields).
> > 
> > What is the problem? If you want to keep the fields, form flattening 
> > should be false, not true.
> > I have the impression I don't understand the question because you're not 
> > telling the whole story.
> > Please clarify, but subscribe to the mailing-list first (or we won't get 
> > your mail).
> > Reading the documentation could help too.
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > 
> > ------------------------------
> > 
> > Message: 2
> > Date: Tue, 22 Feb 2011 09:01:40 +0100
> > From: 1T3XT BVBA <[email protected]>
> > Subject: Re: [iText-questions] iTextSharp
> > To: [email protected]
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset="iso-8859-1"
> > 
> > Op 22/02/2011 8:41, Lasantha Peththawadu schreef:
> > > hi all,
> > >
> > > I have existing PDF File with AcroFeilds. currently i can push data to 
> > > above PDF from code behind. My requirement is i want to add a gridview 
> > > to that page. How i achieve this. I'm using  C#.
> > Define gridview.
> > Do you want to add horizontal and vertical lines in the background of 
> > the existing PDF?
> > That's done with PdfStamper: search for the method getContentUnder();
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > 
> > ------------------------------
> > 
> > ------------------------------------------------------------------------------
> > Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
> > Collect, index and harness all the fast moving IT data generated by your 
> > applications, servers and devices whether physical, virtual or in the cloud.
> > Deliver compliance at lower cost and gain new business insights. 
> > Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
> > 
> > ------------------------------
> > 
> > _______________________________________________
> > iText-questions mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> > 
> > 
> > End of iText-questions Digest, Vol 57, Issue 92
> > ***********************************************
>                                         
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> Message: 2
> Date: Tue, 22 Feb 2011 09:28:42 +0100
> From: 1T3XT BVBA <[email protected]>
> Subject: Re: [iText-questions] iText-questions Digest, Vol 57, Issue
>       92
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Op 22/02/2011 9:13, Lasantha Peththawadu schreef:
> > hi
> > i have a gridview in my aspx page.
> 
> I assume that you have an HTML page with labels and input fields.
> 
> > I need to add that grid to the pdf.
> 
> ???
> You sound as if you want to fill out an existing PDF.
> The labels and the fields on the existing PDF have absolute coordinates.
> I have no idea what you mean by adding a gridview.
> 
> > I'm using a PDF template with TextFields.
> 
> This is an EXISTING pdf, of which the layout if FIXED.
> 
> > currently i added data to predefined TextFeilds sucessfully.
> 
> You fill out the fields, and that works.
> 
> > but coudn't add the gridview.
> 
> I don't understand what this means!!!
> Are you trying to add lines and/or shapes???
> 
> > We can't push the gridview like we adding text to textfeilds. what can 
> > i do.
> 
> I can't help you because I don't understand you.
> DEFINE gridview!
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> Message: 3
> Date: Tue, 22 Feb 2011 09:14:04 +0100
> From: <[email protected]>
> Subject: [iText-questions] Mixing national characters - What version
>       of      iText do I need?
> To: <[email protected]>
> Message-ID:
>       <ca1569e250bb524b98b18c77f1b12435044bc...@smcg039v.corp1.ad1.seb.net>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> I need to create a PDF document where I need to be able to show Chinese, 
> Polish, Swedish etc. characters in the same document. Using the FontSelector 
> seems to be the correct way of doing this, but, what version of iText do I 
> need to do this. Today I am using version 1.3, but I suppose I need to 
> upgrade.
>  
> Mvh/Regards
> Bengan
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> Message: 4
> Date: Tue, 22 Feb 2011 14:34:21 +0600
> From: Lasantha Peththawadu <[email protected]>
> Subject: Re: [iText-questions] iText-questions Digest, Vol 57, Issue
>       92
> To: itextsharp itextsharp <[email protected]>,
>       <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> 
> hi
> 
> i have a gridview with data in my aspx page. What i need is add this gridview 
> data to the existing PDF (with AcroFeilds).
> 
> thanks
> 
> > From: [email protected]
> > Subject: iText-questions Digest, Vol 57, Issue 92
> > To: [email protected]
> > Date: Tue, 22 Feb 2011 08:01:48 +0000
> > 
> > Send iText-questions mailing list submissions to
> >     [email protected]
> > 
> > To subscribe or unsubscribe via the World Wide Web, visit
> >     https://lists.sourceforge.net/lists/listinfo/itext-questions
> > or, via email, send a message with subject or body 'help' to
> >     [email protected]
> > 
> > You can reach the person managing the list at
> >     [email protected]
> > 
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of iText-questions digest..."
> > 
> > 
> > Today's Topics:
> > 
> >    1. Re: Editiable PDF (1T3XT BVBA)
> >    2. Re: iTextSharp (1T3XT BVBA)
> > 
> > 
> > ----------------------------------------------------------------------
> > 
> > Message: 1
> > Date: Tue, 22 Feb 2011 08:59:16 +0100
> > From: 1T3XT BVBA <[email protected]>
> > Subject: Re: [iText-questions] Editiable PDF
> > To: Post all your questions about iText here
> >     <[email protected]>
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset="iso-8859-1"
> > 
> > Hello,
> > you have posted a mail to [email protected] but you 
> > weren't subscribed.
> > You are receiving this answer because I've added your mail address in Bcc:
> > I will do this only once! Further answers will be sent to the 
> > mailing-list only (you won't receive them if you don't subscribe). 
> > Further questions to the mailing-list will be rejected unless you 
> > subscribe. Further questions sent to the 1t3xt address will be ignored. 
> > Please understand that, as long as you don't subscribe, somebody has to 
> > MANUALLY approve your mail among a huge load of SPAM. You can help us 
> > avoid this boring administrative job by following the rules: 
> > http://itextpdf.com/support.php
> > 
> > Op 22/02/2011 0:33, Howard Falcon schreef:
> > >
> > > I have made a PDF form using Adobe 9 Pro.I can edit the form using Pro 
> > > or the Adobe Reader.I am using .Net and have an application that fills 
> > > in some of the form with data from a database, however, when bring up 
> > > the PDF using PDF Reader / PDF Stamper I cannot make changes to the 
> > > form.Is there a setting that I am missing.The Stamper has 
> > > FormFlattening = true;
> > >
> > 
> > Let me see if I understand correctly:
> > 1. you create a form using Acrobat. (Are you sure you're not using Adobe 
> > LiveCycle Designer? Are you using AcroForm or XFA technology?)
> > 2. you fill it out programmatically using iText (PdfReader/PdfStamper) 
> > and you flatten the form (you remove the interactivity).
> > 3. you open the PDF that has been filled out and flattened, and as 
> > you've removed the form, people can no longer fill out any fields 
> > (because there are no more fields).
> > 
> > What is the problem? If you want to keep the fields, form flattening 
> > should be false, not true.
> > I have the impression I don't understand the question because you're not 
> > telling the whole story.
> > Please clarify, but subscribe to the mailing-list first (or we won't get 
> > your mail).
> > Reading the documentation could help too.
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > 
> > ------------------------------
> > 
> > Message: 2
> > Date: Tue, 22 Feb 2011 09:01:40 +0100
> > From: 1T3XT BVBA <[email protected]>
> > Subject: Re: [iText-questions] iTextSharp
> > To: [email protected]
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset="iso-8859-1"
> > 
> > Op 22/02/2011 8:41, Lasantha Peththawadu schreef:
> > > hi all,
> > >
> > > I have existing PDF File with AcroFeilds. currently i can push data to 
> > > above PDF from code behind. My requirement is i want to add a gridview 
> > > to that page. How i achieve this. I'm using  C#.
> > Define gridview.
> > Do you want to add horizontal and vertical lines in the background of 
> > the existing PDF?
> > That's done with PdfStamper: search for the method getContentUnder();
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > 
> > ------------------------------
> > 
> > ------------------------------------------------------------------------------
> > Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
> > Collect, index and harness all the fast moving IT data generated by your 
> > applications, servers and devices whether physical, virtual or in the cloud.
> > Deliver compliance at lower cost and gain new business insights. 
> > Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
> > 
> > ------------------------------
> > 
> > _______________________________________________
> > iText-questions mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> > 
> > 
> > End of iText-questions Digest, Vol 57, Issue 92
> > ***********************************************
>                                         
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> ------------------------------------------------------------------------------
> Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
> Collect, index and harness all the fast moving IT data generated by your 
> applications, servers and devices whether physical, virtual or in the cloud.
> Deliver compliance at lower cost and gain new business insights. 
> Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
> 
> ------------------------------
> 
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> 
> End of iText-questions Digest, Vol 57, Issue 93
> ***********************************************
                                          
------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to