Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all 12130 articles
Browse latest View live

Dialog box handlers element Image is not working with 11.0.7

$
0
0

Hello Team,

 

I am facing one major issue in new release 11.0.7 version.

 

1. I am using javascript API for Acrobat, specially using Dialog box handlers with some Image on dialog.

http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf

see page 108,109

2. Acrobat Version.11.0.6 is working fine.

3. Once i move to version 11.0.7 it stopped working.

4. you can download this pdf and check that issue

 

http://viralpdfmaster.com/vpdfdemo1.pdf 

 

 

Results: it should be work as like 11.0.6 version

Expected results: Dialog will be open with image element,

 

 

My whole product is stopped/discontinue due to above change in new version.

 

Please provide me some support here.


Date Field in Adobe Acrobat X

$
0
0

I have a form that users fill in. One of the fields on this form is a date. Through the properties I have set the date format of dd/mm/yyyy. What I was hoping to be able to do next is, get it to auto populate. So when the field onFocus it executes something similar to the now() you can use in MS Access etc.

 

Is there a way of getting it to add the system date automatically if so, how?

 

Many thanks in anticipation of a speedy helpful response

 

Kindest Regards

 

Toni

Is there any way to enable editing when embedded in a browser?

$
0
0

When I embed Acrobat Pro in the browser it seems to run in a limited mode that prevents most document editing.  It works fine when I access the document directly.

Is there any way I can enable full editing in Acrobat pro when it is browser-embedded?

 

Here's how it looks normally (excuse my choice of pdf)

Acrobat-Active-Edit.png

When embedded it loses its menus, it loses the Tools link in the top right, and most items in the Comment functions.

It doubtless looses a lot more too.

Acrobat-Web-Edit.png

My preference would be to have a simple (browser-side) call I could make to re-enable all these functions.

Note, I cannot add javascript to the pdfs.  I can only act in the browser.

I'm starting to suspect I'll have to write a plugin, but I'd really rather avoid doing that if I can.  It's been years since I've had to seriously develop in C++, and one glance at it reminds me the headache it can be.

 

For reference, browser embedded is key to my architecture, as the document will be being presented with a lot of ancillary information around it, and will need to save to a web-site, not to locally.

