How to insert an image in a pdf document

I used the "Stamper" example and modified the fuction to insert image to my pdf doc.
PDAnnot CreateStampAnnotationAt(AVPageView pageView, AVDevRect *rect)
to add a picture Annotation into page.
when system calling the callback function "AnnotDraw" to draw the Cos Object in that Annotation ,the function "AVPageViewDrawCosObj(pageView, coApp, &avdr)" doesn't work.Here is the code:
ASFixedRect pdLocation;
PDAnnot annot = {0,0};
CosObj cAnnotObj, cIntObj, cStmObj, attributesDict, LengthEntry, cNullObj;
CosObj cAPDictObj, cStmDictObj, cBBoxObj, cProcSetObj, cResObj;
CosObj fontResObj, fontResObj2, cObj;
CosDoc cdoc;
ASStm stm;
char buf[512];
PDPage pdPage;
ASUns32 s;
ASFile picFile = NULL;
DURING
        //handle clicks (with no drag, or only in one direction), by creating a default size annot
        if((rect->top == rect->bottom) || (rect->right == rect->left))
                rect->top +=75;
                rect->right += 150;
        pdPage = AVPageViewGetPage(pageView);
        AVDoc avDoc = AVPageViewGetAVDoc(pageView);
        AVPageViewDeviceRectToPage ( pageView, rect, &pdLocation);
        // Add the new annotation to the page.
        annot = PDPageAddNewAnnot(pdPage, -1, Stamper_K, &pdLocation);
        cAnnotObj = PDAnnotGetCosObj(annot);
        cdoc = PDDocGetCosDoc(PDPageGetDoc(pdPage));
        // See PDF Specification for more information on the Flags key.
        cIntObj = CosNewInteger (cdoc, false, 4L);
        CosDictPutKeyString(cAnnotObj, Flags_KStr, cIntObj);
        cAPDictObj = CosNewDict(cdoc, false, 1L);
        cNullObj = CosNewNull();
        ASFileSysOpenFile (ASGetDefaultFileSys (),ASPathFromPlatformPath("c:\\test.jpeg"), ASFILE_READ, &picFile);
        stm = ASFileStmRdOpen (picFile, 4096);
        attributesDict        = CosNewDict(cdoc, false, 5);
        LengthEntry = CosNewInteger(cdoc, false,11594 );
        CosDictPutKeyString(attributesDict, Length_KStr, LengthEntry);
        cStmObj = CosNewStream(cdoc, true, stm, 0, true, attributesDict, cNullObj, s);
        cStmDictObj = CosStreamDict(cStmObj);
        CosDictPutKeyString(cStmDictObj, "Type", CosNewNameFromString(cdoc, false, "XObject"));
        CosDictPutKeyString(cStmDictObj, "Subtype", CosNewNameFromString(cdoc, false, "Image"));
        CosDictPutKeyString(cStmDictObj, "Width", CosNewInteger(cdoc, false , 151));
        CosDictPutKeyString(cStmDictObj, "Height", CosNewInteger(cdoc, false , 151));
        CosDictPutKeyString(cStmDictObj, "ColorSpace", CosNewNameFromString(cdoc, false, "DeviceRGB"));
        CosDictPutKeyString(cStmDictObj, "BitsPerComponent", CosNewInteger(cdoc, false , 8));
        cBBoxObj = CosNewArray(cdoc, false, 4L);
        CosArrayInsert(cBBoxObj, 0L, CosNewInteger(cdoc, false, 0L));
        CosArrayInsert(cBBoxObj, 1L, CosNewInteger(cdoc, false, 0L));
        CosArrayInsert(cBBoxObj, 2L, CosNewInteger(cdoc, false, 100L));
        CosArrayInsert(cBBoxObj, 3L, CosNewInteger(cdoc, false, 100L));
        CosDictPutKeyString(cStmDictObj, "BBox", cBBoxObj);
        CosDictPut(cAPDictObj, FaceNormal_K, cStmObj);
        CosDictPutKeyString(cAnnotObj, Appearance_KStr, cAPDictObj);
HANDLER
        AVAlertNote(ASGetErrorString(ERRORCODE, buf, sizeof(buf)));
END_HANDLER
Please help.

BMP image?
Or Is it possible to insert any text instead of image?
But I need to work just like the stamper sample present in sdk. that is when i click on the pdf document any text has to be inserted instead of the image. I should not be to type the text in the pdf, but it should work exactly similiar to the stamper sample, but text has to be inserted instead of an image.
How can this be done? Is it possible to do?
Please help.

