Blank fields when Append to Merge Document

Blank fields when Append to Merge Document

Forum member · Sep 18, 2006
Hello, I am having problems getting my form fields to display their filled-in values when I append PDFs to a merge document. If I take my PDF document and do the following, the field values display correctly: byte[] contents = GetDocWithFieldsFilledIn(); Response.BinaryWrite( contents ) However, if I append the PDF to a MergeDocument, the field values are blank. (Pseudo-code below) MergeDocument pdfAllDocuments = new MergeDocument(); int totalDocumentCount = 0; foreach ( Doc in AllDocsList ) { byte[] contents = GetDocWithFieldsFilledIn(); PdfDocument pdfCurrentDocument = new PdfDocument( contents ); MergeOptions opts = new MergeOptions(true, string.Format( "md_{0}_", totalDocumentCount ) ); pdfAllDocuments.Append( pdfCurrentDocument, opts ); totalDocumentCount++; } pdfAllDocuments.InitialPageZoom = PageZoom.FitWidth; Response.ClearContent(); Response.ContentType = "application/pdf"; Response.AddHeader( "Content-Disposition", string.Format( "inline;filename=temp.{0}", "pdf" ) ); MemoryStream outputStream = new MemoryStream(); pdfAllDocuments.Draw( outputStream ); outputStream.Capacity = Convert.ToInt32(outputStream.Length); Response.BinaryWrite( outputStream.GetBuffer() );

Re: Blank fields when Append to Merge Document

Support · Sep 19, 2006
Hello, Since you want to output the PDF to the browser, you can use the DrawToWeb method of the MergeDocument object that will output the PDF to the browser and the DrawToWeb method will take care of setting all the necessary headers internally. Modified code block: pdfAllDocuments.InitialPageZoom = PageZoom.FitWidth; pdfAllDocuments.Form.NeedsAppearances=true; pdfAllDocuments.DrawToWeb("Test.pdf"); Thanks, ceTe Software Support Team