How to create Button Icon from PNG?

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default How to create Button Icon from PNG?

    I don't know whether if Acrobat / Reader support using PNG as button icon.

    If it can how to create the icon form PNG?

    Thanks.
    NoSmoking@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Icon on button:
      I wonder to attach a icon on a button. After created the icon, i still cannot see. May i know what is the mistake i may make? Thanks your concern....
    2. Placing icon in Button
      I'm creating an array with Buttons and give them a label plus icon. When i display the array I see the labels, but no icon! Can anybody tell me...
    3. How to get the button icon using the FDF toolkit?
      We know that we can take advantage of FDF to send graphical information in either direction between the client and the server. According to this, I...
    4. How to create large icon?
      Does anybody know how those large icon images that you see at the root of some CDs are created? I would like to create one for a OSX and OS 9...
    5. how to make button with a little image icon
      Hi, I am very new in the asp.net realm so this may be a very simple question for most of you. I want to put a little image icon in every button...
  3. #2

    Default Re: How to create Button Icon from PNG?

    If you look in the PDF Reference/ISO 32000-1, you will see that button icons are Form XObjects, which could include reference to an Image XObject, which could be derived from a PNG image.
    Leonard_Rosenthol@adobeforums.com Guest

  4. #3

    Default Re: How to create Button Icon from PNG?

    Leonard:
    My button means my TOOL button, not FORM button.

    I means that create an icon for my plugin's tool button.
    NoSmoking@adobeforums.com Guest

  5. #4

    Default Re: How to create Button Icon from PNG?

    Leonard:
    I convert the PNG to a pdf file and I use CosDocOpenWithParams to open the PDF file then using CosStreamOpenStm to get the image XObject.
    Next i set this XObject to my icon and load it.
    Is this way OK?

    thanks.
    NoSmoking@adobeforums.com Guest

  6. #5

    Default Re: How to create Button Icon from PNG?

    Sorry - misunderstood.

    For TOOL button, there is a sample in the Acrobat 9 SDK that shows how to use a PNG for your toolbar button.
    Leonard_Rosenthol@adobeforums.com Guest

  7. #6

    Default Re: How to create Button Icon from PNG?

    Thanks,Leonard
    I have just see the sample in the Acrobat 9 SDK.
    The sample use png tool button for MAC,not Windows.
    But i tried it under Windows XP & Acrobat 8,it's OK.

    The code show below:

    AVIconBundle6 createPNGIcon(const std::string& strName)
    {
    //strName is the png file path
    if(strName.empty())return NULL;

    AVIconDataRec iconData;
    iconData.dataStm = NULL;
    iconData.eColorFormat = kAVIconColor;

    ASFile asf = NULL;
    ASPathName aspn = ASFileSysCreatePathFromCString(NULL, strName.c_str());
    if(!aspn)return NULL;

    if(ASFileSysOpenFile(NULL, aspn, ASFILE_READ, &asf) != 0)
    return NULL;

    ASUns32 dataSize = ASFileGetEOF(asf);
    if(dataSize <= 0)return NULL;

    ASUns8 *data = (ASUns8 *)ASmalloc(dataSize + 1);
    ASFileRead(asf, (char *)data, dataSize);
    ASFileClose(asf);

    iconData.dataStm = ASMemStmRdOpen((char *)data, dataSize);
    if(!iconData.dataStm){
    ASfree(data);
    return NULL;
    }

    return AVAppCreateIconBundle6 (kAVIconPNG, &iconData, 1);
    }

    AVToolButton toolButton = AVToolButtonNew ("mytoolname", createPNGIcon("test.png"), false, false);
    NoSmoking@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139