Copy link to clipboard
Copied
I need to know urgently if there is a possibility to make superscript characters or numbers in Adobe Acrobat Pro DC? Thanks!!
Copy link to clipboard
Copied
Superscript where?
Copy link to clipboard
Copied
Hey! Thanks.
I am working with form fields and would like to put superscript numbers behind certain words.
That means if possible after i created them on the pdf.
is there chance at all? i cant even copie and paste the numbers from somewhere else into the pdf...
there must be a way!!
Copy link to clipboard
Copied
Go to the field's Properties, and under the Options tab tick the "Allow Rich Text Formatting" box.
Now exit the Form Edit mode, click into the field and press Ctrl+E. A properties toolbar will open with various settings. One of them is to set the text as superscript.
Copy link to clipboard
Copied
thank you!
Copy link to clipboard
Copied
Hi,
Would you know how to use superscript on a large script. Let's say a 10 page text where the superscript would be use on a single word? The span option described in the acrobat reference guide works well for small text where you span each word or a bundle of words. Could you instead use a text replace functions inside the span?
Copy link to clipboard
Copied
You want use a 10 page text in a form field?
Copy link to clipboard
Copied
There's no such thing as a 10-page text field. A field can only be located on a single page.
Copy link to clipboard
Copied
You are right I exagerated!
I will show a picture.
The first date (see image in yellow) works fine. The date is taken from a calander.
Here is the script to add the er in superscript for the first date
var oDateValue = util.scand("d/mmmm/yyyy",this.getField("Date1_af_date").valueAsString);
var nJours = util.printd("d", oDateValue);
var cMois = util.printd("mmmm", oDateValue);
var nAnnee= util.printd("yyyy", oDateValue);
var DateComplete = nJours+ " "+cMois+ " "+nAnnee;
var MoisAnne = " "+ cMois + " "+ nAnnee;
var g = this.getField("DatteLettres_af_date");
if (nJours ==="1" && cMois !="")
{
// Create an array to hold the Span objects
var spans = new Array();
// Each Span object is an object, so we must create one
spans[0] = new Object();
spans[0].text = nJours;
spans[1] = new Object();
spans[1].text = "er";
spans[1].superscript = true;
spans[2] = new Object();
spans[2].superscript = false;
spans[2].text = MoisAnne.toLowerCase();
}
else{
event.value = DateComplete.toLowerCase();
}
// Now assign our array of Span objects to the field using
// field.richValue
g.richValue = spans;
For the second one, I have some issues.
The text for the letter comes from an acroDialog. This allows to easily change the letter template.
I applied some scripting and replace some terms with some variable results to update the letter.
End of script to display info into the letter:
var NewTexteLettre1_v = "";
NewTexteLettre1_v = TexteLettre1_v.replace(/AfficherPolitesseDeLaLettre/g,PolitesseArray1).replace(/AfficherDateOuverture/g, dateOuvertureR).replace(/AfficherMontantSansLotsAdjudicataireDeLaLettreSansQualite/g,NewMontantSSLotsAdj).replace(/AfficherGarantieDeLaLettre/g,AfficherGarantieL1).replace(/AfficherNonConformiteOuAdmissibiliteDeLaLettre/g, AfficherConformite1).replace(/AfficherAdjudicataireSSLotsQual/g,AdjudicataireSSLotsQual).replace(/AfficherLotsEtMontantsAdjudicataireDeLaLettreSansQualite/g,LotMontantAdjL1).replace(/AfficherLotsEtMontantsAdjudicataireAvecLotsSansQualite/g,TousAdjudicataireLots).replace(/AfficherNoteQualiteAvecQualiteSansLotsDeLaLettre/g,NoteQual1).replace(/AfficherMontantAdjQual/g,MontantAdjQual).replace(/AfficherMontantAjusteQual/g,PrixAjusteQual).replace(/AfficherRangNonAdj/g,rangLettre1R).replace(/AfficherNoteQualitéAdjudicataire/g,NoteQualAdj).replace(/AfficherSignataire/g,Signataire).replace(/AfficherTitreSignataire/g,TitreSignataire).replace(/AfficherInitiales/g,Initiales).replace(/AfficherMontantSansLotsAdjudicataireAvecQualite/g, MontantSSLotsAdjQualL1).replace(/AfficherMontantAjusteSansLotsAdjudicataireAvecQualite/g,MontantAjSLASAQL1).replace(/AfficherAdjudicataireSansLotsSansQualiteOuAvec/g,SoumisionnaireSSLots).replace(/AfficherAutresAdj/g,AfficherAutresL1).replace(/AfficherDuouDes/g,afficherDuouDesL1);
event.value = NewTexteLettre1_v;
My challenge:
How could I add the er in superscript in the letter? I know how to add er but not in superscript in the second example, and I don't want to manually configure the letter like I did for the first date because there is a lot of info in the text field coming from the acrodialog.
I think I would need to use something like this but I don't know how to adapt it to. Also where should i place the adapted script, in the personalized format script?
Info from API reference 2017
// Custom Keystroke event for a rich text field.
var span = event.richChange;
for ( var i=0; i<span.length; i++)
{
span[i].text = span[i].text.toUpperCase();
span[i].underline = !span[i].underline;
span[i].textColor = (span[i].underline) ? color.blue : color.red;
}
event.richChange = span;
Hopefully I can get some help. Thanks
Copy link to clipboard
Copied
I'm not totally following, but basically you want to automatically convert all instances of "er" following a number to superscript, is that it?
Copy link to clipboard
Copied
Hi,
No, only add er in superscript if the user selects the first day of the month.So the er superscript is only for the date in yellow.
I managed to do it for the first example (only a date in a text field), but not the second (a date with a lot of text around it).
In the second example, I am able to display the er if the first day of the month is selected but not in superscript.
I tried to add specific words in the acrodialog text to decompose the date. See example in bold.
AfficherPolitesseDeLaLettre,
Suite à l’appel d’offres pour le sujet mentionné ci-dessus, nous avons procédé à l’ouverture le DisplayDay DisplayER DisplayMonthandYear AfficherDateOuverture, L’Université tient donc à vous informer que votre compagnie est l’adjudicataire et ce, conformément aux prix soumis à l’Annexe 2.00 – Offre de prix au montant de AfficherMontantSansLotsAdjudicataireDeLaLettreSansQualite $, avant taxes.
Afin de finaliser l’entente, veuillez svp signer le contrat ci-joint et nous le retourner dans les plus brefs délais. Un bon de commande vous sera envoyé suite à la signature du contrat.
Then I tried to use some text replace in the span formula. But it seems that the span formula works only if you decompose everytning in strings. What I wish to do is to replace DisplayER by er in superscript.
The variable that holds all my text is called NewTexteLettre1_v and the variable that holds the day of the month is nJoursR.
So I want to display the text associated with NewTexteLettre1_v and only add er to the variable nJoursR.
Maybe something like this
spans[0] = new Object();
spans[0].text = NewTexteLettre1_v;
spans[1] = new Object();
spans[1].text = nJoursR.replace(/DisplayER/, "er"); ?
}
The thing is that I don't want the er to appear at the end of NewTexteLettre1_v. I want er to be in superscript at the second date location. I hope its a bit clearer. Thanks
Copy link to clipboard
Copied
Split the text in 2 spans and insert the span for "er".
Copy link to clipboard
Copied
Hi,
The only issue is that it would hinder me from using the acrodialog to update my template. I would need to create two windows in my acrodialog for the same template. That would look weird.
Is there another way. Maybe a unicode for exponent? Or a search and replace function that could only target the date? Thanks
Copy link to clipboard
Copied
Hi,
I found a solution that is not perfet but acceptable.
I will split my text into separate strings. The only thing is that I will not be able to modify the first paragraph length with my acrodialog.
Example to separate my strings:
-var x = NewTexteLettre2_v.substr(0,300);
-add my date variables
-add the other string -var z = NewTexteLettre2_v.substr(301,700);
I will input into the span...
If someone has a better idea, please share.
Thanks
Copy link to clipboard
Copied
First you must tick the "Allow Rich Text formatting" option.
When typing, hit ctrl-E* to display the "Form Field Text Properties".
* cmd-E on MacOS
Copy link to clipboard
Copied
thank you!
Copy link to clipboard
Copied
it works. thanks a lot!