Automated merge with an option for manual editing?

Automated merge with an option for manual editing?

Forum member · Nov 16, 2010
We are currently using version 4 for merging data onto documents and saving them on our server. This process is completely automated, however we have a need to handle a different type of document where 90% or so of the fields will be filled automatically from our database, but then we will need to give our users a chance to manually intervene and possibly change values. Is there any kind of "preview" method before the Draw is done? Is this going to be an easy task to accomplish? Thanks for any feedback you may provide!

Re: Automated merge with an option for manual editing?

Support · Nov 17, 2010
Hello, Yes, you can achieve your requirements without any problem using our DynamicPDF Merger product. You need to have to add one button form field on the PDF document and set SubmitAction to it to using the Action class. Please refer the documentation on Action class at: You will have to get the PDF document using the MergeDocument object and then fill the fields with the data from the database and open the PDF document using DrawToWeb method. The user can modify or fill the required data and once he clicks the submit button you can submit all the field values and the field names to URL then you will have to again open the original PDF document and use these field values and fill it with these values and save this document to the disk using Draw method. Below is he code to add a button and set submit action to it. SubmitAction action = new SubmitAction("WebForm1.aspx", FormExportFormat.HtmlPost); Button button = new Button("btn", 50, 150, 100, 50); button.Action = action; button.BackgroundColor = RgbColor.AliceBlue; button.Behavior = Behavior.CreatePush("downLabel", "rolloverLabel"); button.BorderColor = RgbColor.BlueViolet; button.BorderStyle = BorderStyle.Beveled; button.TextColor = RgbColor.DarkGreen; button.Label = "Submit"; Below is the code to get the values in the target URL and filiing the fields in the PDF document. MergeDocument document = new MergeDocument(@"Path for the input PDF document"); document.Form.Fields["Name"].Value = Request.Form["Name"].ToString(); document.Form.Fields["Name"].IsReadOnly = true; document.Form.Fields["btn"].IsReadOnly = true; document.Draw(@"Path to save the final filled PDF document"); if the above suggestions do not meet your ewquirments then kinldy contact our support team so that they can give you the sample code for it. Thanks, ceTe Software Support Team.

Re: Automated merge with an option for manual editing?

Forum member · Nov 17, 2010
Thanks for the quick response. Using this approach, will the Submit button actually show up on the final PDF? We can't have any unnecessary fields on these documents, including buttons. Thanks!

Re: Automated merge with an option for manual editing?

Forum member · Nov 17, 2010
Also, can this be done using version 4 of your DynamicPDF for .NET - Developer Edition product?

Re: Automated merge with an option for manual editing?

Support · Nov 18, 2010
Hello, Yes, the submit button will be visible on the PDF document and you will have to click it to submit the data to the desired URL. Currently we do not have any other methods using which you can allow the user to fill the required fields by opening the PDF in the Adobe Reader and save the filled PDF document to disk using our DynamicPDF Merger product. Yes, You can use version 4 DynamicPDF Merger for .NET product to achieve your requirements by using the SubmitAction of the Button field. Adding new acro form fields to the PDF document is an Enterprise edition feature. You will have to make sure that you have Enterprise edition of DynamicPDF Merger product to add any new form fields to the PDF document. The DynamicPDF product will not throw any exception but it will add watermark to the generated PDF document depending the license you own and the features you are using. Thanks, ceTe Software Support Team.

Re: Automated merge with an option for manual editing?

Forum member · Nov 18, 2010
So does this mean I'll have to use the Enterprise version to add the button programmatically as in your example? Hopefully this is not the case, but if so can I use a button that's pre-drawn in the document when it's created in Acrobat? Thanks!

Re: Automated merge with an option for manual editing?

Support · Nov 18, 2010
Hello, Yes, adding new acro form fields to the PDF document is an Enterprise edition feature and you will need the Enterprise edition of Merger product license to avoid the watermark on the generated PDF document. You can add Button fields and create PDF document using Acrobat professional but we do not have any idea how to set the SubmitAction and export the field names and the field values using acrobat. Also it is not possible to set any events or actions to the already existing fields using our DynamicPDF Merger product. You can only set action at the time of adding new button field to the PDF document. Thanks, ceTe Software Support Team.

