How to insert Text physically to xml in xml Element

hello friends,
I am newb of jDom. i am trying to change xml "Element's"--->"Text". My xml is as follows .....
<?xml version ="1.0">
<Elements>
         <code>
                   <data>EE550</data>
         </code>
</Elements> I am trying to replace that "<data>" by <data>AA550</data>
my code is as below
             SAXBuilder sb = new SAXBuilder();
             Document doc = sb.build(new File("src/xml/M90EE.xml"));
             Element element = doc.getRootElement();
             List children = element.getChildren();
             String key = (element.getChild("text").getChild("mkey").setText("AA550").getTextTrim());   System.out.println("mkey       :"+key);
output:
mkey   :AA550 but is it possible to change in the xml file phisically.
thanQ
Ajay

hello Reegz,
ThanQ so much for perfect solution....
when i do like that it is actually adding text to the existing Element Text.. so i wrote as follows....
SAXBuilder sb = new SAXBuilder();
Document doc = sb.build(new File("src/xml/M90EE.xml"));
*String skey = (element.getChild("text").getChild("mkey").removeContent().toString());*     //--------->step 1
*String skey1 = (element.getChild("text").getChild("mkey").addContent("ISO9001").toString());* //-------->step 2     
String rdmkey = (element.getChild("text").getChild("mkey").getTextTrim());
XMLOutputter serializer = new XMLOutputter();
String str = serializer.outputString(doc);
FileWriter fr = new FileWriter("src/xml/M90EE.xml");
fr.write(str);
fr.flush();
fr.close();Is there any other way to replace text in step1 and step2 other than above or will it be enough for multiuser programming. Because this application will be accessed by so many number of user's what do u sujjest.
thanQ ...
Han.

