Forum rules DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Hi guys, I am new to this library I need c# code to fill a PDF form to fulfill one of our client requirement.
Update
I referred some developer forum and found this code and modified as per my requirement. My objective is to enter some value through code in PDF form field named company. But when I execute the following code it is not printing the value in the form field. Please let me know what must be done to achieve my objective.
Please post in the correct forum thread so that we can reply you on a much faster scale. This should be in the Editor SDK forum.
As for your question. For starters, let's understand whether you are using the IPXV_Control (like in our FullDemo application sample) or do you need this to be done without the UI interaction via the Operations only? If you are using the IPXV_Control and you want to modify the opened document directly, then you will have to pass the document opened in the Control (the IPXV_Document) to the operation and then you will see the results. Another way is opening the IPXC_Document, modifying it with the operation and then opening it in the Control.
If you don't have the IPXV_Control, then you will have to open the IPXC_Document, modify it with the Operation and then save the document with the WriteTo/WriteToFile method.
My apology to post it in different forum, I want to do the above thing without the UI interaction and I tried adding writeTo function but its not working. Hence I am reposting this to Editor SDK forum.
IPXV_Inst pxvInst;
IPXC_Inst pxcInst;
pxvInst = new PXV_Inst();
pxvInst.Init(null, devkey); // devkey is a string variable that has license key
pxcInst = (IPXC_Inst)pxvInst.GetExtension("PXC");
IPXC_Document pDoc = pxcInst.OpenDocumentFromFile(inputPDF, null); \\ inputPDF is string variable where I have specified my PDF file path
if (pDoc.HasAcroForm)
{
IPXC_FormField ff = pDoc.AcroForm.GetFieldByName("Company");
int nID = pxvInst.Str2ID("op.fields.modify", false);
IOperation pOp = pxvInst.CreateOp(nID);
ICabNode input = pOp.Params.Root["Input"];
input.Add().v = ff;
ICabNode options = pOp.Params.Root["Options"];
options["Mask"].v = 0x00000100; // Value modification
options["Value.Value"].v = "Hello";
pOp.Do();
}
pDoc.WriteToFile(inputPDF);
What I see is that you are missing pDoc.Close(); because the same code works for me in the FullDemo environment.
The steps should be as followed: 1) Open document 2) Modify Document 3) Write Document to file 4) Close document 5) Open document with PDF Editor (or other viewer).
I've made a sample and indeed, in the case of the non-UI usage (there is no IPXV_Document) the logic is somewhat different and does not work as it is intended to.
For now, you can use this as a workaround - in your case this should be the same:
Can you please provide me some tutorial/ working example that would help me create acroform without UI consisting of text field. Or should I create a new post for this.
Here's a solution: viewtopic.php?p=125177#p125070
Also, here's a link to the IColor documentation, where you can see the See Also section that can help you find the method that can create/initialize this or that interface, or methods where the interface is being used: https://sdkhelp.pdf-xchange.com/view/PXV:IColor
Sorry for missing the code snippet you shared earlier, I have shared my code it is not throwing any error but it is still not changing the color of the text. Is it because I have set ff.Widget[0] is the Widget Id similar to field Id. Please explain with an example if possible...
This is it I have in my project. I am trying to enter some data in text field and I am trying to change the color and font of the data that I am going to programmatically enter in the text field. At present I am able to change the color of the text but I am not able to able the change the font of the text. If I specify font name as "Verdana" in my code and try executing the code the font of the text is not changed to "Verdana"...
Yes, I want to programmatically change Font Name, weight and size. I tried changing font weight by using DefaultFontSize but it did'nt change the size of default font. Please help.
Pardon me if I am wrong, but I am not using UI...
Through code I am trying to enter some value in text field and I am trying to change the font properties and text color along with it. At present I am only able to change text color but I am not able to change the font. If possible can you please share some example...
Sorry for the late reply, thanks for your workaround but I was wondering why the font remains unchanged if see the resultant file in microsoft edge even the font color change is visible but the problem is only when the font changes...