(If anyone has any experience with writing a save-back-to-a-website script I'd love to know how that can be done too.)

Doc Save As and Trusted Function

$
0
0

I have been reading over the forum and the adobe help files regarding this. I think I am close but since I need to get my IT department to assist in placing the js files where they have to go, I thought I might ask the forum if I am on the right track

 

I still have to make sure the field values will not include an illegal characters. They wont be empty as the forms will be coming directly from our system -prefilled

 

Currently these forms automatically email (although staff still have to hit the actual send button) when staff go to print the document.  The people who get these forms are just finding it a bit hard to keep up with the emails and have asked to just have the files save to a folder so they can look at when they have time

 

This is what I have for my trust propagator function.  I assume this is the only js file I will need as it incoporates the trusted function?

 

mySaveAs = app.trustPropagatorFunction(function(doc,path)
{
  app.beginPriv();
   doc.saveAs(path);
  app.endPriv(); })

 

myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path)
{
  // Privileged and/or non-privileged code above

  app.beginPriv();
   mySaveAs(doc,path);
  app.endPriv();
  // Privileged and/or non-privileged code below });

 

I got this code from the Adobe Help

 

then I want to have this code in the Document Did Print area

 

var name = this.getField("FormValues.accountNames_0").value
var folio =this.getField("FormValues.folioNumber_0").value

myTrustedSpecialTaskFunc(this, "/w/Public/AccountOpening/" + name + " " + folio,pdf);

 

I have to read where to put the js file as I have seen some comments on the forum that where you place the js file has changed for those with Adobe X and Windows 7

 

Would anyone be be able to let me know if I am on the right path before I get IT involved.  I suppose I could test the code on my own laptop to see if it would allow me to save the form.....

 

Thank you

Created a Form in Adobe Acrobat XI and save that form as "Standard" PDF

$
0
0

I created a Form with Adobe Acrobat XI and now I want to add a button for save that form as "Standard" PDF with Java Script or other suitable way. Please help me.

Thank You.

PDF to TXT Conversion

$
0
0
I'm using Acrobat Standard 8.1.0.

I would like to run from Excel VBA a process to convert PDF files into TXT files. The same affect of opening the files in Acrobat and clicking on Save As and changing the filetype to .txt. I've looked through the online SDK and am rather familiar with VBA, etc. I get the following error no matter what syntax I use to try to save the file as anything other than a pdf file. Here's my code and the error:

Code:

Dim AcroXApp As Acrobat.AcroApp
Dim AcroXAVDoc As Acrobat.AcroAVDoc
Dim AcroXPDDoc As Acrobat.AcroPDDoc
Dim Filename As String

Filename = "R:\My Documents\ZBIR006A_8781830 - DRC000004311.pdf"

Set AcroXApp = CreateObject("AcroExch.App")
AcroXApp.Show

Set AcroXAVDoc = CreateObject("AcroExch.AVDoc")
AcroXAVDoc.Open Filename, "Acrobat"

Set AcroXPDDoc = AcroXAVDoc.GetPDDoc

Dim jsObj As Object
Set jsObj = AcroXPDDoc.GetJSObject

jsObj.SaveAs "R:\My Documents\pdfTest.txt", "com.adobe.Acrobat.plain-text"

AcroXAVDoc.Close False
AcroXApp.Hide
AcroXApp.Exit

Error:
On the jsObj.SaveAs line I get the following error:
"UnsupportedValueError: Value is unsupported. ===> Parameter cConvID.
Doc.saveAs:-1:

I've looked through all of the documentation online and cannot come up with a reason why I'm not able to do this. Please help!!

Batch creation of bookmarks?

$
0
0

Moved from the Acrobat Macintosh forum (Batch creation of bookmarks?)

 


I would like to add 107 bookmarks to a 250-page PDF in an automated  fashion. I have a list of the bookmarks titles, pages, and their  hiearchy level.

 

What's my best bet? [This is with Acrobat 9 on a Mac, but I can use any platform...]

 

Obviously I don't want to create them by  hand with New Bookmark in Acrobat Pro.

My document is not tagged,  and I don't see an easy way to mass create tags (is there one?).

It  appears that the Acrobat Pro scripting DOM does support creating  bookmarks with the Bookmark createChild()method, but it's looking a little  dicey to me how to use that straightforwardly, so if it's easy to  provide a few pointers, I would be greatful.

 

I'd like to avoid buying a  plugin (or using one on a free trial basis, since I don't really intend  to buy one).

I initially planned on using pdftk's update_info functionality, but it turns out that while pdftk's dump_data subcommand dumps bookmark info, it's corresponding update command  doesn't handle bookmarks at all.

I considered writing some Java  code with iText and/or PDFBox, but I didn't see any good examples of  exactly how to create bookmarks that point to pages, and it seemed like  it might be a big pain to figure out.

 

I'm comfortable scripting other  Adobe products in JavaScript, but I've never dealt with Acrobat.

 

Hopefully  that sets the stage. Any advice is appreciated!

 

Thanks!

Using Javascript to upload an image to PDF forum, and then some.

$
0
0

Currently using Java Script in a PDF forum button,

 

    event.target.buttonImportIcon();

 

It works but there are some issues.

 

  1. The files all show up as idle even though I can upload them.
  2. The default file format is PDF, I want it to be JPG
  3. I only want JPG's and PNG's to be allowed.

 

Does anyone know any JS or have any other suggestions that may address these issues?

 

Any and all help is appreciated.

 

Running the most current version of Acrobat on Mavricks.


Need some help with button JavaScript for Save As event.

$
0
0

Hi,

