Hi,
I'm trying to create a new Pdf Document with some FormFields.
The Default Checkbox Icon Displayed in my Document is a Checkmark.
Is it possible to change the Icon to a Cross instead ? In the Editor a Option is given.
Code to Create CheckBox:
var ff = m_Document.AcroForm.CreateField("AB", PXC_FormFieldType.FFT_CheckBox, currentPage, mediaBox);
ff.CheckWidget(0, true);
Creation of the CheckBox works fine, i just need a hint where i could find the Option to Change the IconStyle.
For TextFields Color and FontSize could be set with the Interface "IPXC_AnnotData_Widget" , but can't find a suitable Interface / Method for Changing the Icon.
Thank you
Rudi
How to Change CheckBox Icon from Checkmark to Cross SOLVED
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.
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.
-
- User
- Posts: 6
- Joined: Mon Jul 24, 2023 6:50 am
How to Change CheckBox Icon from Checkmark to Cross
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 175
- Joined: Wed Sep 14, 2016 5:42 pm
- Location: British Columbia
Re: How to Change CheckBox Icon from Checkmark to Cross
Hi Rudiro,
You can determine that option in the properties pane for selected check boxes, in the CheckBox Style property dropdown menu, where a range of options are available, including the 'cross' option which you requested:
Kind regards,
You can determine that option in the properties pane for selected check boxes, in the CheckBox Style property dropdown menu, where a range of options are available, including the 'cross' option which you requested:
Kind regards,
You do not have the required permissions to view the files attached to this post.
Sean Godley
Technical Writer
Tracker Software Products (Canada) LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Technical Writer
Tracker Software Products (Canada) LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
-
- User
- Posts: 6
- Joined: Mon Jul 24, 2023 6:50 am
Re: How to Change CheckBox Icon from Checkmark to Cross
Hi Sean,
Thank you very much, but im looking for a option to achieve this style, in the Creation of the Checkbox in my C# Code.
Sample Code for Visualisation:
PXV_Inst m_PdfInst = new PXV_Inst();
IPXC_Document m_Document = m_PdfInst.NewCoreDoc();
var mediaBox = new PXC_Rect();
mediaBox.top = m_PageHeight;
mediaBox.right = m_PageWidth;
mediaBox.left = 0;
mediaBox.bottom = 0;
m_Document.Pages.AddEmptyPages(0, 1, mediaBox, null, out undoData);
uint currentPage = m_Document.Pages.Count - 1;
var mediaBox = new PXC_Rect();
mediaBox.top = m_PageHeight - 20;
mediaBox.bottom = m_PageHeight - 40;
mediaBox.left = 220;
mediaBox.right = 240;
var ff = m_Document.AcroForm.CreateField("AB", PXC_FormFieldType.FFT_CheckBox, currentPage, mediaBox);
ff.CheckWidget(0, true);
And here im looking for the Option to Change the Icon of my created CheckBox
IAFS_Inst fsInst = (IAFS_Inst)m_PdfInst.GetExtension("AFS");
IAFS_Name destPath = fsInst.DefaultFileSys.StringToName(fileName);
m_Document.WriteTo(destPath);
Thank you
Rudi
Thank you very much, but im looking for a option to achieve this style, in the Creation of the Checkbox in my C# Code.
Sample Code for Visualisation:
PXV_Inst m_PdfInst = new PXV_Inst();
IPXC_Document m_Document = m_PdfInst.NewCoreDoc();
var mediaBox = new PXC_Rect();
mediaBox.top = m_PageHeight;
mediaBox.right = m_PageWidth;
mediaBox.left = 0;
mediaBox.bottom = 0;
m_Document.Pages.AddEmptyPages(0, 1, mediaBox, null, out undoData);
uint currentPage = m_Document.Pages.Count - 1;
var mediaBox = new PXC_Rect();
mediaBox.top = m_PageHeight - 20;
mediaBox.bottom = m_PageHeight - 40;
mediaBox.left = 220;
mediaBox.right = 240;
var ff = m_Document.AcroForm.CreateField("AB", PXC_FormFieldType.FFT_CheckBox, currentPage, mediaBox);
ff.CheckWidget(0, true);
And here im looking for the Option to Change the Icon of my created CheckBox
IAFS_Inst fsInst = (IAFS_Inst)m_PdfInst.GetExtension("AFS");
IAFS_Name destPath = fsInst.DefaultFileSys.StringToName(fileName);
m_Document.WriteTo(destPath);
Thank you
Rudi
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: How to Change CheckBox Icon from Checkmark to Cross
Hello Rudi,
Thanks for the additional details.
I've asked a colleague from the dev team who works on the JS engine to take a look, and will post further info here in this topic once I've received their feedback.
Kind regards,
Stefan
Thanks for the additional details.
I've asked a colleague from the dev team who works on the JS engine to take a look, and will post further info here in this topic once I've received their feedback.
Kind regards,
Stefan
-
- Site Admin
- Posts: 3556
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: How to Change CheckBox Icon from Checkmark to Cross
CheckBox 'icon' is set using the Content property of the corresponding widget. Just use the IPXC_AnnotData_Widget interface as you did for setting up font size and color, but now use the Content property.
It should have the following value:
"4" - for check-mark
"l" - (small letter L) - for circle
"8" - cross
"u" - diamond
"n" - square
"H" - star
That's because for rendering the icon, one of the standard built-in PDF fonts - ZapfDingbats - is used. Technically, you can use any of its characters as an icon. I attached screenshots from the PDF specification with its characters set. Please note, values in the "Code" columns are octal.
P.S. In the case of the cross ("8") font is not used.
It should have the following value:
"4" - for check-mark
"l" - (small letter L) - for circle
"8" - cross
"u" - diamond
"n" - square
"H" - star
That's because for rendering the icon, one of the standard built-in PDF fonts - ZapfDingbats - is used. Technically, you can use any of its characters as an icon. I attached screenshots from the PDF specification with its characters set. Please note, values in the "Code" columns are octal.
P.S. In the case of the cross ("8") font is not used.
You do not have the required permissions to view the files attached to this post.
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 6
- Joined: Mon Jul 24, 2023 6:50 am
Re: How to Change CheckBox Icon from Checkmark to Cross
Hello Ivan,
Thank you for the explanation.
Sadly i can't seem to get it to work.
I get the IPXC_AnnotData_Widget interface from my created FormField.
var ff = m_Document.AcroForm.CreateField("AB", PXC_FormFieldType.FFT_CheckBox, currentPage, mediaBox);
IPXC_Annotation widget = ff.Widget[0];
IPXC_AnnotData aData = widget.Data;
IPXC_AnnotData_Widget aWData = (IPXC_AnnotData_Widget)aData;
The aWData.Contents Property returns an Empty String("")
Setting it to another value and returning it to the widget has no effect.
aWData.Contents = "8";
widget.Data = aWData;
Am i misinterpreting the "Content" property ?
I can't find a Property in aWData with a Default Value of "4" for the Default Checkmark.
Thanks in Advance
Rudi
Thank you for the explanation.
Sadly i can't seem to get it to work.
I get the IPXC_AnnotData_Widget interface from my created FormField.
var ff = m_Document.AcroForm.CreateField("AB", PXC_FormFieldType.FFT_CheckBox, currentPage, mediaBox);
IPXC_Annotation widget = ff.Widget[0];
IPXC_AnnotData aData = widget.Data;
IPXC_AnnotData_Widget aWData = (IPXC_AnnotData_Widget)aData;
The aWData.Contents Property returns an Empty String("")
Setting it to another value and returning it to the widget has no effect.
aWData.Contents = "8";
widget.Data = aWData;
Am i misinterpreting the "Content" property ?
I can't find a Property in aWData with a Default Value of "4" for the Default Checkmark.
Thanks in Advance
Rudi
-
- Site Admin
- Posts: 3556
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: How to Change CheckBox Icon from Checkmark to Cross SOLVED
Sorry, my bad, I mislead you a little bit.
Instead of using aWData.Contents = "8", please use
Instead of using aWData.Contents = "8", please use
Code: Select all
aWData.SetCaption(AAT_Normal, "8", true)
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 6
- Joined: Mon Jul 24, 2023 6:50 am
Re: How to Change CheckBox Icon from Checkmark to Cross
Hello,
Thank you all very much.
Works perfectly.
Rudi
Thank you all very much.
Works perfectly.
Rudi
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London