Expand my Community achievements bar.

SOLVED

Baffled. Baffled and frustrated. How do you insert a graphic?

Avatar

Former Community Member

I have to say that, so far, I absolutely hate Acrobat 9 and LiveCycle. I am finding them, particularly LiveCycle (which at the moment feels to me like it should be called DeathSpiral), opaque, clunky and creating lots of what appear to be random errors. If you can't tell, I am amazingly frustrated. Worse than I have ever been with any software I have ever used. This is much worse than the worst of Macromedia, which I found to be entirely non-intuitive. I've been working on this for 3 DAYS!

Now the problem.

I am trying to create a simple online printable certificate (a form) with a background graphic (the certificate border), a user entered name field, a user entered number field, and a field that automatically fills in the current date, with an audio file attached that plays (instructions for completing the form) on load one time, without displaying the player.

I've done this before and easily with version 7. I spent nearly a year working on a series of projects that had all of these features.

Unfortunately, when we loaded version 9 we uninstalled version 7 and no one knows where the discs went.

The problem is that I don't know how to insert the auto date field in Acrobat 9. I can do it easily in LiveCycle, BUT I can't find a way to insert the background graphic in LiveCycle.

I've tried saving the file with no security of any kind and then opening it in Acrobat 9, where I can insert a background graphics, and quite mysteriously it says I "do not have sufficient permissions" to insert the background graphic, but does not define "permissions". What's up with that?

I tried making a document in Word that had the background and text laid out properly, then importing it into LiveCycle, but LiveCycle strips out the background graphic.

Thinking there might be something wrong with the graphic, I've tried several different graphics. Same result.

Copying the JavaScript LiveCycle creates into Acrobat 9 does not work.

HELP is absolutely no help. It says you can "replace" a background on the Master and implies you can add one, but does not say how. None of terms I've searched on produces anything that actually addresses my problem. The INSERT menu, where you'd expect to find a way to insert a graphic, is of no use. In fact I can't find any command anywhere in LiveCycle that makes the slightest reference to graphics.

Copy and paste doesn't seem to work. If I paste any graphic into LiveCycle it appears blocky and I get a message saying there isn't enough "room" for it (whatever that means). I assumed I was seeing some sort of low-rez version, but when I look at the doc in "preview" the graphic does not show at all.

So what I am looking for is...

  1. a method for inserting graphics in LiveCycle and/or
  2. a method for inserting an auto date field in Acrobat 9 and
  3. an explanation of what "permissions" are, in the context of a document without any security restrictions, and how to deal with them.

Thanks and my apologies for the rant.

JP

1 Accepted Solution

Avatar

Correct answer by
Level 10

Glad you have it working!

I remember punch cards however didn't use them in anger. Fortran/Fastgino Graphics on a Digital Micro-Vax II.

Just to point out where you can get feedback on script.

In LC Designer there is a tick button above the script editor, which will check the syntax of the script and let you know if there are errors:

In Acrobat, if you click Control+J you will bring up the Javascript Console. At its simplest it will highlight script that has failed:

In addition, you can edit script directly within the console and you can paste script into the console and hit Enter. It will run the script and either give the answer or show an error:

Hope that helps restore your faith in Acrobat / LC Designer.

Niall

View solution in original post

15 Replies

Avatar

Level 10

Hi,

Hang tough!!

A form that is developed in LC Designer is fundamentally different to one developed in Acrobat.

While you can open a LC form in Acrobat (and Reader), you cannot edit the layout in Acrobat.

LC Designer generates XFA forms, which can be opened and filled in using Acrobat/Reader.

I would recommend that you insert the graphic in LC (which I appreciate you have been trying to do):

  • Open the form in LC and go to the Master page;
  • Drag in an "image" object from the library;
  • In the Object/Draw you can click a folder (URL) and browse to the image you want (JPEG, PNG);
  • Remember to tick the "embed file" in the Object/Draw tab;
  • Then resize the image object to suit your layout.

