Skip navigation
jayshakir
Currently Being Moderated

How to move a picture in a pdf?

Apr 27, 2012 2:31 PM

Tags: #a #button #picture #move #or #hide #setbuttonicon

I want to move a picture in a pdf in 3 possible specific locations.

 

I tried these:-

1) created a picture, by creating a button and setting an image button on it, but then i did not find commands to move the button

So if you could give me commands to move a button, that will be great.

 

I tried something else.

 

2) i put the button in all the locations but removed the icon from it, so it looks empty.

at run time i apply the image name on one of the 3 buttons, thus it looked like the button moves from one of the three locations to the other.

eg:-

button1.image="";

button2.image="img.jpg";

button3.image="";

 

thus it looks like the iamge moved from location 1 or 3 to 2.

 

i tried using this command to dynamically set the image of an icon which initially has no image, but it does not work

 

IAFormApp formApp;

IFields myFields = (IFields)formApp.Fields;

IEnumerator myEnumerator = myFields.GetEnumerator();

 

while (myEnumerator.MoveNext())

{

    myField = (IField)myEnumerator.Current;

    if (myField.Name=="btnPage4L")

            myField.SetButtonIcon("",@"C:\ACK-SDK\colorrisk.jpg",4);

}

 

There is no documentation at all on the SetButtonIcon, not in the SDK and not on the internet.

 
Replies
  • Currently Being Moderated
    Apr 28, 2012 7:05 AM   in reply to jayshakir

    Set the rectangle (rect) of the field.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2012 3:59 AM   in reply to jayshakir

    Offhand, I don’t know if there is an example or not in the SDK.

     

    But just read the SDK documentation – this is pretty simple.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 15, 2012 12:23 PM   in reply to jayshakir

    setButtonIcon() is the right JS method.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 19, 2012 6:45 AM   in reply to jayshakir

    In the Plugin API, all API calls start with the two or three letters for their layer (AV, PD, Cos etc.)   Since SetButtonIcon doesn’t have one, I can safely infer that it is NOT a plugin API call.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 19, 2012 7:30 AM   in reply to jayshakir

    The Javascript method is "buttonSetIcon". It is documented in the Javascript API Reference (part of the Acrobat SDK).

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 19, 2012 8:56 AM   in reply to jayshakir

    OK – that’s the COM/.NET APIs.

     

    For that API, you can only specify a PDF file for the icon of a button. I believe that is mentioned in the documentation.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 19, 2012 9:19 AM   in reply to jayshakir

    I have never seen SetButtonIcon.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 19, 2012 9:31 AM   in reply to jayshakir

    Based on the code that you've posted, and your question, it sounds like

    you've never read the documentation. The Acrobat API is not "discoverable",

    you need to read the documentation that comes with it. Take a look at this

    page -

    http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/IAC_API_Fo rmsIntro.107.11.html

    - it describes the SetButtonIcon function and it lists what the three

    parameters are supposed to be. In your sample code, you are passing in an

    empty string as the first parameter. That may work (I don't know if it

    does), but even if it does, that would be undocumented behavior. You need

    to supply one of the codes listed in the documentation. Also, the last

    parameter is the page number that is retrieved from the PDF file to be used

    as your button image. Even if you could use a JPEG file, the value "4"

    would definitely be wrong.

     

    So please read the documentation that comes with the API, it will save you

    a lot of time and frustration.

     

    Karl Heinz Kremer

    PDF Acrobatics Without a Net

     

    khk@khk.net

    http://www.khkonsulting.com

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points