Re: Automated merge with an option for manual editing?

Forum member · Nov 18, 2010
Thanks for the continued information. One thing I'm unclear about - you say that I'll need the Enterprise version to avoid the watermark. That implies to me that I can do the same thing with my version and there will be a watermark, however, I can't get the code provided to work. I don't see a submit button. I'm doing a "proof-of-concept" right now to determine how much time, effort and money will be involved to provide this enhancement in our system. For the proof-of-concept a watermark is fine, but if things go smoothly we would need to upgrade as we can't have the watermark on the finished product. If this is possible with my version could you please provide a more complete example of how to set up a submit button programatically? I'm also attaching my code if that helps. Thanks! Dim options As MergeOptions = New MergeOptions(True) Dim MyDocument As MergeDocument = New MergeDocument("C:\OnTime\2004\Test PDF_NoButton.pdf", options) ceTe.DynamicPDF.Document.AddLicense("xxxx") ' Get the imorted MyPage and set margins. Dim myPage As ceTe.DynamicPDF.Page = MyDocument.Pages(0) MyDocument.ViewerPreferences.FitWindow = True MyDocument.ViewerPreferences.CenterWindow = True MyDocument.InitialPageZoom = PageZoom.FitWidth 'MyDocument.Form.IsReadOnly = True MyDocument.Form.Fields("Test1").Value = "This is Test1" MyDocument.Form.Fields("Test3").Value = "This is Test3" MyDocument.Form.Fields("Test5").Value = "This is Test5" Dim action As New ceTe.DynamicPDF.PageElements.Forms.SubmitAction("PDF_Generate.aspx", ceTe.DynamicPDF.PageElements.Forms.FormExportFormat.HtmlPost) Dim button As New ceTe.DynamicPDF.PageElements.Forms.Button("btn", 50, 150, 100, 50) button.Action = action button.BackgroundColor = RgbColor.AliceBlue button.Behavior = ceTe.DynamicPDF.PageElements.Forms.Behavior.CreatePush("downLabel", "rolloverLabel") button.BorderColor = RgbColor.BlueViolet button.BorderStyle = ceTe.DynamicPDF.PageElements.Forms.BorderStyle.Beveled button.TextColor = RgbColor.DarkGreen button.Label = "Submit" MyDocument.DrawToWeb()

Re: Automated merge with an option for manual editing?

Support · Nov 18, 2010
Hello, Please send an email to [^a|mailto:support@cete.com|opennewiwndow|support@cete.com^] and refer this forum post so we can send you complete code. Thanks, ceTe Software Support Team.

Re: Automated merge with an option for manual editing?

Forum member · Dec 14, 2010
I'm partially filling in PDFs from my database, and leaving the user to review and make any manual changes they need before minting the final PDF. I'm having a problem with checkboxes. I couldn't find a method to determine the object type as I iterate through the form.fields collection, so I'm just using consistent naming of fields and checking for "checkbox" in the name. If the request.form checkbox had a value of 1 I'm trying to assign the mydocument merge form a value of "Yes", but the checkboxes are not checked on the final form. Below is the relevant code - can you please tell me what I'm doing wrong? Thanks! For i = 0 To MyDocument.Form.Fields.Count - 1 strField = MyDocument.Form.Fields(i).Name If Not Request.Form(strField) = Nothing Then If LCase(Mid(strField, 1, 8)) = "checkbox" Then If Request.Form(strField).ToString = "1" Then MyDocument.Form.Fields(strField).Value = "Yes" Else MyDocument.Form.Fields(strField).Value = "No" End If End If MyDocument.Form.Fields(strField).Value = Request.Form(strField).ToString End If Next

Re: Automated merge with an option for manual editing?

Support · Dec 14, 2010
Hello, You seem to be setting the check box values correctly. Please send us the input PDF document to [^a|mailto:support@cete.com|opennewiwndow|support@cete.com^] so we can do some testing with the document. Thanks, ceTe Software Support Team.