LittleSnapper2.png

Hope that helps,

Niall

ps Because you are also seeking to have audio play, I would be inclined to work in Acrobat (and not in LC Designer at all). Generate the certificate in an application of your choice. Then print/export this to PDF.

Now when you open the certificate in Acrobat, you can go to the Forms Menu and select "Add or Edit Fields...". It will detect that it is an Acrobat form (and not an LC Designer form) and it will open a forms view within Acrobat. You can then add the couple of fields that you want). When done close the forms view and you can test the fields.

Then you would attach the audio file into the certificate (via attachment panel). To get this to play you would need either document level Javascript or a button set to play the multimedia.

Avatar

Former Community Member

Thank you so much, Naill.

I work in video production where we often do some things with one program, other things in another program, and still other things in a third program so I assumed the same approach would work for this job. Just being to told that LC and Acrobat do not produce completely compatible files relieved a lot of pressure.

I have done as you suggested and produced the form in Acrobat (which is actually where I was a month ago, when the client insisted that the current date be automatically filled in and not changable by the user), but now I'm back to having to put the auto-date field in the Acrobat form and I don't know how to do that.

Do you, or anyone else, have a method for doing that?

I tried using the JavaScript that LC generated in the address field's calculation section, but that doesn't work. I just get the error message

"invalid label
1: at line 2"

(see the attached jpeg that shows what I did)

I'm not at all knowledgable about JavaScript (will have to take some training soon), so I have no idea what is wrong.

ANY help from anyone will be appreciated.

Thanks, JP

Avatar

Level 10

Hi JP,

Attached is an AcroForm (form developed in Acrobat). It has a textField (Forms / Add or Edit Fields...) called currentDate. It has the following Javascript in the calculate tab of its properties.

var i = this.getField("currentDate");

i.value = util.printd("dd-mmm-yyyy", new Date());

Please note that the flavour of Javascript in Acrobat/AcroForms is different to that used in LC Designer/XFA forms.

Hope that helps,

Niall

Avatar

Former Community Member

Sorry to impose so much, but I am rather desparate to get this done, so I REALLY appreciate your help and your patience.

I inserted the JavaScript as you said, BUT nothing appears.

I assume that the date should appear.

I have attached another jpeg to show you how I've set the other Properties. I've looked, but I can't see anything that looks like it would foul things up, but I have not been doing very well so far. Maybe something will catch your eye.

I'm usually very good at this figuring out things from tiny little clues bit, but until something, anything actually happens I've got no clues to work with.

Thanks again, JP

Avatar

Level 10

Hi JP,

The script gets a field called "currentDate". This was the name of the object in my AcroForm.

Your form has a field called "today". Firstly I would be inclined to change this to something like "oToday" to try and stay away from words that may get confused with functions / restricted names.

So if you replace "currentDate" with the name of your field; either "today" as it is now or "oToday", then the script should work.

Hope that gets you out of the blocks,

Niall

ps You may want to change the date pattern to one that suits your locale: mm/dd/yyyy

Avatar

Level 4

Thanks for your rant. I feel exactly the same way, like 50% of the time when creating forms. I usually enliven my rants with curse words and flying objects, so I can't reproduce them in this forum and I am happy you finally vented for me.

Avatar

Former Community Member

It appears I am even more incredibly dense than even I am willing to admit, but your previous message also produced nothing for me.

I changed the field name as you suggested. I checked to be sure that the date formats matched. I made sure I hadn't stupidly set the font color to white. I did everything I could think of and again what I got was a blank spot on the form.

The only thing that I suspect might be the problem is the fact that there doesn't seem to be anything that tells the JavaScript when to run. Does that just happen automatically?

Here, in frustration, is the file itself.

Avatar

Former Community Member

JennyAnn

Always glad to help. Rants produced as required.

I am unfamiliar with JavaScript and I suspect THAT is my problem.