I'm using Adobe Acrobat X Pro and am completely new to scripting forms in Adobe (completely new to Adobe Acrobat as well!).  On a form there is a save button that opens the Save As dialog by using a trigger (Mouse Up) and action (Execute a menu item - File>Save As...>PDF...) and this works fine, however, I want to now use javascript to modify this button's behavior so that is uses a trigger (Mouse Up) and action (Run a JavaScript), and I want that JavaScript to combine the text values from two form fields (a location Dropdown and a date Text field) and use this concateneated string + ".pdf" as the filename when it opens the Save As dialog.  Make sense?

 

This is what I have added to the button as a JavaScript so far I am using a test string at the moment ("NewFile.pdf") and will add the concatenated string to the script after I know the script is working as it should.

 

var newFileName = "NewFile.pdf";

var pathArray = this.path.split("/");

pathArray.pop();

pathArray.push(newFileName);

this.saveAs(pathArray.join("/"));

 

Two issues so far:

1. When I click the button nothing happens, no Save As dialog or anything. 

2.When I check the button properties under the Actions tab the Select Action property shows "Execute a menu item" even though I previously selected "Execute a JavaScript"

 

Thanks for any help!

If/then checkbox script help in Adobe Acrobat Form...

$
0
0

If have an order form that has two different pricing fields (regular price per item & subscription price per item) for each line item and then a quantity and then a total field. Lastly, there is a checkbox on the form that indicate if they are signing up for a monthly subscription.

 

What I am trying to do is create a script that totals each line by the regular price multipled by the quantity or subscription price by quantity if the subscription check box is checked ("Yes"). So far, I've tried several scripts I found in the forum but no luck at all.

 

The check box is near the billing fields toward the bottom so all the line items appear first in the top section of the form. So, an individual would fill out each line and the calculations would just total each row (reg price * qty) as you go down the form...then when you check the subscription box all the line totals would change to reflect the subscription pricing for each row (which can be different). Just need help with one row and I can duplicate for each row.....

 

Here is what I have that does NOT work yet.....:

 

 

 (function () {


if (this.getField("sub").value==="Yes") {
     var b1 = this.getField("Price1b");     var c1 = this.getField("Qty1");     var d1 = this.getField("Price1");     event.value = b1.value * c1.value;
} else event.value = d1.value * c1.value;    }


)();

Split PDF Files by Bookmarks

$
0
0
Can anyone please let me know how do I split PDF Files by bookmark using Java Script.

I am making a Visual Basic utility to read the bookmarks in PDF Files and split them based on the bookmarks. I am able to split the PDF Files by using Arts PDF Split Pro. However since I am already using Adobe Standard, I would like to do it with Adobe itself.

Thus, I pay license for only one software and not two.

Thanks
Rahul

Dependent dropdown lists in Acrobat

$
0
0

Hi,

 

I am a first time poster and was looking for help with some scripting in a PDF form I have created.

 

I am basically looking to have a second dropdown list dependant on the value of the first but I'm not having any success.

 

I have tried the following as a calculation and as a MouseUp Javascript action but to no avail.

 

Basically, I'm looking for the following: If a user selects a School/Unit called Registry in dropdown 1, it will populate with 4 or 5 locations in dropdown 2. I need to do this for about 20 units. I think I'll be ok once I get one unit working but I can't get to that stage

 


// clear the dropdown displayed value and items
this.Value = null;
this.clearItems();


// repopulate the items based on the checkboxes
if(this.getField("School/Unit").Value == "Registry")
{
     this.addItem("Location 1");     this.addItem("Location 2");     this.addItem("Location 3");     this.addItem("Location 4");     this.addItem("Location 5");

}

Can anybody help me please?

 

Many thanks

Scott

Acrobat Crash - Memory could not be read

$
0
0
First of all sorry if this has been covered before, I searched for a few keywords from my error but couldn't really find anything of any help. I am using Acrobat Professional 7.0 in conjunction with a VB6 program, which calls Acrobats JSO object to execute the menu item "save" to save a currently open PDF (which was also opened via the JSO). The program runs continuiously 24/7, and has no problems apart from the wee-hours of the night. At anywhere between midnight and 2am Acrobat crashes on executing the 'save' function with the following error:

