How to add a image in the DocSign example

Hi,
I am struggling to add a image to the DocSign example instead of text. If somebody could give me a few hints it would be much appretiated.
I am currently modifying the CreateN2XObject function.
My situation is as follows:
I am drawing a image using the wxWidget library. From this a save the raw pixel data to a file. The pixel data is an array of unsigned chars where the first RGB triplet corresponds to the pixel first pixel of the first row, the second one to the second pixel of the first row and so on until the end of the first row; and so on...
In the CreateN2XObject I create an ASStm to read this file.
I create an attribute dictionary for this image
And then a new cos stream from the ASStm and dictionary
When I return from the function the plugin says that it is successfully signed, but I see nothing on the screen.
When I open the 'signed' document in a text editor I see:
<</Subtype/Form/Length 16038/Name/PROS/BitsPerComponent 8/Matrix[1.00011 0.0 0.0 1.00011 0.0000305176 0.0000305176]/ColorSpace/DeviceRGB/Width 54/Height 99/Type/XObject/BBox[0 76 238 0]/FormType 1>>stream
the data in the file
endstream
Below is the code I use to make the image i.e. CreateN2XObject:
     DSAPXObjEntryRec signRec;
     memset(&signRec, 0, sizeof(DSAPXObjEntryRec));
     signRec.rect = *pBBoxRec;
     signRec.bDestroy = true;
     AVDevRect rcDev = { (int)ASFixedToFloat(pBBoxRec->left), (int)ASFixedToFloat(pBBoxRec->top), (int)ASFixedToFloat(pBBoxRec->right), (int)ASFixedToFloat(pBBoxRec->bottom) };
     const char* baseDirectory = "C:/temp/data";
     ASPathName exampleFilePathName = ASPathFromPlatformPath ((char*)baseDirectory);
     ASFile theFile;
     ASInt32 retVal = ASFileSysOpenFile(NULL,exampleFilePathName, ASFILE_READ, &theFile);
     int len = 16038;
     ASStm inStm = ASFileStmRdOpen(theFile,len);
     char tmpsize[255];
     sprintf(tmpsize,"%d",len);
     AVAlertNote("tmpsize");
     AVAlertNote(tmpsize);
     //sprintf_s(buf, 125, "1 0 0 RG %i %i m %i %i l S", rcDev.left, rcDev.top, rcDev.right, rcDev.bottom);
     //ASArraySize len = strlen(buf);
     //int len = 19758;
     //ASStm inStm = ASMemStmRdOpen(buf, len);
     CosObj attrDict = CosNewDict(cosDoc, false, 1);
     CosDictPutKeyString(attrDict, "Type", CosNewNameFromString(cosDoc, false, "XObject"));
     CosDictPutKeyString(attrDict, "Subtype", CosNewNameFromString(cosDoc, false, "Image"));
     CosDictPutKeyString(attrDict, "Width", CosNewInteger(cosDoc, false, 54));
     CosDictPutKeyString(attrDict, "Height", CosNewInteger(cosDoc, false, 99));
     CosDictPutKeyString(attrDict, "ColorSpace", CosNewNameFromString(cosDoc, false, "DeviceRGB"));
     CosDictPutKeyString(attrDict, "BitsPerComponent", CosNewInteger(cosDoc, false, 8));
     CosDictPutKeyString(attrDict, "Name", CosNewNameFromString(cosDoc, false, "PROS"));
     CosDictPutKeyString(attrDict, "Length", CosNewInteger(cosDoc, false, len));
     CosObj cBBoxObj = CosNewArray(cosDoc, false, 4);
     CosArrayInsert(cBBoxObj, 0, CosNewInteger(cosDoc, false, rcDev.left));
     CosArrayInsert(cBBoxObj, 1, CosNewInteger(cosDoc, false, rcDev.top));
     CosArrayInsert(cBBoxObj, 2, CosNewInteger(cosDoc, false, rcDev.right));
     CosArrayInsert(cBBoxObj, 3, CosNewInteger(cosDoc, false, rcDev.bottom));
     CosDictPutKeyString(attrDict, "BBox", cBBoxObj);
     AVAlertNote("Creating cos stream");
     CosObj cStmObj = CosNewStream(cosDoc, true, inStm, 0, true, attrDict, CosNewNull(), len);
     AVAlertNote("Finished creating cos stream");
     ASStmClose(inStm);
     signRec.xobj = cStmObj;
     AFPDWidgetBorderRec border;
     AFPDWidgetGetBorder(PDAnnotFromCosObj(sigAnnot), &border);
     AVAlertNote("Returning DigSigAPXObjectFromXObjList");
     return DigSigAPXObjectFromXObjList(cosDoc, pBBoxRec, &signRec, 0, 0, &border, kDSMerge);