Similar Messages

  • How to insert page numbers in a PDF document?

    How to insert page numbers in a PDF document using Adobe Acrobat X Pro 10.1.2?
    Thanks.

    OK, I found it myself:
    1. Tools - Pages - Edit Page Design - Header & Footer - Add Header & Footer.
    2. Select the font and size, etc, place the cursor on the appropriate site to insert the page number, click the "Insert Page Number" button, and click OK.
    That is!

  • How can I insert and image in all PDFs printed via BW?

    How can I insert and image in all PDFs printed via BW?
    We want to remove the image from all Web Templates and insert it in the header of PDF printouts.
    <removed by moderator>!
    Tom
    Edited by: Siegfried Szameitat on Dec 3, 2008 2:57 PM

    Select clip in timeline. Open effects. At the bottom, search for flip. This should find the "Flipped" effect. Drag that effect cover the clip.

  • Can I insert the image file into PDF file  in Adobe X Standard ?

    can I insert the image file into PDF file in Adobe X Standard ?

    http://matt.coneybeare.me/how-to-make-an-html-signature-in-apple-mail-for-maveri cks-os-x-10-dot-9/

  • How to insert the image or logo into the table as a field in webdynpro abap

    Hi Friends,
    Please tell me how to insert the image or logo into the table as a field in webdynpro abap.........

    Hi Alagappan ,
          In your view layout you take table UI element and then you bind it with some context nodes.
    The attributes of your nodes comes as a field.
    Now in these fields you can set various properties and image is one of them.
    Go to ->
    1. View Layout -> Right Click on ROOTUIELEMENTCONTAINER -> INSERT ELEMENT -> TABLE
    2. Right click on table -> Create Binding.
       Here you have to bind it with the appropriate context node.
    You will get two properties here
    a- Standard Cell Editor :- ( make it image )
    b- Standard properties :- ( If required set image properties ).
    3. If you want put image from out side then import it as a mime object and set the source of your table field ( used as a image )
    also have a look :-
    [Image Properties|http://help.sap.com/saphelp_nw04/helpdata/en/f3/1a61a9dc7f2e4199458e964e76b4ba/content.htm]
    Hope this will solve your problem.
    Reply if any case of any issue.
    Thanks & Regards,
    Monishankar C

  • How to insert an image file in Oracle database

    hi
    can you please tell me how to insert an image file into oracle database????
    suppose there is one image file in c:\pictures\rose.jpg. how to insert that file into database? theoretically i know that will be BFILE type but i dont know how to insert that.
    will be waiting for your reply........
    thanks & regards,
    Priyatosh

    Hello,
    The easiest way to load a blob is to use SQL loader.
    This example comes from the utilities guide:
    LOAD DATA
    INFILE 'sample.dat'
    INTO TABLE person_table
    FIELDS TERMINATED BY ','
    (name CHAR(20),
    1 ext_fname FILLER CHAR(40),
    2 "RESUME" LOBFILE(ext_fname) TERMINATED BY EOF)
    Datafile (sample.dat)
    Johny Quest,jqresume.txt,
    Speed Racer,'/private/sracer/srresume.txt',
    Secondary Datafile (jqresume.txt)
    Johny Quest
    500 Oracle Parkway
    Secondary Datafile (srresume.txt)
    Loading LOBs
    10-18 Oracle Database Utilities
    Speed Racer
    400 Oracle Parkway
    regards,
    Ivo

  • How to insert a image file into oracle database

    hi all
    can anyone guide me how to insert a image file into oracle database now
    i have created table using
    create table imagestore(image blob);
    but when inserting i totally lost don't know what to do how to write query to insert image file

    Hi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
    Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
    out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
    out.println("   <input type='submit' name='submit' value='Submit' class='smalltext'>");
    out.println("</form>"); Import this once you have the jar file:
    import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
    private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
            boolean result = true;
            String fileName = null;
            byte fileData[] = null;
            String fileUploadError = null;
            String imageType = "";
            String error = "";
            DiskFileUpload fb = new DiskFileUpload();
            List fileItems = fb.parseRequest(request);
            Iterator it = fileItems.iterator();
            while(it.hasNext()){
                FileItem fileItem = (FileItem)it.next();
                if (!fileItem.isFormField()) {
                    fileName = fileItem.getName();
                    fileData = fileItem.get();
                    // Get the imageType from the filename extension
                    if (fileName != null) {
                        int dotPos = fileName.indexOf('.');
                        if (dotPos >= 0 && dotPos != fileName.length()-1) {
                            imageType = fileName.substring(dotPos+1).toLowerCase();
                            if (imageType.equals("jpg")) {
                                imageType = "jpeg";
            String filePath = request.getParameter("FILE_PATH");
            session.setAttribute("filePath", filePath);
            session.setAttribute("fileData", fileData);
            session.setAttribute("fileName", fileName);
            session.setAttribute("imageType", imageType);
            return result;  
         } And now finally the method to actually write the file to the database:
    private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
            //If the previous code found a file that can be uploaded then
            //save it into the database via a pstmt
            String sql = "";
            UtilDBquery udbq = getUser(request).connectToDatabase();
            Connection con = null;
            int signatureID = 0;
            PreparedStatement pstmt = null;
            try {
                udbq.setUsePreparedStatements(true);
                con = udbq.getPooledConnection();
                con.setAutoCommit(false);
                if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
                    sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
                    pstmt = con.prepareStatement(sql);
                    ResultSet rs = pstmt.executeQuery();
                    while(rs.next()) {
                       signatureID = rs.getInt(1);
                    if (fileName != null && imageType != null) {
                        sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setInt(1, signatureID);
                        pstmt.setBinaryStream(2, is2, (int)(fileData.length));
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
                if(mode.equals("U") && signatureIDIn != 0) {
                    signatureID = signatureIDIn.intValue();
                    if (fileName != null && imageType != null) {
                        sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setBinaryStream(1, is2, (int)(fileData.length));
                        pstmt.setInt(2, signatureID);
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
            } catch (Exception e) {
                con = null;
                throw new Exception(e.toString());
            return signatureID;
       }

  • How to insert multiple images

    How to insert multiple images in SQL/MySQL using servelet

    donsankar wrote:
    How to insert multiple images in SQL/MySQL using serveletuse a BLOB
    are you sure you need to store images in the database?
    why not store the image on the file system and store a link to the image file in the database
    you really don't gain much putting images in the database

  • How to insert an image and an icon in a JFrame !

    i am seeking for th efollowing :
    1/- how to insert an image in a Jframe ? i triied to use a label and set labelk icon with the specefic path but i can not see it neither in the jbuilder6 brower nor in the execution of the application ! how to deal with that please!
    2/- how to insert an icon to my window sothat it does not display the jbuilder 6's default icon
    ant help wil be really apreciated! thanks

    In JBuilder, create a new file called Frame1 then copy this code into it. It should give you a frame which will have a different icon in the frame title and an image in its pane.
    Change the name of the icon it uses to any gif file that you have on your pc.
    // START OF FILE
    import java.awt.*;
    import javax.swing.*;
    public class Frame1 extends JFrame {
         JLabel jLabel1 = new JLabel();
         public Frame1() {
              try {
                   jbInit();
              catch(Exception e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              Frame1 frame1 = new Frame1();
              frame1.pack();
              frame1.show();
         private void jbInit() throws Exception {
              ImageIcon myImage = new ImageIcon("c:/data.gif");
              this.setIconImage(myImage.getImage());
              jLabel1.setText("jLabel1");
              jLabel1.setIcon(myImage);
              this.getContentPane().add(jLabel1, BorderLayout.CENTER);
    //END OF FILE

  • Insert an image into a pdf in preview

    Hi All,
    I would like to know hoe to insert an image into a pdf in preview.
    Thank you in advance for any opinion !

    The only way I know to do that would be with Adobe Acrobat which is rather expensive.  Or, you can try the roundabout method:
    1- open the pdf in Preview and begin a Print Process.
    2 - do a Print ➙ PDF ➙ Save PDF to iPhoto
    NOTE: works with anything you can print.  Creates a 200 dpi jpeg image of each page and saves it to iPhoto.
    3 - use a 3rd party image editor or Pages from iWork to add the transparent background gif or png logo to the image of the page.
    4 - to get it back to a pdf do a Print ➙ Save as PDF. 
    If you don't have the Save PDF to iPhoto in the PDF menu you can download it from  Toad's Cellar.  There are two versions, one 200 dpi and one 300 dpi.

  • How to insert an image into mysql

    welcome to all,
    can any one tell how to insert an image into mysql database(BLOB). it is urgent.
    regards

    welcome to all,
    can any one tell how to insert an image into mysql database(BLOB). it is urgent.
    regards

  • How to insert an image between two pages?

    How to insert an image between two pages? and how do remove the line of separation between two pages?.
    Attached image shows, there is a photo of two pages and no line of separation in the pages!

    Michi Thanks, but that option is only available on one page (2 columns), not to put two pages! see new image

  • Adobe 3D PDF - inserting 2 images in 1 PDF

    Hi
    I was hoping someone could help.
    I have inserted two 3D images into a PDF each with their own toolbar which allows each image to be rotated,zoomed by its respective toolbar.
    However, the problem is that the second image toolbar doesnt control the second image as it should do, but instead carries on controlling the first image. Hence my question is that is it possible to insert two images into a PDF so that they can be controlled separately?
    Any help would be greatly appreciated. Thanks!

    Thanks SWS for that suggestion but Ive already tried this and unfortunately it did not work. Basically I am importing a VRML file into Strata and then exporting it into a 3D PDF.
    I reckon its an issue to do with the scripting - somehow I need to change the script so that the toolbar works for the image on each different page instead of just working for the image on the first page. Ive included a copy of the toolbar script below.
    TOOLBAR_ALIGNMENT='center' // Valid values are 'center', 'left' or 'right'
    TOOLBAR_BUTTON=['ResetButton','MeasureButton','MoveButton','TurnButton','ZoomOutButton','Z oomInButton'] // Buttons names must not be changed
    TOOLBAR_BUTTON_ACTION=new Array()
    TOOLBAR_BUTTON_ACTION['MeasureButton']=""
    TOOLBAR_BUTTON_ACTION['MoveButton']="this.doc.getAnnots3D(%1)[ 0 ].context3D.setCurrentTool('Pan')"
    TOOLBAR_BUTTON_ACTION['ResetButton']="this.doc.getAnnots3D(%1)[ 0 ].context3D.resetUnconditionally()"
    TOOLBAR_BUTTON_ACTION['TurnButton']="this.doc.getAnnots3D(%1)[ 0 ].context3D.setCurrentTool('Rotate')"
    TOOLBAR_BUTTON_ACTION['ZoomInButton']="this.doc.getAnnots3D(%1)[ 0 ].context3D.zoomIn()"
    TOOLBAR_BUTTON_ACTION['ZoomOutButton']="this.doc.getAnnots3D(%1)[ 0 ].context3D.zoomOut()"

  • How do I hide the file names/path names of embedded images in a PDF document?

    I created a PDF document from a Word document, and the problem is that the PDF document shows the file names and path names for all of the embedded images in the PDF document. I don't want that information displayed. I don't want to send the PDF out to clients and have them read the names I've assigned to those images, plus it looks messy. And I've lost many of the original image files so they only exist in the Word document, thus I can't go back and rename them. I searched the internet for an answer but I couldn't find one anywhere.

    When you create a tagged (accessible) PDF file from Word, placed bitmap images will use their filename as the "ALT text" if you don't define something else for the text to say, because an image without any ALT text is a failure against the accessibility standards. You can't change that default action, so you should put your own meaningful text into the ALT field for each image - which is what you should be doing anyway if the PDF is standards-compliant.
    You can can set the text in Word, but it depends on your version as to where the dialogs are - Google for it - or you can change/delete it in Acrobat using the tags navigation pane on the left side of the window (right-click the sidebar if it's not visible). Drill down through the tags structure to find the "<Figure>" tag you want to change, right-click and choose Properties, then put something in the "Alternative text" field. This process isn't something you can easily automate, but if you don't need tags at all, you can save without tags (or print to PDF).

  • How do I merge more than one PDF document into one singular pdf using adobe viewer touch on a microsoft surface?

    How do I merge more than one PDF document into one singular pdf using adobe viewer touch on a microsoft surface?

    Or using the Adobe PDF Pack https://www.acrobat.com/

Maybe you are looking for

  • File to Mail error

    Hi,   I am doing file to mail scenario. I got an error "failed to send mail: java.io.IOException: invalid content type for SOAP: TEXT/HTML"..    How to solve. regards, Ansar.

  • How to Physically move my windows hard drive to my mac pro

    Is there any way to physically move my windows 7 harddrive to my mac pro and have it boot under bootcamp?

  • Problème de mise à jour IOS

    Bonjour, la mise à jour pour IOS n'apparaît pas dans les menus règlages.... comment faire ?

  • Unable to download any documents, including Adobe updates

    all email attachments will not download. User Accout control wants to delete all Adobe progams. Repeated message "Flash Player Update Service 11.6 r602 stooped working and was closed" keeps popping up. What do I do please!!??

  • Bizarre iTunes (podcast) behavior

    I'm getting some unwanted behavior trying to get the podcasts I want onto my iPod. Under the ipod options I have "Sync 5 most recent episodes of selected podcasts" checked, along with the ones I want copied to my iPod. In the Summary options, I have