"The Instruction at "0x2d864aa2" referenced memory at "0x00000008". The memory could not be "read". Click OK to terminate the program"

Any help much appreciated

P4 3.2GHz
2G Ram
XP SP2
VB6 SP5

Remove 0 Value in Calculated Field

$
0
0
I copied the below question for another post here as it asks the question perfectly.

"I set up an invoice form to calculate totals from quantity x unit price. Every line has this formula, however the users may not have a priced item on every line of the form. My total column shows a $0.00 value until I input data. I'd rather have nothing show in that column unless quantity and price are entered. Is that possible?"

However, and I apologize, but I don't understand the answer that was posted. This is the first time I've needed a calculated field -- and I've not done scripting in Acrobat before.

Can someone walk me through the exact steps of how to enter and what to enter in the form to remove "0" values from the form?

Thanks, in advance, for any and all help.

Changing Another Field with Combo Box (Drop Down) Selection

$
0
0

Hi everyone

 

 

I've been trying to follow the instructions here: http://acrobatusers.com/tutorials/print/change_another_field

 

so I tried to adapt the explained method to my form but nothing is happening really:

 

here is my form : http://cjoint.com/?BKgsODn3tsD

 

 

basically if in the field "Module code" I select Y1H3, I display in the fileds "Texte nRow.. " only:

 

3           <= Texte nRow1

13         <= Texte nRow2

20         <= Texte nRow3

 

if Y2H5 is selected I will have the following sequence displayed:

 

1       <= Texte nRow1

7       <= Texte nRow2

12     <= Texte nRow3

21     <= Texte nRow4

22     <= Texte nRow5

 

and so one for Y3H6 selected ... up to H6H11

 

 

this is what I've try to do:

 

 

so for the field  "Module code":  in proprities > Validate >  Run custom validation script I wrote:

 

 

 

if( event.willCommit )
{   if(event.value == " ")     this.resetForm(["Texte nRow1","Texte nRow2","Texte nRow3","Texte nRow4","Texte nRow5","Texte nRow6","Texte nRow7","Texte nRow8","Texte nRow9","Texte nRow10","Texte nRow11"]);   else     SetFieldValues(event.value);
}

 

then I created a document Javascript called SetFieldValues with the following code:

 

 

 

//-------------------------------------------------------------
//-----------------Do not edit the XML tags--------------------
//-------------------------------------------------------------
//<Document-Level>
//<ACRO_source>SetFieldValues</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:SetFieldValues ***********/
// Place all prepopulation data into a single data structure
var DeptData = { Y1H3:{ Line1: "3",         Line2: "13",         Line3: "20",         Line4: "",         Line5: "",         Line6: "",         Line7: "",         Line8: "",         Line9: "",         Line10: "",                              Line11: "" },                 Y2H5:{ Line1: "1",         Line2: "7",         Line3: "12",         Line4: "21",         Line5: "22",         Line6: "",         Line7: "",         Line8: "",         Line9: "",         Line10: "",                              Line11: "" },                 Y3H6 :{ Line1: "5",         Line2: "11",         Line3: "16",         Line4: "23",         Line5: "34",         Line6: "39",         Line7: "",         Line8: "",         Line9: "",         Line10: "",                              Line11: "" },                 Y4H8:{ Line1: "2",         Line2: "6",         Line3: "9",         Line4: "15",         Line5: "30",         Line6: "33",         Line7: "38",         Line8: "42",         Line9: "",         Line10: "",                              Line11: "" },     Y5H9:{ Line1: "4",         Line2: "10",         Line3: "26",         Line4: "29",         Line5: "31",         Line6: "35",         Line7: "37",         Line8: "40",         Line9: "41",         Line10: "",                              Line11: "" },     Y5H9:{ Line1: "8",         Line2: "14",         Line3: "17",         Line4: "18",         Line5: "19",         Line6: "24",         Line7: "27",         Line8: "28",         Line9: "32",         Line10: "",                              Line11: "" }};        
function SetFieldValues(cDeptName)
{  this.getField("Texte nRow1").value = DeptData[cDeptName].Line1;  this.getField("Texte nRow2").value = DeptData[cDeptName].Line2;  this.getField("Texte nRow3").value = DeptData[cDeptName].Line3;  this.getField("Texte nRow4").value = DeptData[cDeptName].Line4;  this.getField("Texte nRow5").value = DeptData[cDeptName].Line5;  this.getField("Texte nRow6").value = DeptData[cDeptName].Line6;  this.getField("Texte nRow7").value = DeptData[cDeptName].Line7;  this.getField("Texte nRow8").value = DeptData[cDeptName].Line8;  this.getField("Texte nRow9").value = DeptData[cDeptName].Line9;  this.getField("Texte nRow10").value = DeptData[cDeptName].Line10;  this.getField("Texte nRow11").value = DeptData[cDeptName].Line11;
}

