Form fields are hidden by template background

Form fields are hidden by template background

Forum member · Mar 21, 2008
Hello all, I'm using DynamicPDF.Merger (4.0.3) to generate custom pdf files based on a database and standard pdf forms (online). These standard pdf forms already have some text, images and form fields on there. My code needs to do the following: 1) Load pdf form from disk 2) Generate and set custom background per page 3) Enumerate form fields, match their names with database fields, and enter value from database. All of this works reasonably well, except my form fields are no longer visible in the generated pdf file. It seems the template background is drawn on top of the form fields, even though all other text is perfectly visible. If I open my generated file in Acrobat, I can see the form fields when I select any form field tool. Point of interest is probably that rather than adding to the document I load, I start from a blank document, and add page per page. Here's my code reduced to its bare necessities: ceTe.DynamicPDF.Document.AddLicense("Some License number"); MergeDocument doc = new MergeDocument(template); //source document MergeDocument target = new MergeDocument(); //target document to add pdf in seperate sections int pagenr; System.Collections.Generic.List<ceTe.DynamicPDF.Template> lstTemplates = new System.Collections.Generic.List<ceTe.DynamicPDF.Template>(); for (int i = 0; i < doc.Form.Fields.Count;i++ ) //filling the form fields { int fldOrd = rdrBrief.GetOrdinal(doc.Form.Fields[i].Name); doc.Form.Fields[i].Value = rdrBrief[fldOrd].ToString(); } for (pagenr = 0; pagenr < doc.Pages.Count;pagenr++ ) //applying templates page per page { ceTe.DynamicPDF.Template bgTemplate = new ceTe.DynamicPDF.Template(); lstTemplates.Add(bgTemplate); target.Sections.Begin(bgTemplate); target.Pages.Add(doc.Pages[pagenr]); } SqlDataReader rdrBackgrounds = getBackgrounds(templatefilename); pagenr = 0; while (rdrBackgrounds.Read()) //applying backgrounds to templates { tmpName = rdrBackgrounds["tmpbg_name"].ToString(); BackgroundImage bgTemp = new BackgroundImage(buildPdfBackground(getBackground(templatefilename, tmpName)); if(lstTemplates.Count > pagenr) lstTemplates[pagenr].Elements.Add(bgTemp); pagenr++; } target.DrawToWeb(); Can anyone give me a nudge in the right direction? Thanks, Menno

Re: Form fields are hidden by template background

Support · Mar 21, 2008
Hello Menno, What version of the Acrobat Reader are you using? Also what build of our product are you using? Please make sure that you have the latest build of our product. You can download the latest build from our CustomerArea by logging in using your current serial number. Thanks, ceTe Software Support Team.

Re: Form fields are hidden by template background

Forum member · Mar 24, 2008
Dear ceTe Software Support Team, First and foremost: a happy Easter to you. I'm using the most recent Adobe Acrobat Pro (version 8) and I downloaded the last dll just a couple of weeks ago. I don't think that will fix the problem I'm having. Regards, Menno

Re: Form fields are hidden by template background

Support · Mar 24, 2008
Hello Menno, Can you please send the original and output PDF document along with the source code to our [^a|mailto:support@cete.com|Support Team^] so that they can take a look at it to find out what is causing this behavior to occur? Thanks, ceTe Software Support Team