Regards,
Magda

Thanks!
So, even though I am spesifically telling it to create an Image type with CosDictPutKeyString(attrDict, "Subtype", CosNewNameFromString(cosDoc, false, "Image"));
I must still create a Form object around it?

Similar Messages

  • How to add an image for the new form?

    I created a new form,and I want to add an [image] to the toolbar in the new form.How to add [image] for a form?
    Like:
    [image] File Edit Tool Help
    My Form
    Thanks in advance!

    Thank you!
    Maybe the message I sent yesterday have some mistakes.
    Form version 12.0.5.1
    I want it this way:
    How to add [image]?
    [image] Manager Maintenance
    Browser Open Save Help
    -- My Form --
    -----------------------------------------------------------------------------

  • How to add an Image in the Tab strip of a Tab

    Hi,
    I am trying to add an image to the Tabstrip of a Tab UI element. I have declared a context variable of type string and also added the gif file into the \src\mimes\Components\ folder.
    How can I assign the context variable to point to this Image? I am not sure how to go about binding the Image.Source property of the context. Will be of great help if someone can throw more light in this area.
    Thanks for all your help in advance.
    Best regards,
    Divya

    Hi Divya,
    you could do for example in the wdDoInit() of the view
    wdContext.currentContextElement().setPicture("picture.gif");
    Now you assign this context variable to the Tab using the Tab_header's imageSource-Property. When you click on its value column, you see a button with three dots on it. If you click on this button, you will get all context nodes and attributes for this View. Usable variables are clearly marked, you now choose the one named Picture or what ever name you prefer to use. But it must correspond to the one set in the wdDoInit.
    I think setting a picture (not necessarily for the tab-page) is done in one of the excellent tutorials. If you are a newcomer I strongly recommend doing some of the tutorials.  I have learned tremendously from them.
    Hope this helped
    Harald

  • How to add an image in the header? Pages 5.0

    I don't believe I have to use Microsoft Word! I can't, no way, add an image in the header. This is unbelievable!
    **** time I updated to Mavericks!
    Please, does anyone know the solution?
    I'm losing a great deal in my company.

    Do you still have Pages 4.3 installed. If so, use that.

  • How to add an image to the JPanel

    i have been searching for many to add in an iamge to the JPanel...but with error..can anyone kndly help?
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class adv extends JPanel {
    ImageIcon pic = new ImageIcon("home.gif");
    public void paintComponent(Graphics g) {
    g.drawImage(pic,0,0,this);
    super.paintComponent(g);
    public static void main(String[] args) {
    adv mpg= new adv();
    mpg.setLayout(new GridLayout(5,1,15,15));
         JFrame window = new JFrame ("dv");
    window.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);     
    window.add(mpg);
    window.setVisible(true);
    window.setSize (550,225);
    }

    i have try out the suggestion that u have provided...still with error...wat can i do to solve it? any other way?
    below is how i add to my program...
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class adv extends JPanel {
        ImageIcon pic = createImageIcon("home.gif");
        public void paintComponent(Graphics g) {
      super.paintComponent(g);
    g.drawImage(pic.getImage(),0,0,this);
        public static void main(String[] args) {
           /*adv mpg= new adv();
          mpg.setLayout(new GridLayout(5,1,15,15));
             JFrame window = new JFrame ("dv");
             window.setLayout(new BorderLayout());
             frame.add(mpg, BorderLayout.CENTER);
           window.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);     
           window.add(mpg);
           window.setVisible(true);
           window.setSize (550,225);*/
           adv mpg = new adv();
           JFrame frame = new JFrame();
         frame.setLayout(new BorderLayout());
         frame.add(pic, BorderLayout.CENTER);
         frame.setSize(500, 500);
         frame.setVisible(true);
    }

  • How to add round image inside the table column? with different background color, column value should appear in the middle of the round portion.

    Hi
    This question is related to table component implementation.
    I want to display the column values inside the small round image with different colors and value should appear in the middle.

    Hi,
    >>1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    3.how to make my column headers in bold?<<
    I’m sorry for the issue that you are hitting now.
    This itextsharp is third party control, for this issue, I recommended to consult the control provider directly, I think they can give more precise troubleshooting.
    http://sourceforge.net/projects/itextsharp/
    Thanks for your understanding.
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to add new images to the list of old images to ipod using itunes

    I have around 1000 images in my ipod right now. I want to add some more images tinto it. I just have the latest phots in a folder in my PC. When i try to sysnchronize my ipod with a folder to add the new phots i am getting a warning message stating "All my photos will be replaced with the new folder". But the problem is i don't have my older photos in my folder.
    Will my older photos be deleted when i sysnchronize with a new folder?
    How can i add my latest phos alone?
    Can somebody help and answer my questions?

    Somebody please help me

  • How to add an image at the end of a video?

    I tried following these instructions https://pantherfile.uwm.edu/type/www/116/SoftwareTutorials/QuickTimePro/DougProu ty_QTPro_Tutorial/QuickTimePro_DougProuty.pdf
    But can't find where to choose the frame rate. So when I add it to my video it goes away so quick you can't even read it.
    Can anyone please help me with this.
    Thank you.

    Those instructions are very old and not intended for a single image.
    In your case you need to give your still image some "time" (duration). Easy to do with QuickTime Player Pro.
    Open any audio file in QuickTime, make a selection (in and out points) that matches the duration you wish for the image file. Let's say an mp3 with a ten second selection. Leave this window open.
    Open your image file in QuickTime. Select All (Edit menu) and Copy. Close this window.
    Switch to your audio file selection. From the Edit menu choose Add to Selection & Scale. You'll see the window expand in dimensions as your image is added.
    Open the Movie Properties window (Windows menu). You'll notice it now has a "Video" track.
    Single click on the Video track and then click the "Extract" button (upper left of the window). The ten second video track will open in a new Player window.
    Close the audio file window without saving.
    Do a "Save As" on the image video track. Give this new .mov file a name and location. Leave the window open.
    Select All and copy the ten second video track. Switch to the movie file you want to add it to and move the playhead to the end. From the Edit menu "Paste" the ten second video. It will be added to the end of the movie.
    Save As (self contained) and name the new video.

  • How to add a image at the top of every pages of a pdf document

    Hi all,
    My problem is as follows. I have a .pdf document and I'm copying it to another and then I'm appending some new things to it. Now while adding new pdf contents I want an image to be added for every new pages added to the document. I tried using "document.getPageNumber()" here document is a Document object which is a part of "itext-1.3.1.jar". But "document.getPageNumber()" is returning 0 every time.
    If anyone has the solution please help me out.
    Regards,
    turja

    there is no cursor to be set, as you go adding
    something in the pdf document those get added to that
    document and if one page gets filled it adds new page
    to it.If it says "current" page, then this implies that something is current with regards to something else. I'd like to know what "something else" is.

  • How to add Custom Image for the Workset Map Pictogram property

    Hello Everybody,
                     Can anyone suggest where should i put a custom image so that i can select it in the Workset Map Pictogram Property of an Iview. I have already uploaded a gif image in root->etc->public->mimes->images->pictograms in KM but still i am not able to see the uploaded image in Iview property. Looking forward for a quick solution.
    Thanks in advance,
    Regards,
    Sarabjeet Singh.

    Hello Nicolas,
    just stumbled accross the topic. Well, if the portal service is
    ".../j2ee/cluster/server0/apps/sap. com/irj/servlet_jsp/irj/root/portalapps/com.sap.portal.navigation.mimeservice" as discussed above.
    I have found the .gifs inside this par file of my NW7.0 Portal:
    \j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\deployment\pcd\com.sap.portal.navigation.mimeservice.par.bak
    Hope this is still interesting for someone.
    Regs
    Ulf

  • How to add an image in multiple pages?

    Hi,
    First be aware that before posting this, I digged into Google but could not find a solution.
    How to add an image in the footer section of a PDF document of size, say, 500pages? I am not going to add it one by one in very page, it's too time consuming.
    Is there a way to add it in the footer section or any other alternative, so that I end up with the same image in an exact position in all 500 pages?
    Thanks for your reply
    Best,
    Eric

    Answer:
    Answer: http://forums.adobe.com/message/3437269#3437269

  • How to add multiple images in jinternalframe

    Hi all,
    how to add multiple images to the jinternalframe, at specified location of the pane and resizing the images with specified height and width.
    code examples are highly appreciated.
    Thanks & Regards,
    Abel

    Thanks, it works perfectly. It's a really smart way of fixing the problem too :)
    I also found your toggle button icon classes which is something I've also had a problem with.
    Thanks.

  • How do you add an image in the signature

    Hi,
    How do you add an image to the signature area.
    The Insert/edit image is not available when in My Settings | Personnel Info | Signature
    Regards
    Ray Farmer

    You need to link the image.  See the example for the Canada flag below.
    <img src="http://forums.ni.com/ni/attachments/ni/130/6908/1/Canada-small.PNG" border=0>
    Replace with the image you like.  This goes into the signature box within the profile tab of the personal settings.
    RayR

  • How do I add an image above the navigation bar?

    I'm trying to add an image above the navigation bar and can't seem to do it without covering the links. Does anyone know how to do that?
    Thanks!

    Hi,
    select the page you want to add the image to
    open up the Inspector and go to the Page Tab (second from left)
    Choose Layout and increase the size of Header Height
    Regards,
    Cédric

  • How add a image in the banner portlet like 'my links' in favourite portlet

    How can I add a image in the banner of a portlet, like the 'my links' image in the Favourite Portlet?
    Thanks in advance

    hi,
    The image mylinks is not rendered by the portlet. It is a part of the page. You can always do a similar thing like rendering the image in the same page before the portlet.
    Thanks,
    Sriram

Maybe you are looking for

  • Bpm block deadline branch not triggering

    For some reason, in one of my environment, the bpm block step's deadline branch doesn't get triggered. I couldn't figure it out. I setup a 1 minute limit and it never calls the deadline branch. Same thing works in my dev environment. please help.

  • Graph in a webreport

    Hi, I want to create a graph in webreport with only one Char in Y Axis and one KF in X Axis. How do we do that? When I try to create a graph with columns, all the KFs are being shown. Also, I have a date field in the cube which should be shown as onl

  • Ironport Email - VRF(Routers) ou Context(ASA) equivalent

    We have 5 costumers that filter their e-mails in our IronPort. Everything is OK, Ironport and senderbase are beautiful! But we are having some problems with bandwidth control. Today the MX of their domain is the same ip address of IronPort, and we ar

  • Form completion in reader

    I have recently started using Adobe Pro 9, and want to use the function for completion in Reader across my organisation, and submission in pdf rather than xml, but not there are varying Reader versions in use. What version is the earliest that this w

  • Opening Elements 12 problem

    I am running Windows 7. When I tried to access Photoshop Elements12 it looked as though it was starting to open, the icon was going round but then nothing. The same happened with Premiere Elements 12where it opened as far as the opening page but agai