OTOH I found it very illogical that even when you actually attach JavaScript directly to a particular field, you still must tell JavaScript the name of that field. If the script were attached to the page in general, I would understand that you need to tell the script what field you want it to use, but if a JavaScript is actually one of the Properties of a particular field it should automatically know the name of the field it's attached to.

JP

Avatar

Former Community Member

Naill

I just copied and pasted the AcroForm field you sent me into my form and RAAAAAH! it works.

So thank you very much for sending me the solution.

None-the-less, I've compared the script I entered in my form, to the one you made and sent to me. I can't find any difference. So while I AM intensely grateful to you for getting the form to work. I am still baffled and would like to know what the heck I did wrong.

Thanks, JP

Avatar

Level 10

Hi JP,

The AcroForm javascript has a space between "new" and "Date" in  ... new Date().

Here is the form back to you. Seems to be working OK now.

There are some good resources for both Acrobat and LC Designer. Most are free, and others cost a few $:

http://www.adobe.com/go/learn_lc_scriptingBasics

http://www.adobe.com/go/learn_lc_scriptingReference

http://www.adobe.com/go/learn_lc_formCalc

http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Refer ence.pdf

http://www.adobe.com/devnet/acrobat/pdfs/lc_migrating_acrobat_xmlform.pdf

And a very handy resource (it goes back to version 6, but is still applicable):http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf

JP Terry's book on LC Forms is very good and we use www.pdfscripting.com (which is a subscription service).

Good luck and hang tough!!

Niall

PS Your post came in as I was typing this. Another tip would be to check the JavaScript console in Acrobat to try and debug script. When the form is open in Acrobat, just click Control+J and the console will show up errors. 

Avatar

Former Community Member

That's it? An errant space? And the language gives you no feedback?

Even when I was programming Fortran on punch cards in the mid 70's, you got error messages when you made typos. How does anyone actually produce JavaScript that works without any feedback? I'm amazed.

I am also truly grateful to you for your patient assistance. I would not have succeeded without it.

Sincerely, JP

Avatar

Correct answer by
Level 10

Glad you have it working!

I remember punch cards however didn't use them in anger. Fortran/Fastgino Graphics on a Digital Micro-Vax II.

Just to point out where you can get feedback on script.

In LC Designer there is a tick button above the script editor, which will check the syntax of the script and let you know if there are errors:

In Acrobat, if you click Control+J you will bring up the Javascript Console. At its simplest it will highlight script that has failed:

In addition, you can edit script directly within the console and you can paste script into the console and hit Enter. It will run the script and either give the answer or show an error:

Hope that helps restore your faith in Acrobat / LC Designer.

Niall

Avatar

Former Community Member

Sorry to say I am back.

This morning I opened the Acrobat certificate and it displayed NOT today's date, but yesterday's date. I've checked; my system date is correct, so it appears unlikely that it's pulling the wrong date from the system.

It seems that we created a field that gets the date the first time it is opens and keeps using that same date whenever it is opened again.

BTW I just reopened the little AcroForm you sent and it does the same thing. When I open it, it displays 5-Jan-2010, which is the date I first opened it.

Is it perhaps, reading the document from cache? (Does Acrobat do that? What cache? Where?) If it does,  how do I force it to reload a fresh copy?

How could anything this simple turn out to be this complicated?

JP

Avatar

Level 10

Sorry JP.

I would have expected the calculate script to work. Clearly I was wrong; sorry for misleading you.

I have removed the script from the calculate tab of the field, so that there is no script in the currentDate at all.

Instead I have created a document level script, which is accessible via Advanced / Document Processing / Document Javascripts. The script is exactly the same, but now fires each time the PDF is opened in Acrobat.

This is what you were after from day 1.

I have tested by changing the system date and it now (at last) appears to be working OK.

Niall

Avatar

Former Community Member

It works, it works!!

Wow! I did not expect custom programming, but thank you VERY much.

This time, no matter what, I'm done hassling you.

Thanks again, JP