Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Oct 22, 2021 4:12 am

Hi there

I'm evaluating your product, which looks great.

I have 2 questions

1. For a checkbox that I add to an existing pdf, is it possible to increase the size of the tick? I've tried using font but that didn't work. My checkbox size is 15 by 15, and the tick inside looks very small.

2. I'm adding multiple checkboxes along with a textbox for each checkbox into an existing pdf. I was wondering if it was possible (via javascript or some other method) so that when a user checks a particular checkbox, the current time is inserted into the associated textbox that sits beside

Thanks for any help with this

Steve

Stevo123
 
Posts: 10
Joined: Fri Oct 22, 2021 4:03 am

Fri Oct 22, 2021 7:33 am

Hello,

Thank you for contacting, below are my answers to your questions.
1. I reproduced that setting checkboxField.font didn't make the correct display effect. This issue has been logged into our bug tracking system with the ticket SPIREPDF-4736. Our Dev team will further investigate and fix it. Once there is any update, we will let you know. Sorry for the inconvenience caused.
2. Our Spire.PDF supports adding action. You can refer to the following sample code to have a try. If there is any question, please share us with your input PDF file as well as your desired output effect for a further investigation.
Code: Select all
//Load your existing pdf
string input = @"input.pdf";
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(input);
pdf.AllowCreateForm = (pdf.Form == null) ? true : false;
//Get the first page
PdfPageBase page = pdf.Pages[0];
//Create a textbox field
float x = 100;
float y = 100;
PdfTextBoxField textbox = new PdfTextBoxField(page, "TextBox");
textbox.Bounds = new RectangleF(x, y, 100, 20);
textbox.BorderWidth = 0.75f;
pdf.Form.Fields.Add(textbox);
//Create a checkbox field
PdfCheckBoxField checkboxField = new PdfCheckBoxField(pdf.Pages[0], "checkbox1");
float checkboxWidth = 15;
float checkboxHeight = 15;
checkboxField.Bounds = new RectangleF(60, 100, checkboxWidth, checkboxHeight);
checkboxField.BorderWidth = 0.75f;
pdf.Form.Fields.Add(checkboxField);
//Add action
string script = "var time = Date.now();var d = new Date(time);this.getField(\"TextBox\").value=d;";
PdfJavaScriptAction action = new PdfJavaScriptAction(script);
checkboxField.Actions.KeyPressed = action;
pdf.SaveToFile(@"result.pdf", Spire.Pdf.FileFormat.PDF);

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Tue Nov 09, 2021 7:22 am

Hello,

Glad to inform that we just released Spire.PDF Pack(Hot Fix) Version:7.11.1 which fixed SPIREPDF-4736. Welcome to download it from the following links to test.
Website link: https://www.e-iceblue.com/Download/download-pdf-for-net-now.html
Nuget link:https://www.nuget.org/packages/Spire.PDF/7.11.1

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Fri Nov 12, 2021 4:00 am

Hello,

Greetings from E-iceblue.
Did the hotfix work for you? Thanks in advance for your feedback and time.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Wed Jan 19, 2022 3:26 am

Sorry about the delay in replying, yes the hotfix corrected the issue.

Thanks very much for that.

Steve

Stevo123
 
Posts: 10
Joined: Fri Oct 22, 2021 4:03 am

Wed Jan 19, 2022 9:59 am

Hello,

Glad to hear that!
If you encounter any issues related to our products in the future, just feel free to contact us. Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF