We used Merger to merge pdfs and add page numbering for an application we created about a year ago. I have a new request to take a form with fields that comes from one of our vendors populate the fields with data we have in a SQL database and save and print the pdf. Does Merger have this capability? If so can you supply/direct me to some sample code to get me started.
If not, does one of your other products have this capability?
Thanks
Template PDF
Re: Template PDF
Support · Feb 26, 2010Hello,
You can refer to the AcroFormFill example included as part of the Merger examples. The example shows how to take an existing PDF document and do form filling. You can save the filled PDF form using our API without any problem.
Would you like to programatically print the PDF? If yes, you can use our PrintManager for .NET product that allows printing the PDF documents.
Thanks,
ceTe Software Support Team
Re: Template PDF
Forum member · Feb 26, 2010I'm using this code:
Dim MyDocument As MergeDocument = New MergeDocument(MapPath("../WebSiteCete/pdf/Field1.pdf"))
MyDocument.Form.Fields("Text1").Value = Session("smeetlocation")
MyDocument.Form.Fields("Text2").Value = Session("smeetcity")
' Save the PDF
MyDocument.Draw(MapPath("../WebSiteCete/pdf/Field1.pdf"))
Visible = False
and keep I getting "The process cannot access the file [filename] because it is being used by another process at the Dim line. I don't have the file open by any other application.
Can you help. Thanks
Re: Template PDF
Support · Feb 26, 2010Hello,
The reason you are getting the error is because you are trying to write the output pdf file using the same name as the input pdf file while it is being used. The reason for this is because our product, in an effort to be as efficient as possible, only reads in the part of the merged or appended PDF that it needs and then uses the rest of it right at the time it draws out the new file. So when you try to draw a PDF to one of the same files that it is merging or appending the file is still in use.
The work around this is to open the file and read the contents of that file into a byte array and then close that file. Then you can create a PdfDocument out of that byte array and create a MergeDocument out of that PdfDocument. Now when you are going to Draw the file, you can specify the filepath to your original file because the file is no longer being used by any other processes.
The code for this would be something like this:
FileStream fs = new FileStream(@"C:\temp\DocumentA.pdf", FileMode.Open );
byte[] contents = new byte[ fs.Length ];
fs.Read( contents, 0, (int)fs.Length );
fs.Close();
PdfDocument pdf = new PdfDocument( contents );
MergeDocument document = new MergeDocument( pdf );
document.Draw( @"C:\temp\DocumentA.pdf" );
Thanks,
ceTe Software Support Team
Re: Template PDF
Forum member · Feb 26, 2010Thank You!! That worked.
Re: Template PDF
Forum member · Mar 10, 2010When I moved my files to our production server I am still getting the watermark. I made sure I have the serverkey in the webconfig file. What else do I need to do to remove the watermark?
Thanks
Re: Template PDF
Support · Mar 10, 2010Hello,
The license keys are specific to the server's computer name. You will have to create the license key specific to the server using its computer name.
If you are using the correct license key and still getting the watermark then please tell us the exact numbers that you are seeing in the square brackets at the top of the page with the watermark like [X:X:sX] where X will be numbers. From this we can look into it further.
Thanks,
ceTe Software Support Team.
Re: Template PDF
Forum member · Mar 10, 2010It's the same license key I use for my other application on the same server and I do not get the watermark on it.
Here are the numbers 15:4:s1.
Thanks
Re: Template PDF
Support · Mar 11, 2010Hello,
The watermark numbers shows that you are having the Standard edition Merger product license and you are using some features from the Enterprise edition product.
In order to remove this watermark you will have to make sure that you are not using any features other than the Standard edition Merger product features or will have to upgrade your license.
You can refer to the feature chart
in our website which shows different features offered by different editions.
Thanks,
ceTe Software Support Team.
Re: Template PDF
Forum member · Mar 12, 2010Oh, not good. When I asked the original thread question; "We used Merger to merge pdfs and add page numbering for an application we created about a year ago. I have a new request to take a form with fields that comes from one of our vendors populate the fields with data we have in a SQL database and save and print the pdf. Does Merger have this capability? If so can you supply/direct me to some sample code to get me started.
If not, does one of your other products have this capability?"
And they answered “You can refer to the AcroFormFill example included as part of the Merger examples.” They should have let me that it only worked with the enterprise edition. I have already told my boss that it will work without having to purchase any additional products. How much would it cost for us to upgrade to the enterprise edition.
Re: Template PDF
Support · Mar 12, 2010Please send an email over to our Sales Team, [^a|mailto:sales@cete.com|sales@cete.com^] including your current Serial Number and the product that you would like to upgrade to. From this they will be able to create a quote for the upgrade and give you details on the pricing.
Thanks,
ceTe Software Support Team