PDF-XChange Editor SDK for Developers
Moderators: TrackerSupp-Daniel , Tracker Support , Paul - Tracker Supp , Vasyl-Tracker Dev Team , Chris - Tracker Supp , Sean - Tracker , Ivan - Tracker Software , Tracker Supp-Stefan
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.
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Thu May 31, 2018 11:19 am
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.
Code: Select all
PDFXEdit.IPXV_Inst pxvInst;
PDFXEdit.IPXC_Inst pxcInst;
PDFXEdit.pxvInst = new PXV_Inst();
PDFXEdit.pxvInst.Init();
PDFXEdit.pxcInst = (PDFXEdit.IPXC_Inst)pxvInst.GetExtension("PXC");
PDFXEdit.IPXC_Document pDoc = pxcInst.OpenDocumentFromFile(inputPDF, null);
if (pDoc.HasAcroForm)
{
PDFXEdit.IPXC_FormField ff = pDoc.AcroForm.GetFieldByName("Company");
int nID = pxvInst.Str2ID("op.fields.modify", false);
PDFXEdit.IOperation pOp = pxvInst.CreateOp(nID);
PDFXEdit.ICabNode input = pOp.Params.Root["Input"];
input.Add().v = ff;
PDFXEdit.ICabNode options = pOp.Params.Root["Options"];
options["Mask"].v = 0x00000100; // Value modification
options["Value.Value"].v = "Hello";
pOp.Do();
}
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Wed Jun 06, 2018 6:51 am
Hello Nisha,
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.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Wed Jun 06, 2018 8:49 am
Hi,
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.
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Wed Jun 06, 2018 9:04 am
Hello Nisha,
I will move the forum post.
Have you checked the FullDemo sample project? Also, please read this first:
https://sdkhelp.pdf-xchange.com/view/PXV:CoClasses
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Wed Jun 06, 2018 9:38 am
Hi,
Sorry, but I did refer Full Demo sample project but I feel that I am missing out on something. Can you please provide some sample program..
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Wed Jun 06, 2018 10:04 am
Hello Nisha,
If you do have the FullDemo sample, then you should see that the opening of the documents on UI level (IPXV_Document) should be done via the
https://sdkhelp.pdf-xchange.com/vi ... ocFromPath method or by using the Control's standard Open Command.
Then you can access it by
https://sdkhelp.pdf-xchange.com/vi ... ontrol_Doc property and pass it to the operation that you have mentioned.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Wed Jun 06, 2018 10:09 am
But I want to fill the form without UI
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Wed Jun 06, 2018 10:12 am
Hello Nisha,
My bad, though you needed the UI. Can you give me a code sample that is not working for you (WriteTo should of solved the problem).
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Wed Jun 06, 2018 10:25 am
Hi,
This is the code which is not working. Please let me know what I am missing...
Code: Select all
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);
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Wed Jun 06, 2018 12:48 pm
Hello Nisha,
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).
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Thu Jun 07, 2018 7:01 am
Hi,
I added pDoc.close to my code but still it is not working. Can you please send me an example project demonstrating the same...
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Thu Jun 07, 2018 7:34 am
Hello Nisha,
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:
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Thu Jun 07, 2018 8:34 am
Hi,
I have added ff.SetValueText("Hello"); immediately after this line:
IPXC_FormField ff = pDoc.AcroForm.GetFieldByName("Company");
But still it is not working...
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Thu Jun 07, 2018 8:58 am
Hello Nisha,
Here's my sample project that works:
FieldsModifySample_Simplified.zip
Cheers,
Alex
You do not have the required permissions to view the files attached to this post.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Thu Jun 07, 2018 9:15 am
Hi,
Thankyou, its working
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.
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Thu Jun 07, 2018 9:35 am
Hello Nisha,
Well here's a snippet on how to do this with some properties/styles that you might require:
Code: Select all
PDFXEdit.IPXC_Document coreDoc = pxcInst.NewDocument();
PDFXEdit.PXC_Rect rc;
rc.left = 0;
rc.right = 500;
rc.top = 800;
rc.bottom = 0;
PDFXEdit.IPXC_UndoRedoData urd;
coreDoc.Pages.AddEmptyPages(0, 1, ref rc, null, out urd);
rc.left = 10;
rc.right = 100;
rc.top = 100;
rc.bottom = 10;
PDFXEdit.IPXC_FormField ff = coreDoc.AcroForm.CreateField("txtEsempio", PDFXEdit.PXC_FormFieldType.FFT_Text, 0, ref rc);
ff.SetFlags(0, (uint)PDFXEdit.PXC_FormFieldFlag.TFF_MultiLine);
ff.SetFlags((uint)PDFXEdit.PXC_FormFieldFlag.TFF_DoNotScroll, (uint)PDFXEdit.PXC_FormFieldFlag.TFF_DoNotScroll);
ff.SetFlags((uint)PDFXEdit.PXC_FormFieldFlag.TFF_Comb, (uint)PDFXEdit.PXC_FormFieldFlag.TFF_Comb);
PDFXEdit.IPXC_Annotation widget = ff.Widget[0];
PDFXEdit.IPXC_AnnotData aData = widget.Data;
PDFXEdit.IPXC_AnnotData_Widget aWData = (PDFXEdit.IPXC_AnnotData_Widget)aData;
var color = auxInst.CreateColor(PDFXEdit.ColorType.ColorType_RGB);
color.SetRGB(0.0f, 1.0f, 1.0f);
aWData.FColor = color;
color.SetRGB(0.0f, 1.0f, 0.0f);
aWData.SColor = color;
widget.Data = aWData;
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Thu Jun 07, 2018 11:30 am
Hi,
Thanks for the snippet
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Thu Jun 07, 2018 11:37 am
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Sat Jun 09, 2018 11:29 am
Hi,
If an acroform has multiline text field that how do we write text in new line using c# code.
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Sat Jun 09, 2018 11:33 am
Hello Nisha,
Well, just use the new line character - that's all.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Sat Jun 09, 2018 1:06 pm
Hi,
Sorry, but do I need to add new line char in the line where i set the text.
ff.SetValueText("New Text");
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Sat Jun 09, 2018 1:31 pm
Hello Nisha,
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Mon Jun 11, 2018 6:09 am
Thank you
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Mon Jun 11, 2018 6:48 am
Hi,
Can I change the color of the text which we add to text field ? If yes then how this can be done...
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Mon Jun 11, 2018 7:26 am
Hello Nisha,
You can set the default text color with the IPXC_AnnotData_Widget::DefaultTextColor property.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Mon Jun 11, 2018 11:13 am
Hi,
I am trying the following code to change the text color of the value entered through code in text field
IColor color = null;
color.SetRGB(0.0f, 0.0f, 0.8f);
pXC_AnnotData.DefaultTextColor = color;
I am not able to put appropriate defination on the following line:
IColor color = null;
Can you please help...
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Mon Jun 11, 2018 11:24 am
Hello Nisha,
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
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Mon Jun 11, 2018 12:00 pm
Hi,
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...
IPXC_FormField ff = pDoc.AcroForm.GetFieldByName("Bill ToRow1");
ff.SetValueText("XYZ Company 12345678910\n 201 Broadstreet 1234567810");
IPXC_Annotation widget = ff.Widget[0];
IPXC_AnnotData aData = widget.Data;
IPXC_AnnotData_Widget aWData = (PDFXEdit.IPXC_AnnotData_Widget)aData;
IColor color = auxInst.CreateColor(PDFXEdit.ColorType.ColorType_RGB);
color.SetRGB(0.0f, 0.0f, 0.8f);
aWData.DefaultTextColor = color;
pDoc.WriteToFile(inputPDF);
pDoc.Close();
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Mon Jun 11, 2018 12:05 pm
Hello Nisha,
Refer to the sample that I gave you again and see whether you have done everything as it shows (as a tip - look at the bottom of it).
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Mon Jun 11, 2018 12:11 pm
Hi,
Thankyou so much for the tip, it worked
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Mon Jun 11, 2018 12:14 pm
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Tue Jun 12, 2018 7:52 am
Hi,
I used the below code to change the font of the text entered in text field. But nothing happens..
uint fontWeight = 700;
IPXC_Font pdfFont = pDoc.CreateNewFont("Verdana", 0, fontWeight);
aWData.DefaultFont = pdfFont;
Is there anything else that I am missing ?
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Tue Jun 12, 2018 8:03 am
Hello Nisha,
Can you provide a fully working code sample project (do not forget to remove your key if you have one) so I can see where the problem is exactly.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Tue Jun 12, 2018 9:17 am
Hi,
Below is my working example
IPXV_Inst pxvInst;
IPXC_Inst pxcInst;
pxvInst = new PXV_Inst();
pxvInst.Init(null, devKey);
pxcInst = (IPXC_Inst)pxvInst.GetExtension("PXC");
IAUX_Inst auxInst = (IAUX_Inst)pxvInst.GetExtension("AUX");
IPXC_Document pDoc = pxcInst.OpenDocumentFromFile(inputPDF, null);
if (pDoc.HasAcroForm)
{
IPXC_FormField ff = pDoc.AcroForm.GetFieldByName("Bill ToRow1");
ff.SetValueText("XYZ Company 12345678910\n 201 Broadstreet 1234567810");
IPXC_Annotation widget = ff.Widget[0];
IPXC_AnnotData aData = widget.Data;
IPXC_AnnotData_Widget aWData = (PDFXEdit.IPXC_AnnotData_Widget)aData;
IColor color = auxInst.CreateColor(PDFXEdit.ColorType.ColorType_RGB);
color.SetRGB(0.0f, 0.0f, 0.8f);
aWData.DefaultTextColor = color;
uint fontWeight = 700;
IPXC_Font pdfFont = pDoc.CreateNewFont("Verdana", 0, fontWeight);
aWData.DefaultFont = pdfFont;
widget.Data = aWData;
pDoc.WriteToFile(inputPDF);
pDoc.Close();
}
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Tue Jun 12, 2018 9:36 am
Hello Nisha,
That is a code snippet not a project. Also, what exactly do you mean by nothing happens?
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Tue Jun 12, 2018 10:23 am
Hi,
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"...
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Tue Jun 12, 2018 12:29 pm
Hello Nisha,
Is the font weight being changed? Try getting the default font, setting it's weight and then setting the default font.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Wed Jun 13, 2018 5:20 am
Hi,
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.
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Wed Jun 13, 2018 7:23 am
Hello Nisha,
Well you are setting the text before changing the font parameters, thus the expected result.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Wed Jun 13, 2018 7:37 am
Hi,
I tried changing the font parameters before setting the text but still the font is not changed. Please correct me below is my code.
IPXC_FormField ff = pDoc.AcroForm.GetFieldByName("Bill ToRow1");
IPXC_Annotation widget = ff.Widget[0];
IPXC_AnnotData aData = widget.Data;
IPXC_AnnotData_Widget aWData = (PDFXEdit.IPXC_AnnotData_Widget)aData;
IPXC_Font pdfFont = pDoc.CreateNewFont("Cambria", 0, 1000);
aWData.DefaultFont = pdfFont;
ff.SetValueText("XYZ Company 12345678910\n201 Broadstreet 1234567810");
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Wed Jun 13, 2018 7:50 am
Hello Nisha,
Code: Select all
PDFXEdit.IPXC_FormField ff = coreDoc.AcroForm.CreateField("txtEsempio", PDFXEdit.PXC_FormFieldType.FFT_Text, 0, ref rc);
ff.SetFlags(0, (uint)PDFXEdit.PXC_FormFieldFlag.TFF_MultiLine);
ff.SetFlags((uint)PDFXEdit.PXC_FormFieldFlag.TFF_DoNotScroll, (uint)PDFXEdit.PXC_FormFieldFlag.TFF_DoNotScroll);
ff.SetFlags((uint)PDFXEdit.PXC_FormFieldFlag.TFF_Comb, (uint)PDFXEdit.PXC_FormFieldFlag.TFF_Comb);
PDFXEdit.IPXC_Annotation widget = ff.Widget[0];
PDFXEdit.IPXC_AnnotData aData = widget.Data;
PDFXEdit.IPXC_AnnotData_Widget aWData = (PDFXEdit.IPXC_AnnotData_Widget)aData;
var color = auxInst.CreateColor(PDFXEdit.ColorType.ColorType_RGB);
color.SetRGB(0.0f, 1.0f, 1.0f);
aWData.FColor = color;
color.SetRGB(0.0f, 1.0f, 0.0f);
aWData.SColor = color;
aWData.DefaultFont = coreDoc.CreateNewFont("Cambria", 0, 1000);
aWData.DefaultFontSize = 50;
ff.SetValueText("XXXXXX");
widget.Data = aWData;,
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Wed Jun 13, 2018 9:25 am
Hi,
I referred the code snippet and tried the following but still it is not changing the font nor the font size.
IPXC_FormField ff = pDoc.AcroForm.GetFieldByName("Bill ToRow1");
IPXC_Annotation widget = ff.Widget[0];
IPXC_AnnotData aData = widget.Data;
IPXC_AnnotData_Widget aWData = (PDFXEdit.IPXC_AnnotData_Widget)aData;
IColor Icolor = auxInst.CreateColor(PDFXEdit.ColorType.ColorType_RGB);
Color color = Color.FromName("Green");
Icolor.SetRGB(GetFloatFormat(color.R), GetFloatFormat(color.G), GetFloatFormat(color.B));
aWData.DefaultTextColor = Icolor;
aWData.DefaultFont = pDoc.CreateNewFont("Verdana", 0, 700);
aWData.DefaultFontSize = 150;
ff.SetValueText("XYZ Company 12345678910\n201 Broadstreet 1234567810");
widget.Data = aWData;
pDoc.WriteToFile(inputPDF);
pDoc.Close();
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Wed Jun 13, 2018 9:53 am
Hello Nisha,
How are you checking that? Use the Select Fields tool to select a field and then open it's properties - should be the values that you are setting.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Wed Jun 13, 2018 10:09 am
Hi,
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...
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Wed Jun 13, 2018 10:21 am
Hello Nisha,
I'm talking about opening the resulting file with the PDF Editor and seeing the results, not using the SDK UI.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Thu Jun 14, 2018 7:07 am
Hi,
I tried opening the resultant file from PDF Editor and in that I can see that it had changed the font...
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Thu Jun 14, 2018 7:10 am
Hello Nisha,
That's great.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Fri Jun 22, 2018 11:08 am
Hi,
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...
Sasha - Tracker Dev Team
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - Tracker Dev Team » Tue Jun 26, 2018 5:36 am
Hello Nisha,
Can you provide screenshots of this, so that I can understand better?
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Nisha
User
Posts: 43 Joined: Tue May 22, 2018 9:31 am
Post
by Nisha » Tue Jun 26, 2018 6:13 am
Hi,
Please refer the attachments
You do not have the required permissions to view the files attached to this post.