Thom Parker
Community Expert
Thom Parker
Community Expert
Activity
‎Feb 28, 2025
03:06 PM
That PDF does not contain any form fields.
Did you intend to copy fields from the first form onto the second?
If so I would suggest using the replace Pages option in the "Organize Pages" toolset
... View more
‎Feb 27, 2025
05:20 PM
Adobe Reader should work fine. There must be something else going on. You will need to debug this from a user's computer where it isn't working.
How are you sending the form to them?
... View more
‎Feb 27, 2025
05:13 PM
As stated in my response, ".Net" is an executable in the local file system, which is restricted in protected mode. I suspect that ".Net" itself is blocked. But even if it is not, then maybe it is doing something on the local file system to open the socket that Acrobat doesn't like. Your guess is as good as mine.
... View more
‎Feb 26, 2025
10:42 PM
The form is fine. The problem is on the user end.
What PDF viewer/app are the users using to fill the PDF?
... View more
‎Feb 26, 2025
10:39 PM
Protected mode restricts access to the local file system, so the Windows API functions won't work, unless you create a broker.
But the solution is simple. Save the PDF to the new location using the Acrobat SDK functions. Then you avoid the restriction.
... View more
‎Feb 26, 2025
02:36 PM
Use the Custom Validation script on each field.
For example:
if(event.value <=4 )
event.target.fillColor = color.green;
Here's an article on how to edit field properties such as the Validation Script.
https://www.pdfscripting.com/public/Editing-Fields-Properties.cfm
Here's the reference entry for form field properties:
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#field-properties
You'll find more information on scripting form fields here:
https://www.pdfscripting.com/public/PDF-Form-Scripting.cfm
You're value ranges are unworkable, so you'll need to modify them.
... View more
‎Feb 26, 2025
11:30 AM
The regulare expressions I provided are not for correcting input, but for detecting incorrect input.
Here's an article on how to use regular expressions:
https://www.pdfscripting.com/public/Pattern-Matching-with-Regular-Expressions.cfm?sd=40
... View more
‎Feb 26, 2025
09:55 AM
It's a bit of misinformation on Adobe's part because they don't explicitly say that Sign forms are not PDF forms. An Adobe Sign form is an electronic document that is viewed and operated on through the Adobe Sign Server, and only the Adobe Sign Server. You can use a PDF, Word, or possibly another type of document as a template that is fed into the Adobe Sign server to create an Adobe Sign Form. Sign forms have a different set form field types than a PDF form.
This is why there is an option in the Acrobat Form tools for creating a Sign form. This option displays a toolbar that has the correct set of available Sign Form fields.
... View more
‎Feb 25, 2025
09:25 AM
1 Upvote
Acrobat plug-ins are written in C++. So I have to assume that you did in fact write a plug-in in C++, but are loading a DLL created with C#. Is this correct?
I have not used C# for HTTP operations in a plug-in, but I have used the Windows API (and with MFC) for this purpose. I haven't had any issues in either protected or non-protected mode. So I do not think HTTP operations are the issue.
In protected mode Acrobat blocks access to local system resources that it considers risky. For example, the registry and file system, as well as any executable. Since .Net is a local executable, it makes sense that it would be blocked. I'm just speculating here. I'd suggest that you consider either accessing HTTP through the Windows API directly, or use a Broker to handle protected mode.
... View more
‎Feb 25, 2025
07:53 AM
You will find the answer here:
https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm?sd=40
The simple way to do this is to use the MouseUp event on a radio button. You'll need to put code on every radio button that affects the visibility of the field.
... View more
‎Feb 24, 2025
06:51 PM
Ok, so the plugin is trying and intermittantly failing to save a PDF file to a local folder that was opened from Google Drive. And it is doing so with no failure indication. I'm drawing a blank on that one.
And it's always with the same files. A repeated attempt doesn't eventually save the file?
... View more
‎Feb 24, 2025
10:48 AM
This is a dynamic XFA form, not a PDF. It can only be viewed correctly in Acrobat. I'd only used in in the latest Acrobat DC.
The problem is with document, there is an error in the print script on the button.
However the script is simply trying to execute the print menu item. So try printing it from the "File->Print" menu item.
You probably are using the new Acrobat UI. To make this process easier, revert to the old UI.
... View more
‎Feb 24, 2025
09:51 AM
Copy the code I provided to the console window and run it as a test to add bates numbers to a single document.
The only thing you need to add is the rectangle coordinates. Use the method I outlined above.
Watch this video to learn about using the console window.
https://www.pdfscripting.com/public/images/video/AcroJSIntro/AcroJSIntro_ConsoleWindow.cfm
... View more
‎Feb 21, 2025
06:08 PM
A simple way to get the page coordinates for placing the field is to place one manually, the get the coordinates from it by running this code in the console.
this.getField("TestField").rect
Then in the code the rect looks something like this:
var rectPlacment = [1,2,3,4];
Please read this article:
https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm
Also look at this one:
https://www.pdfscripting.com/public/PDF-Form-Scripting.cfm
If the documents you are processing are all the same, then the placement rectangle will be the same, but if the pages are different sizes you'll need to write some code to find the correct coordinates. Everything you need is in the articles.
Find a list of field properties here:
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#field-properties
"textSize" is the property for the text size.
... View more
‎Feb 21, 2025
02:46 PM
1 Upvote
An easy way to add new text to a PDF is to use a text field. Use the doc.addField() function
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/doc.html#addfield
var nCnt = 0;
var nBatesNum = 1;
var rectPlacment = ... Calculate placement ...;
for(var nPg = 0;nPg<this.numPages;n++){
var oFld = this.addField("BatesNum" + nBatesNum , "text", nPg, rectPlacment);
oFld.value = nBatesNum;
if(++nCnt >=6){
nCnt = 0;
nBatesNum++;
}
}
this.flattenPages();
Determining the placment of the number is up to you. There are also some text field properties that will need to be set, and possibly some text formatting. Up to you.
After the script is finished you should flatten the PDF.
If you want to see some examples of more sophisticated Bates numbers scripts, then see these links;
There is a free one here (the Stamp and Number Document):
https://acrobatusers.com/actions-exchange/
This one is a hopped up version:
https://www.pdfscripting.com/public/File-Name-Stamper-Action-Description.cfm
... View more
‎Feb 21, 2025
11:43 AM
My answer is not patronizing.
It is a fact, the form was acquired from an organization that encrypted it. Obviously they felt the needed to protect it. You suggested making unauthorized modifications to use it outside the intended purpose. That is actually pirating someone elses property. You are guilty.
You also didn't mention you'd already contacted the owner. That would have been helpful. So again your fault for not providing complete information.
Take your lumps and be honest about what you are doing.
... View more
‎Feb 21, 2025
11:07 AM
Since this is not your form, you really aught to speak with the owner to see if they can help you. Otherwise you are pirating someone else's property.
... View more
‎Feb 21, 2025
11:03 AM
To add to Try67's analysis. If a field value needs to be changed in a certain way, then the original value has to be preserved. Otherwise it can never go back. Calculations need to be a linear progression. It starts somewhere stable and then goes somewhere else. You don't have a stable starting place. Think about that.
Using the MouseUp event will provide an approximation. But it is not restoring the original value. Each time the number is divided and multiplied it losses data. Depending on the initial value, it could either maintain a stable value, or become unstable. So this is not a good strategy.
... View more
‎Feb 21, 2025
10:46 AM
It seems like the issue is outside of Acrobat, or at least something that is not coming back through the SDK. Which isn't surprising for a remote folder. I would suggest a test that saves the file outside of the SDK. It might provide some more insight to the issue.
Save the PDF to a safe, local temporary folder. Then use the OS api (from inside the plug-in) to move the file to the remote folder.
Another method might be to use the API for the remote folder service directly, rather than relying on the OS to interpret the operations.
... View more
‎Feb 21, 2025
10:01 AM
Just for future reference. Save files you need locally. Link are always unreliable, cause they change or go away. That link is probably invalid now, and doesn't have anything to do with your settings. They often have an expiration.
... View more
‎Feb 14, 2025
01:51 PM
The Console is displayed by pressing Ctrl-J.
See this video:
https://www.pdfscripting.com/public/images/video/AcroJSIntro/AcroJSIntro_ConsoleWindow.cfm
AI will screw you. It is the worst possible way to write a script. All it does is cobble together random crap from the web. Whereas the helpful experts on this forum, and others, actually know what they are doing and test code before providing it.
Don't ever ask someone here to fix crap from an AI.
... View more
‎Feb 14, 2025
01:46 PM
1 Upvote
See this web site:
www.pdfscripting.com
... View more
‎Feb 14, 2025
11:53 AM
There are errors displayed in the Console Window for all selections. The "Cleric" selection has the additional error that Nesa pointed out. But you should always check the console first and fix those errors.
... View more
‎Feb 13, 2025
11:49 AM
I think what Mike means to say is that it should not happen. The appearance of those checks is explicitly defined in the PDF, which is what PDF is all about. By definition, a PDF file should look exactly the same in all viewers on all platforms.
If it is not displayed the same, then that viewer is non-compliant piece of crap and you should avoid using it.
... View more
‎Feb 13, 2025
11:40 AM
1 Upvote
For future reference:
https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address/
... View more
‎Feb 13, 2025
11:39 AM
There is nothing to fix because there is nothing wrong, i.e., things being different than you would like does not mean they are wrong. However, if you edit the text, or change the box size/position, it is highly possible that the next time you open the PDF, or even the next time you switch to PDF Edit mode, the division in text boxes will change.
I shouldn't be suggesting this, but there is another way to edit PDF content that will get you where you want to go.
1. Delete the "text box" that has the content you want to modify.
2. Add the new text in the proper format. There are a few ways to do this. Here are the two simplest
a) Use the "Add text" tool. This is fast and easy but has the same problem you're posting about if you need to make changes.
b) Use a text markup annotation. You get the same fornt and formatting options, but the text is in its own separate box that can be easily modified. You'll need to flatten the PDF after you're finished.
All that said, performing major edits in the PDF is a really bad practice. You run the risk of corrupting the PDF beyond repair. Acrobat is not a document content editing tool. It is a document finishing, organizing, and analysis tool. Major changes should be made in the original document and then re-converted to PDF.
... View more
‎Feb 12, 2025
10:35 AM
This is something Acrobat does automatically when parsing the page content for editing. The why and how are mysteries.
Why do you care?
... View more
‎Feb 12, 2025
10:27 AM
For future reference:
https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address/
https://acrobatusers.com/tutorials/submitting-data/
... View more
‎Feb 11, 2025
05:00 PM
Tracking the selected value is done by saving it and watching for all changes to the checkboxes. Probably the best approach is to use a text field. The calculation event is called anytime any value on a form is changed. So it works for both saving the value and tracking changes. For the example code I'll assume the renaming I suggested.
Here's the script for a custom calculation on a hidden text field.
if(event.source && (event.source.name.split(".").shift() == "Block"))
{// only process field changes from the checkbox block
if(event.source.value == "Off")
{// Checkbox is turning off
if(this.getField("Block").getArray().every(a=>a.value == "Off"))
{// all checks are off so clear saved value
event.value = "";
}
}
else if(event.target.value == "")
{// No previously selected value, save current selection
event.value = event.source.value;
}
else
{// Current value, reject selected if it doesn't match
if(event.target.value != event.source.value)
{// Doesn't match so turn off
// Can't directly change field that is triggering this event, so delay
app.setTimeOut('this.getField("' + event.source.name + '").value = "Off";',10);
}
}
}
... View more
‎Feb 11, 2025
03:40 PM
Yes this is possible.
But to be clear. If no checkboxes are selected, then any checkbox can be selected? any row, any column?
Then only checkboxes in the same row as the first selected checkbox can be selected?
To do this you will need to track the value of the first check box selected. All other selections are then rejected if they don't match the saved value. The saved value can only change if all boxes are first unchecked.
I would also suggest renaming the fields to include a block prefix, like this "block.AddAlt1", "block.AddAlt2".
... View more