//</ACRO_script>
//</Document-Level>
//<AcroForm>
//<ACRO_source>DepartmentNames:Keystroke</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:DepartmentNames:Keystroke ***********/

 

 

and actually nothing happened,

 

can anyone have a look at it please?

 

thanks a lot,


Convert Feet and Inch to cm (and vice versa)

$
0
0

I need some help with conversion of height. The form was designed by the department and there is a field where one need to enter the height of the participant.

 

The height can either be in cm or in Feet + Inches (not just inches). Once a value has been entered in cm, it converts it automatically to feet and inches. If the user enter the height in feet and inches, it converts it immediately into cm. Much like the kg to lbs conversion fields in the attached document. I have been able to convert the height in cm into Feet and inches e.g. 165 cm = 5'5". However I am not sure how to do the opposite.

 

The problem is the way it has been designed as there is a box for Feet and another box for Inches. If the other measure was in Inches only, it would have been easier and that would be like the kg to lbs conversion.

 

I have tried multiple way to try to the conversion, but none would do it exactely like the kg to lbs conversion.

 

Here is the form:

https://workspaces.acrobat.com/?d=j8kksFor3eVIg6M07CdkmA

Conditional JavaScript for Tax Form Fields

$
0
0

I'm not sure how to compose a keyword search for this solution.  So,  please redirect me to an existing solution if it exists.  Also, I am not familiar with JavaScript, but can struggle through it.  I am converting a tax form to a fillable one which calculates fields with dollar amounts.  Below are two very good examples of what I am trying to accomplish.

 

BOX 6 FORM FIELD

IF BOX 4 IS GREATER THAN BOX 5F ENTER BALANCE DUE (NOT LESS THAN $1.00)

 

BOX 7 FORM FIELD

IF BOX 5F IS GREATER THAN BOX 4 ENTER OVERPAYMENT BELOW (NOT LESS THAN $1.00)

 

Basically, I am comparing two dollar values in two boxes, then calculate two form fields' values on the condition being true.

 


Thank you for any help you can provide,

 

Ruezo

Calculating Based on Checkbox Value

$
0
0
ok I have simple situation, one checkbox and one text field. If the check box is checked, I want the value of the text field to be 3(just an example).

I'm new to formcalc
on the text field calculate, this is what I have, and ofcourse it doesn't work.

If cbquickbooks.value=1 then(txtquickbooks.rawValue=3)

Thanks!

change value on checkbox

$
0
0

i have 5 radio button name as Rbutton have diffrent value

1, 2, 3, 4, & 5.

 

depends on user selection of Rbuttion i need change value in checkbox price.

 

example if radio button Rbutton value 1 is selected by user then value of checkbox need to be change to 111.

checkbox default value is 0

 

if radio button Rbutton value 2 is selected by user then value of checkbox need to be change to 222...

change check boxes & text fields size using javascript

$
0
0

Hi, i want to change in my form check boxes sizes as bellow.

height - 0.25 in

width - 0.25 in

as well as all text fields height i want to change to - 0.31 in. so possible to do this work using javascript ??? if possible, pls give me javascript for this. thanks..

Viewing all 12130 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>