Similar Messages

  • How to insert brackets into an XML element value?

    If I have a <file> </file> element in an XML file and I want to insert a filename of the form PED<yyMMdd>232, how do I insert the < and > brackets as an element value inside the <file> tag?
    I use JCreator to edit the xml file and it treats <yyMMdd> as a seperate element instead of being part of the filename.
    Edited by: Weng on Mar 27, 2008 10:06 AM

    You have to escape those characters, like this:
    PED&lt;yyMMdd&gt;232

  • How to insert the data from XML to a table

    Hi,
    I'm using Oracle 10g Express Edition
    I need help in How to insert the data from XML file into the table.
    Below is the example i'm working on..
    I have create ridb user with below mentioned privileges:
    Account Status Locked Unlocked
    Default Tablespace: USERS
    Temporary Tablespace: TEMP
    User Privileges :
    Roles:
    CONNECT
    RESOURCE
    Direct Grant System Privileges:
    CREATE DATABASE LINK
    CREATE MATERIALIZED VIEW
    CREATE PROCEDURE
    CREATE PUBLIC SYNONYM
    CREATE ROLE
    CREATE SEQUENCE
    CREATE SYNONYM
    CREATE TABLE
    CREATE TRIGGER
    CREATE TYPE
    CREATE VIEW
    & table is created TRIALZIPCODES below mentioned is the DDL:
    CREATE TABLE TRIALZIPCODES
    STATE_ABBR VARCHAR2(20) NOT NULL
    , ZIP_CODE NUMBER(10, 0) NOT NULL
    , ZIP_CODE_EXT VARCHAR2(20)
    Below is the XML FILE: which is stored in C:\OracleProject Folder
    File name: trial.xml
    <?xml version="1.0" ?>
    <metadata>
    - <Zipcodes>
    - <mappings Record="4">
    <STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
    <ZIPCODE>94301</ZIPCODE>
    </mappings>
    - <mappings Record="5">
    <STATE_ABBREVIATION>CO</STATE_ABBREVIATION>
    <ZIPCODE>80323</ZIPCODE>
    <ZIP_CODE_EXTN>9277</ZIP_CODE_EXTN>
    </mappings>
    </Zipcodes>
    </metadata>
    PL/SQL Procedure:which i'm trying to execute from SQLDeveloper
    create or replace
    PROCEDURE TRIAL AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    begin
    -- DBMS_XMLGEN.setRowTag ( ctx IN ctxHandle, rowTag IN VARCHAR2);
    -- DBMS_XMLGEN.setRowSetTag ( ctx IN ctxHandle, rowSetTag IN VARCHAR2);
    -- the name of the table as specified in our DTD
    DBMS_XMLGEN.SETROWSETTAG(l_context_handle,'zipcodes');
    -- the name of the data set as specified in our DTD
    DBMS_xmlgen.setRowTag(l_context_handle,'mappings');
    -- for getting the output on the screen
    dbms_output.enable(1000000);
    -- open the XML document in read only mode
    v_FileHandle := utl_file.fopen('c:/OracleProject','trial.xml', 'r');
    loop
    BEGIN
    utl_file.get_line(v_FileHandle, charString);
    exception
    when no_data_found then
    utl_file.fclose(v_FileHandle);
    exit;
    END;
    dbms_output.put_line(charString);
    if finalStr is not null then
    finalStr := finalStr || charString;
    else
    finalStr := charString;
    end if;
    end loop;
    -- for inserting the XML data into the table
    insCtx := DBMS_XMLSTORE.NEWCONTEXT('RIDB.TRIALZIPCODES');
    insCtx := DBMS_XMLSTORE.INSERTXML(insCtx, finalStr);
    dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
    DBMS_XMLStore.closeContext(insCtx);
    END;
    END TRIAL;
    For the first time when i complied i got the errors as :
    Procedure RIDB.PROCEDURE1@RIDB
    Error(16,14): PLS-00201: identifier 'UTL_FILE' must be declared
    Error(16,14): PL/SQL: Item ignored
    Error(29,1): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    Error(29,1): PL/SQL: Statement ignored
    Error(33,1): PL/SQL: Statement ignored
    Error(33,19): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    Error(36,1): PL/SQL: Statement ignored
    Error(36,17): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    So i logged in as sys & grant the permission to execute on UTL_FILE to ridb (user):
    SQL Statement:
    grant execute on utl_file to ridb
    So, it got compiled successfully but when i execute it gives me error as:
    Source does not have a runnable target.
    What does this mean?
    So I browse through forum & i got to know that i need to initial the UTL_FILE_DIR ="C:/OracleProject" in init.ora
    So can i edit the init.ora with notepad.When i tried to do that it says permission denied
    In my system it shows the init.ora file in path C:\oraclexe\app\oracle\product\10.2.0\server\config\scripts
    but there is also other file initXETemp in the same path do i need to do the changes in it.
    I have tried even editing the SPFILE as mentioned below:
    C:\oraclexe\app\oracle\product\10.2.0\server\dbs\SPFILEEXE - I had edit this file using notepad & set the value of UTL_FILE_DIR ="C:/OracleProject". So next time when i restarted i'm unable to log on to the database.
    So i had reinstall the software again.
    Could you please let me know how to proceed..

    hi,
    I have created the directory from sys database
    CREATE or replace DIRECTORY XML_DIR2 AS 'C:\OracleProject';
    & grant read,write access to the user
    grant read,write on directory XML_DIR2 to RIDB;
    & i had change the tag name in the xml file as shown below:
    <?xml version = '1.0'?>
    <metadata>
    <Zipcodes>
    <mappings Record="4">
    <STABBRE>CA</STABBRE>
    <ZIPCODE>94301</ZIPCODE>
    </mappings>
    <mappings Record="5">
    <STABBRE>CO</STABBRE>
    <ZIPCODE>80323</ZIPCODE>
    <ZIPCODEEXT>9277</ZIPCODEEXT>
    </mappings>
    </Zipcodes>
    </metadata>
    TRIALZIPCODE table as shown below:
    CREATE TABLE "RIDB"."TRIALZIPCODE"
    (     "STABBRE" VARCHAR2(20 BYTE),
         "ZIPCODE" NUMBER(*,6) NOT NULL ENABLE,
         "ZIPCODEEXT" NUMBER
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    I have tried two methods as shown below:
    Procedure 1:
    create or replace
    PROCEDURE TRIAL_V2 AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    cnt NUMBER;
    xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
    --XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
    BEGIN
    insCtx := DBMS_XMLStore.newContext('DEV.TRIALZIPCODES');
    DBMS_XMLStore.setUpdateColumn(insCtx, 'STABBRE');
    DBMS_XMLStore.setUpdateColumn(insCtx, 'ZIPCODE');
    DBMS_XMLStore.setUpdatecolumn(insCtx, 'ZIPCODEEXT');
    DBMS_XMLStore.setRowTag(insCtx, 'mappings');
    cnt := DBMS_XMLStore.insertXML(insCtx, xmldoc);
    DBMS_XMLStore.closeContext(insCtx);
    END;
    Procedure 1 was compiled with out errors but when i execute i got the error as :
    Source does not have a runnable target.
    Procedure 2_
    CREATE OR REPLACE PROCEDURE TRIAL_V3 AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    cnt NUMBER;
    xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
    --XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
    BEGIN
    INSERT INTO trialzipcode (STABBRE, ZIPCODE, ZIPCODEEXT)
    SELECT extractvalue(x.column_value, 'mappings/STABBRE'),
    extractvalue(x.column_value, 'mappings/ZIPCODE'),
    extractvalue(x.column_value, 'mappings/ZIPCODEEXT')
    FROM TABLE(
    XMLSequence(
    EXTRACT(
    xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') ),
    'metadata/Zipcodes/mappings'
    ) x
    END;
    END TRIAL_V3;
    Procedure 2 was complied without errors but when i execute i got the error as:
    Connecting to the database RIDB.
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the file specified.
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at "RIDB.TRIAL_V3", line 12
    ORA-06512: at line 2
    Process exited.
    Disconnecting from the database RIDB.
    Could you please let me know how to proceed...

  • How to insert more than 32k xml data into oracle clob column

    how to insert more than 32k xml data into oracle clob column.
    xml data is coming from java front end
    if we cannot use clob than what are the different options available

    Are you facing any issue with my code?
    String lateral size error will come when you try to insert the full xml in string format.
    public static boolean writeCLOBData(String tableName, String id, String columnName, String strContents) throws DataAccessException{
      boolean isUpdated = true;
      Connection connection = null;
      try {
      connection = ConnectionManager.getConnection ();
      //connection.setAutoCommit ( false );
      PreparedStatement PREPARE_STATEMENT = null;
      String sqlQuery = "UPDATE " + tableName + " SET " + columnName + "  = ?  WHERE ID =" + id;
      PREPARE_STATEMENT = connection.prepareStatement ( sqlQuery );
      // converting string to reader stream
      Reader reader = new StringReader ( strContents );
      PREPARE_STATEMENT.setClob ( 1, reader );
      // return false after updating the clob data to DB
      isUpdated = PREPARE_STATEMENT.execute ();
      PREPARE_STATEMENT.close ();
      } catch ( SQLException e ) {
      e.printStackTrace ();
      finally{
      return isUpdated;
    Try this JAVA code.

  • How to insert text in existing file.?????

    how to insert text in existing file.?????
    my file contains simple text with numbers of lines having more then 10 MB size and it might be increase up to 100MB.
    i required to seek to spec. position and insert chunk of characters to file without overwriting existing one.
    I tried out with RandomAccessFile class Also.
    Pl. Suggest me way to insert String in existing file.
    Thanks ,
    Timir

    how to insert text in existing file.?????You can't "insert" text into an existing file. You can
    overwrite portions of an existing file or extend one by
    writing past the current end of file.
    If you want to insert text into a file you have to write
    out a new file.

  • How to insert text in the middle of an existing textfile using java

    Hi,
    How to insert text in the middle of an existing textfile using java i/o streams??

    Mickie wrote:
    I shudn't delete the file...Then you will have the old file and the new file - do you want that?
    and I have to insert text not only at a single place ....got to do at many places in the text file!!then extrapolate on the procedure outlined in reply #1 .

  • Help needed badly Insert text data from xml files into tables

    Hi all, I have asked to do insertion of text from a xml file into tables upon receiving using pro*c. i've done quite an amount of research on xml parser in c but there wasn't much information for mi to use for implementation...
    Guys don't mind helping me to clarify few doubts of mine...
    1. Where can i get the oracle xml parser libs? Is it included when i installed oracle 8i?
    2. Is there any tutorials or help files for xml parser libs where i can read up?
    I need the xml parser to recognise the tags, followed by recognising the text after the tags.
    eg. xml format
    <studentID> 0012 </studentID>
    <student> john </student>
    <studentID> 0013 </studentID>
    <student> mary </student>
    text willl be inserted into tables like this:
    studentID | student
    0012 | john
    0013 | mary
    by the way i'm using oracle 8i on HP-UX. Thanks in advance.

    I can answer one of of your questions at least
    1. Where can i get the oracle xml parser libs? Is it included when i installed oracle 8i?You need the XML XDK. You can use http://www.oracle.com/technology/tech/xml/xdkhome.html as your starting point. I believe the 9i version works for 8i.
    I have no pro*c experience so I can't offer any other suggestions regarding how to do this in pro*c.

  • How to map more than one xml element with some Paragraph in a Text Frame

    Hi friends,
    I am new in InDesign Java Scripting and I have to place or map, more than one xml elements of different parents, into one textbox. Is it possible through JavaScript? Can anyone help me in this because I have no idea how it should work and it urgently required.
    Thanks in Advance

    I had answered to you already in your first post: the short answer is that it's not possible on the same text box unless you assign a common ancestor of these two "parents" item. That's not a question of scripting, it's the way Indesign handle the XML with the layout. Import a xml in Indesign and drop tags to page item. What you can do manually is quite representative of what can be done through scripting.
    If you assign this anscestor to the text frame, you have to expect that all text child items will be displayed in the text frame (including the text of all the child of the two "parents" and all the other parents/childs that could be under the common ancestor). Having a XML that is designed for Indesign usage is pretty much inevitable if you are doing anything "serious".

  • How to find associated text frame with XML element?

    Hello experts, I am new to InDesign CS SDK and have a question.
    I am building an Extension to import an XML document into an InDesign template. As the content in XML can be unpredictable, in the Extension, I want to loop through all the XML elements and make sure it has associated text frames, and if it doesn't, I want to create a text frame and set the content to the text frame.
    I think I figured out how to create a new text frame in page and set the content in the frame, but I am having difficulty finding an associated text frame for an XML element.
    If anyone has a sample code finding a text frame for an XML element, I appriciate it. Or if anyone can tell me what document I need to look, it will be great too.
    Thanks,

    Here's a code snipet with null checks removed:
    UID MyClassName::GetFrameForXMLElement(IIDXMLElement* inXMLElement)
        InterfacePtr< ITextModel > textModel( Utils< IXMLUtils >()->QueryTextModel( inXMLElement ) );
        InterfacePtr< IFrameList > frameList( textModel->QueryFrameList() );
        UID aFrameUID = frameList->GetNthFrameUID( 0 );
        return aFrameUID;

  • How to insert text data into temp tables....

    Dear All,
    I have one notepad with three columns, first column is segment1, second column is segment2 & third column is price list....
    and there is no delimiter and exact spaces..(i.e, zizak fomat)
    Ex:-
    xx yy 00009999
    kk mmmm 00009333
    Data is available like above example...So, I need to insert this data into one table.(2LAKSHS OF RECORDS AVAILABLE IN THAT NOTEPAD)
    So, Any can one help me, how to insert this kind of text data into temparory table...
    Regards
    Krishna
    Edited by: user12070109 on May 29, 2010 9:48 PM
    Edited by: user12070109 on May 29, 2010 9:49 PM

    Hello,
    What manu suggested this can be done through oracle forms.
    If as i read your last post you are using that in database it will not work in db. Try to use the same process in oracle forms will work by making some changes.
    And if you don't want to use forms then there is one way using SQL LOADER. It required control file to execute for uploading data.
    See the below link.
    http://www.orafaq.com/wiki/SQL*Loader_FAQ
    In this example its showing filename.csv you can use your file name like yourfilename.txt.
    So your control file will look like this...
    load data
    infile 'file_path\file_name.txt'
    into table table_name  -- use actual table name where you want to upload data
    fields terminated by " "  -- Here using spaces as you mentioned           
    (column1, column2, column3)  -- Here use the three column names of tableAnd after creating control file with the above code. You can call it in command prompt like this
    sqlldr username/password control=control_file_path\control_file_name.ctl log=log_file_path\log_file_name.log
    or
    sqlldr username/password@dbconnection control=control_file_path\control_file_name.ctl log=log_file_path\log_file_name.log
    Before doing this practice make sure SQLLDR.exe availabe in the machine where you have to execute. Otherwise you will have to install db client for using sqlldr.exe
    -Ammad

  • Freeform to Text: How to insert Text into freeform

    How to edit text into freeform

    Hi FZRR,
    Could you share more information with us? Or you can upload the screenshot to OneDrive and share the picture link here.
    If you want to insert text into freeform shape, there are two methods:
    1. Insert a textbox on the freeform shape, edit text in the textbox.
    2. Select the freeform shape, and right-click > Add text.
    If there is anything I can do for you regarding this issue, feel free to post back.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How to insert text in the text-id using BDC

    Hi Friends,
    I m using the BAPI to upload the data for a transaction .
    In that transaction there are some text id's are created to insert text like 'Container number'.
    I want to insert the text in that text id . But it not a field. Text ids are having object no and table and number .
    Is there any function like 'READ_TEXT' which we use to retrieve the text form text ids to write text in text ids ?
    So that I can use that function to insert the text in the text ids.
    Thanxs.

    Hi Umesh,
    READ_TEXT is used to Read the text , but SAVE_TEXT is used to save the text. but for reading or saving you need correct iD's and text objects.
    Regards
    vijay

  • How to insert text in smartform boxes

    Hi Friends,
    This is regarding about smartform box.
    I have created one template. pls find below for complete template for your ref.
    Total template has 5 lines names like C1, C2, C3, C4, C5, C6 and C7.
    To fulfill client req, again I have devided First line "C1" and Second line "C2" into 5 boxes.
           Third line -- no boxes.
          Fourth line -- 3 boxes
          Fifth    line -- 3 boxes
          Sixth   line -- no boxes
          Seventh line -- no boxes
    Now I want to assign text for each boxes in the C1 and C2 lines.
    In C1 line
    first box-- po date
    second box - text
    like that I have to pass the text in the corresponding boxes.
    I don't find any option in the right click.
    I am new to the smartforms.
    Could you pls help me is there any way to insert text in the boxes.
    This is very urgent.
    Thanks in advance.

    Hi,
    Create the text editors as many as you want , these should be  assigned to  each box in template,
    When  u double click on text on the right side uder the template window
    1-Output option tab-->at the bottom , you can see output structure, there you need to  specify the line number and column number.
    Ex:
    template have 2 rows and 2 columns each row
    text1 --- row =1 column =1
    text2---- row =1 column =2
    text3---  row =2 column =1
    text4---- row =2 column =2
    Reward if useful,
    Thanks,
    Aditya

  • How to insert text in current Pdf?

    I try to insert text into current pdf i am getting unexepected error
        PDEContent pdeContent;
        AVDoc avDoc = AVAppGetActiveDoc();
        PDDoc pdDoc = AVDocGetPDDoc (avDoc);
        PDPage pdPage = PDDocAcquirePage(pdDoc,AVPageViewGetPageNum(AVDocGetPageView(AVAppGetActiveDoc())));
        pdeContent = PDPageAcquirePDEContent(pdPage, NULL);
        //Create a PDEText object
        PDEText pdeText = PDETextCreate();
      //  Create a DEGraphicState object and set its attributes
        ASFixedMatrix textMatrix;
        //Create an ASFixedMatrix object
        memset(&textMatrix, 0, sizeof(textMatrix)); /* Set the buffer size */
        textMatrix.a = Int16ToFixed(24); /* Set font width and height */
        textMatrix.d = Int16ToFixed(24); /* to 24 point size */
        textMatrix.h = Int16ToFixed(1*72); /* x,y coordinate on page */
        textMatrix.v = Int16ToFixed(2*72); /* in this case, 1" x 2" */
        PDEGraphicState gState;
        PDEColorSpace pdeColorSpace = PDEColorSpaceCreateFromName(ASAtomFromString(colour_space.c_str()));
        memset(&gState, 0, sizeof(PDEGraphicState));
        gState.strokeColorSpec.space = gState.fillColorSpec.space = pdeColorSpace;
        gState.miterLimit = fixedTen;
        gState.flatness = fixedOne;
        gState.lineWidth = fixedOne;
        PDSysFont sysFont;
        PDEFont pdeFont;
        PDEFontAttrs pdeFontAttrs;
        //Set the size of the PDSysFont and set its attributes
        memset(&pdeFontAttrs, 0, sizeof(pdeFontAttrs));
        pdeFontAttrs.name = ASAtomFromString("CourierStd");
        pdeFontAttrs.type = ASAtomFromString("Type1");
        //Get system font
        sysFont = PDFindSysFont(&pdeFontAttrs, sizeof(PDEFontAttrs), 0);
        //Create a font that is used to draw text on a page
        pdeFont = PDEFontCreateFromSysFont(sysFont, kPDEFontDoNotEmbed);
        char *chrNewFilePath = "Doc.pdf";
        ASText  asFilePath =  ASTextFromUnicode(reinterpret_cast <ASUTF16Val *> (chrNewFilePath), kUTF8);
        //Create a character pointer
        char *HelloWorldStr = "Hello There";
        //Create new text run
        PDETextAdd(pdeText, //Text container to add to
                   kPDETextRun, // kPDETextRun
                   0, // in
                   (unsigned char*)HelloWorldStr, // Text to add
                   strlen(HelloWorldStr),// Length of text
                   pdeFont, // Font to apply to text
                   &gState, //Address of PDEGraphicState object
                   sizeof(gState), //Size of graphic state to apply to text
                   NULL,
                   0,
                   &textMatrix, //Transformation matrix for text
                   NULL); //Stroke matrix
        ::free(chrNewFilePath);
        ASFileSys  asFileSys =  ASGetDefaultFileSysForPath(ASAtomFromString( "ASTextPath" ), asFilePath);
        ASPathName asNewPath =  ASFileSysCreatePathName(asFileSys,  ASAtomFromString( "ASTextPath" ), asFilePath, 0);
        PDDocSave(pdDoc, PDSaveFull , asNewPath , asFileSys, NULL, NULL);

    I changed that code to below mention code, when i was run the plugin and after close the acrobat it asking for save, but it doesn't show any text text
    ASFixedRect  cropBox;
        char  errorMsg[256];
        ASInt32  errorCode = 0;
        PDPageGetCropBox  (pdPage, &cropBox);
        // Initialize the font descriptor then create the font reference.
        // Because we're using one of the base 14 Type 1 fonts, we only
        // need to pass a small amount of information to PDEFontCreate().
        PDEFont  pdeFont =  NULL;
        PDEFontAttrs  pdeFontAttrs;
        memset(&pdeFontAttrs, 0,  sizeof (pdeFontAttrs));
        pdeFontAttrs.name  =  ASAtomFromString( "Courier" );
        pdeFontAttrs.type  =  ASAtomFromString( "Type1" );
        DURING
        // Create the font reference.
        pdeFont =  PDEFontCreate(&pdeFontAttrs, sizeof (pdeFontAttrs), 0, 255, 0, 0,  ASAtomNull, 0, 0, 0, 0);
        HANDLER
        ASGetErrorString  (ASGetExceptionErrorCode(), errorMsg, 256);
        AVAlertNote  (errorMsg);
        return   NULL;
        END_HANDLER
        PDEColorSpace  pdeColorSpace =  PDEColorSpaceCreateFromName(ASAtomFromString( "DeviceGray" ));
        PDEGraphicState  gState;
        ASFixedMatrix  textMatrix;
        // The graphics state controls the various style properties of the text
        // including color, weight, and so forth.
        memset (&gState, 0,  sizeof (PDEGraphicState));
        gState.strokeColorSpec.space  = gState.fillColorSpec.space  = pdeColorSpace;
        gState.miterLimit  =  fixedTen;
        gState.flatness  =  fixedOne;
        gState.lineWidth  =  fixedOne;
        // Fill out the text matrix, which determines the point
        // size of the text and where it will is drawn on the page.
        memset (&textMatrix, 0,  sizeof (textMatrix));
        textMatrix.a  =  ASInt16ToFixed(12);
        textMatrix.d  =  ASInt16ToFixed(12);
        textMatrix.h  = cropBox.left  + (cropBox.right  - cropBox.left)/2 -  fixedSeventyTwo;
        textMatrix.v  = cropBox.top  - (cropBox.top  - cropBox.bottom)/2 -  fixedThirtyTwo;
        PDEText   volatile  pdeText =  NULL;
        DURING
        // Create a new PDEText element and add a kPDETextRun object to it.
        pdeText =  PDETextCreate();
        PDETextAdd  (pdeText,  kPDETextRun, 0, (Uns8  *) "This page intentionally blank" , 30,
                     pdeFont, &gState,  sizeof (gState),  NULL, 0, &textMatrix,  NULL);
        // Insert text element into page content.
        PDEContentAddElem  (pdeContent,  kPDEAfterLast, (PDEElement)pdeText);
        // Commit the changes to the PDEContent.
        PDPageSetPDEContent(pdPage, gExtensionID);
        // Advertise that we changed the contents so the viewer redraws the
        // page and other clients can re-acquire the page contents if needed.
        PDPageNotifyContentsDidChange  (pdPage);
        HANDLER
        // Store the error code.
        errorCode = ASGetExceptionErrorCode();
        END_HANDLER
        // Release any objects we may have created or acquired.
        // Note : PDERelease correctly handles NULL, so we don't
        // need to test for valid objects.
        PDERelease  ((PDEObject) pdeColorSpace);
        PDERelease  ((PDEObject) pdeFont);

  • How to insert text from saved text file using line number to indesign document to specific cursor point?

    i'm using indesign for make books. always i need insert quotes from some holy books. so i need to insert text using verse number

    i'm not asking about
    b
    u
    l
    l
    e
    t and
    n
    u
    m
    b
    e
    r
    i
    n
    g
    sorry for my bad english
    my target is simply insert pre typed sorted texts using the verse number. for example. i have Holy Quran full text . it have about 6000 verse. suppose i need chapter 3, verse 5 in to my paragraph. manually i goto that text file and copy the text paste it here. but i need it automatically using page number/ verse number/ unique id. script / addins .
    approximately like "data merge " in design.

Maybe you are looking for

  • Optimizing Premiere Pro CC to work with a 4k Monitor

    Can someone tell me how to work on Premiere Pro CC 2014 (currently 8.2) on a 4k monitor with scaling set at 100%. If I don't scale anything then all the text and icons and everything is WAY too small. Photoshop seems to have a handy 200% scaling feat

  • How to copy a transaction in complete

    Hi, Is there any way to copy complete code related to one transaction . If there is no direct way can any one say what needs to be done to copy a complete buisiness object . Thanks in advance for reply.

  • Bridge CS5 "output templates" no longer loads; the output panel is blank. Where is the script?

    Bridge CS5 "output templates" no longer loads after my system back-up; the output panel is blank. The other Workspace features appear to be functional. What/Where is the  output script supposed to be? 

  • HT201359 Cannot update my apps?

    What does this mean and how can I fix it? I have searched settings and the only thing that has changed is my e-mail address... "You can not update this software since you have not owned the major version of this software."

  • Hour Glass in Organizer 9

    I keep getting hour glasses where the pictures should be in the organizer.  I've resinstalled PSE 9 and still have the same problem.  I see others have had the same issue -- all unresolved.  I have a phone appointment with adobe tomorrow, but I would