Hiding Image field based on the page number in Adobe Form- Script

Hi Folks,
I have a problem with the print form that I am working on. I need to insert an image of lines (OMR) based on the page numbers. For the OMR part, the first page will always have 4 lines as a image, the middle pages will have 3 lines as a image and the last page will have two lines as a image.
I have uploaded these 3 images a BMPs in SE78 and I am using Xstring of these images in the form. I have two master pages. First master page is for the first page and the second master page is for the remaining pages. The first master page will always have the 4 line image. I created a positioned subform in the master page2, in that subform, I have 2 hidden numeric fields, as the run time properties one for the current page number, other one for the total number of pages. I placed those two images(one for the three line image and the other one for the two line image) exactly on the same location positioned dimensions wise. 
I have written the java script for these two image fields to show based on the page numbering. But, somehow, it is not working. Can anybody please let me know where I am doing wrong. I am posting my java script here.
for the three line image:
var cp = data.PageSet.MasterPage2.OMR.cpage.rawValue;
var np = data.PageSet.MasterPage2.OMR.npages.rawValue;
//if(data.#pageSet[0].MasterPage2.OMR.cpage.rawvalue == data.#pageSet[0].MasterPage2.OMR.npages.rawvalue){
for (j=0; j<xfa.layout.pageCount(); j++){
  if(cp == np){
    xfa.resolveNode("data.PageSet.MasterPage2[" + j + "]").OMR.OMR2.presence = "hidden";
  else{
    xfa.resolveNode("data.pageSet.MasterPage2[" + j + "]").OMR.OMR2.presence = "visible";
For the two line image:
var cp = data.PageSet.MasterPage2.OMR.cpage.rawValue;
var np = data.PageSet.MasterPage2.OMR.npages.rawValue;
for (j=0; j<xfa.layout.pageCount(); j++){
  if(cp == np){
    xfa.resolveNode("data.PageSet.MasterPage2[" + j + "]").OMR.OMR3.presence = "hidden";
  else{
    xfa.resolveNode("data.pageSet.MasterPage2[" + j + "]").OMR.OMR3.presence = "visible";
Please give me a direction as this is kind of hurry.
Thanks,
Srinivas.
Edited by: srinivas kari on Jun 9, 2010 2:03 AM

HI Otto,
Thanks for the response. You are right, I am struck with this image. My problem was to keep the OMR marking on each page based on the page number. It is like a lines with 10mmX10mm dimension at the top right corner for the sorter machine to know the number of pages to put in the envelope. The logic for this is, on the first page, it has 4 lines each 3mm apart. On the middle pages it has 3 lines . On the last page it has 2 lines. When the sorter machine picks these, it looks at the first page with 4 lines, it will count as a first page, it will continue through the 3 line pages as the middle pages until it reaches the 2 line to know it as the last page. This is all happens in the master pages. I have two master pages , one for the first page and the second one for the remaining pages.
At first I did not know how to To achieve this, I created 3 images. one with 4 lines, another ones with 3 lines and 2 lines. The 4 lines image was on the first master page. The 3 lines and 2 lines images were on the second master page at the same place as the image fields positioned. Thats where I was trying this scripting. I was trying to capture the current page and number of pages. Based on these, I was trying to place them.
Is there any other way to achieve this instead of using the images? I thought of sy-uline. but some in the forum told that its not going to work. Even if I use the sy-uline, I have to do some script to achieve this I believe.
Any inputs on this.. Please give the direction.
Thanks,
Srinivas.

Similar Messages

  • Hiding Image filed based on the page number in Adobe Forms - scripting

    Hi Folks,
    I have a problem with the print form that I am working on. I need to insert an image of lines (OMR) based on the page numbers. For the OMR part, the first page will always have 4 lines as a image, the middle pages will have 3 lines as a image and the last page will have two lines as a image.
    I have uploaded these 3 images a BMPs in SE78 and I am using Xstring of these images in the form. I have two master pages. The first master page will always have the 4 line image. I created a positioned subform in the master page2, in that subform, I have 2 hidden numeric fields, as the run time properties one for the current page number, other one for the total number of pages. I placed those two images(one for the three line image and the other one for the two line image) exactly on the same location positioned dimensions wise.
    I have written the java script for these two image fields to show based on the page numbering. But, somehow, it is not working. Can anybody please let me know where I am doing wrong. I am posting my java script here.
    for the three line image:
    var cp = data.PageSet.MasterPage2.OMR.cpage.rawValue;
    var np = data.PageSet.MasterPage2.OMR.npages.rawValue;
    //if(data.#pageSet[0].MasterPage2.OMR.cpage.rawvalue == data.#pageSet[0].MasterPage2.OMR.npages.rawvalue){
    for (j=0; j<xfa.layout.pageCount(); j++){
    if(cp == np){
    xfa.resolveNode("data.PageSet.MasterPage2 [" + j + "]").OMR.OMR2.presence = "hidden";
    else{
    xfa.resolveNode("data.pageSet.MasterPage2 [" + j + "]").OMR.OMR2.presence = "visible";
    For the two line image:
    var cp = data.PageSet.MasterPage2.OMR.cpage.rawValue;
    var np = data.PageSet.MasterPage2.OMR.npages.rawValue;
    for (j=0; j<xfa.layout.pageCount(); j++){
    if(cp == np){
    xfa.resolveNode("data.PageSet.MasterPage2 [" + j + "]").OMR.OMR3.presence = "hidden"; // there is some problem while //posting it is like MasterPage2[" + j + "]")
    else{
    xfa.resolveNode("data.pageSet.MasterPage2 [" + j + "]").OMR.OMR3.presence = "visible";
    Please give me a direction as this is kind of hurry.
    Thanks,
    Srinivas.
    Edited by: srinivas kari on Jun 9, 2010 12:04 AM

    HI Otto,
    Thanks for the response. You are right, I am struck with this image. My problem was to keep the OMR marking on each page based on the page number. It is like a lines with 10mmX10mm dimension at the top right corner for the sorter machine to know the number of pages to put in the envelope. The logic for this is, on the first page, it has 4 lines each 3mm apart. On the middle pages it has 3 lines . On the last page it has 2 lines. When the sorter machine picks these, it looks at the first page with 4 lines, it will count as a first page, it will continue through the 3 line pages as the middle pages until it reaches the 2 line to know it as the last page. This is all happens in the master pages. I have two master pages , one for the first page and the second one for the remaining pages.
    At first I did not know how to To achieve this, I created 3 images. one with 4 lines, another ones with 3 lines and 2 lines. The 4 lines image was on the first master page. The 3 lines and 2 lines images were on the second master page at the same place as the image fields positioned. Thats where I was trying this scripting. I was trying to capture the current page and number of pages. Based on these, I was trying to place them.
    Is there any other way to achieve this instead of using the images? I thought of sy-uline. but some in the forum told that its not going to work. Even if I use the sy-uline, I have to do some script to achieve this I believe.
    Any inputs on this.. Please give the direction.
    Thanks,
    Srinivas.

  • Displaying a field based on the page number

    I need to be able to print a field on the last page of a group. Is there any way to do this? The print on last page only option does not do what I need.
    Thanks

    Andrew, that's pretty much EXACTLY what I'm attempting to do at the moment.
    If you always have the same number of pages in your report, then you could use the SRW.get_page_num and if that is the page number that you expect to be the last then return FALSE from your format trigger.
    I have spent a couple of days on the problem and have been unable to get a solution.
    If only the LAST PAGE "Print Object On" option worked properly ...
    If you do find out how to do it, I'd love to hear about it: my email address is [email protected]
    cheers
    anton
    null

  • How to change the page break in adobe forms

    Does anyone know how to change the page break on an adobe form?  I'm hoping it will be the same way you change the page view in excel.
    Can anyone help?
    Thank you in advance,
    Priscilla

    HI
          YOU CAN USE THE FOLLOWING SYSTEM FIELDS OF SMARTFORMS FOR THE MENTIONED PURPOSE
    <b>&SFSY-PAGE& </b>
         Inserts the number of the current print page into the text. You determine the  format of the page number (for example, Arabic, numeric) in the page node. 
    <b>&SFSY-FORMPAGES&</b> 
         Displays the total number of pages for the currently processed form. This  allows you to include texts such as'Page x of y' into your output
    <b>&SFSY-JOBPAGES& </b>
         Contains the total page number of all forms in the currently processed print  request.
    REGARDS
    ANOOP

  • Page number in adobe form

    when the form execution goes to 2nd page it displays a page number on right potion lil below top margin..
    can some body tell me where the setting is for that pageno.. like sy-pagno or any thing like that..
    reminding you it doesnt show that page number on the form when it is a one page output. only for >2 pages it shoes...the page number.

    solved

  • How to Display the Report Based on The Page Number

    Hi All,
    I just have a requirement like this
    The User wants to see only the odd numbers of Report pages in the Total Report
    For Ex. If the Report consist of 10 Pages the user wanna see Pages 1,3,5,7,9...........
    is it attainable in WebI..............
    Please help on this
    Thanks in advance.............

    I wonder...how do you think user should navigate through document.... ? If I want to see only odd pages - I will either create separate report or I am ok with setting the correct number to actual displayed page.You may also consider using links - it depends how is report structure created...

  • Not able to reset the page number in XML Publisher based on each PO

    Not able to reset the page number in XML Publisher based on PO
    Hi,
    I have created a custom purchase report and rtf template. In the rtf template, I have added the page number feature (i.e. Page 1 of 5) from Word in the template. When I run the report for a range of POs, I expect the results as follows:
    I have given 3 POs on single request. (PO#1 has 3 pages, PO#2 has 2 pages and PO#3 has 4 pages), the page number on each PO should look like as follows:
    PO#1 page 1 of 3, page 2 of 3, page 3 of 3
    PO#2 page 1 of 2 page 2 of 2
    PO#3 page 1 of 4, page 2 of 4, page 3 of 4 and page 4 of 4
    But the page number displays on each PO as follows:
    PO#1 page 1 of 9, page 2 of 9, page 3 of 9
    PO#2 page 4 of 9 page 5 of 9
    PO#3 page 6 of 9, page 7 of 9, page 8 of 9 and page 9 of 9
    Here I have to reset the page number based on each PO. If anyone done this already, can you please share with me.
    Thanks,
    Ram.

    Hi
    One clarification please.
    Are you putting Page # of ## in the for-loop section? I mean it should be within For-each@section block.
    Even if this doesn;t work, then try using Insert->Page Break after every PO.
    Regards
    Varun

  • How do I get information on a mac laptop based on the serial number?

    I am looking at some on line public surplus auctions for macbooks. Some Pro some iBook etc. They don't give you much information about the item other than what it is (no tech specs) and some photos of the actual item. How can I get information based on the serial number?

    This web page will help. Enter the last three digits of the serial number in the empty field:
    http://everymac.com/ultimate-mac-lookup/?search_keywords

  • Is it possible to bring a Logo on to my report based on the company number?

    I am creating Customer Statements and need to include our Company logo. Each company has a different logo. I would like to make this variable based on the company number. Is this possible. If so, How do I do it and where would I store the logos? My data is all coming from our JD Edards system and the logos would be a PC file.
    Thanks,
    Rick

    This depends on which version of Crystal you're using.  If it's Crystal XI or Crystal 2008, you can do the following:
    1.  The logos need to be in a folder that the reports have access to.  This will probably be a network folder.  All images need to be the same size.
    2.  In your report, insert an image - you'll need to select an actual image file, so I suggest that you select one of your actual logos to get the size correct.
    3.  Right-click on the image and select "Format Graphic".  Go to the Picture tab.  There should be a section that says something like "Graphic Location" that has a button in it.  Click on the button.
    4.  In the formula editor that appears, write the code that will determine which actual image file to use. 
    You can either hard-code the locations into the report or a better option would be to have a table in your database that has two fields - something liket Company_Number and Logo_Location.  You then add this table to the report and link to it from the company number.  You then use the Logo_Location field in the formula editor to tell Crystal where to get the image.  This way if an image ever changes or if you add a company you only have to update the table, you don't have to update every report that includes the company logo.
    -Dell

  • How to get the page number in the break section?

    Hi expert,
    The user wants the page number came right after the Break group name if the break section contains more than 1 page. E.g.
    ABC Compnay
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    BCD Company, p 1
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    BCD Company, p 2
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    CDE Company
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    How to get the page number in section break level?

    Hi Wes
    * Create a Field on the margin.
    * Set its "Source" to "Page Number"/"Physical Page Number".
    * Click "Page Numbering" button.
    * In "Reset At" list box, choose the Repeating frame that surrounds your detail group in the layout.
    This should cause Reports to increment the page number until the "Company" repeating frame resets.
    Regards
    Sripathy

  • How to get the page number when click the(Next page) Icon on Tableview

    Hi all,
           I had implemented a tableview in one of the Views that I had implemented for a BSP application. I am using MVC framework.
    Let us assume when we execute the BSP and a table view got 11 pages.
    How I can keep track of the page number when we click the  (Next page, Previous page, Bottom , Top) Icons on my tableview . Is there any attribute willstore that  corresponding page number of the tableview when we click the corresponding Icon's??
    I had checked both CL_HTMLB_TABLEVIEW and CL_HTMLB_EVENT_TABLEVIEW Classes and i don't find any attribute.
    Any help will be appreciated.
    Thanks in advance.
    Thanks,
    Greetson

    Hi Greetson,
      I was thinking to write a weblog about that.
      But now I would like to have your opinion:
      I coded a generic method in my main controller (but you could also insert it in the application class) that save the firstvisible row in the class  me->firstvisiblerowlist (that is a table)
      DATA: l_firstvisiblerowlist TYPE zmmsp_tableview_1st_visi_row.
      DATA: ff  TYPE ihttpnvp,
            ffs TYPE tihttpnvp.
      me->request->get_form_fields( CHANGING fields = ffs ).
      LOOP AT ffs INTO ff.
        IF ff-name CP 'f*visiblefirstrow'.
          READ TABLE me->firstvisiblerowlist INTO l_firstvisiblerowlist WITH KEY name = ff-name.
          CASE sy-subrc.
            WHEN 0.
              l_firstvisiblerowlist-name  = ff-name.
              l_firstvisiblerowlist-value = ff-value.
              MODIFY me->firstvisiblerowlist FROM l_firstvisiblerowlist INDEX sy-tabix.
            WHEN 4.
              IF sy-tabix = 0.
                l_firstvisiblerowlist-name  = ff-name.
                l_firstvisiblerowlist-value = ff-value.
                APPEND l_firstvisiblerowlist TO me->firstvisiblerowlist.
              ELSE.
                l_firstvisiblerowlist-name  = ff-name.
                l_firstvisiblerowlist-value = ff-value.
                INSERT l_firstvisiblerowlist INTO me->firstvisiblerowlist INDEX sy-tabix.
              ENDIF.
            WHEN 8.
              l_firstvisiblerowlist-name  = ff-name.
              l_firstvisiblerowlist-value = ff-value.
              APPEND l_firstvisiblerowlist TO me->firstvisiblerowlist.
          ENDCASE.
        ENDIF.
      ENDLOOP.
    Than you have to provide a generic method to read the firstvisiblerow for each tableview
    GET_FIRSTVISIBLEROW
    *IM_TABLENAME
    *RE_VALUE
      DATA: l_firstvisiblerow  TYPE zmmsp_tableview_1st_visi_row.
      READ TABLE me->firstvisiblerowlist INTO l_firstvisiblerow WITH KEY name = im_tablename.
      IF sy-subrc = 0.
        re_value =  l_firstvisiblerow-value.
      ELSE.
        re_value =  1.
      ENDIF.
    And in the DO_REQUSET of each controller you could write something like:
    * Paginator
      DATA: l_tab1_visiblefirstrow TYPE sytabix.
      l_tab1_visiblefirstrow = o_bsp_main->get_firstvisiblerow( 'f019id_tab1_visiblefirstrow'    ).
    As usual pass the value to the view via:
      o_page->set_attribute( name = 'tab1visiblefirstrow' value = l_tab1_visiblefirstrow ).
    Did you get it?

  • Text flows create a delay when an overflow creates a new page, preventing you from reading the page number, giving error

    Hi all!
    I am creating a script to generate automatically a photo catalog; the idea is to prepare a master document with a text frame in the master spread with auto flowing, then insert images with their caption by the script, letting the system create automatically the subsequent pages when necessary by an unique flow of text.
    My catalog is divided in sections, each represented by a different master spread; so I have to know in which page I am working when the script put there an image, just to link the current page to the proper master spread.
    To simplify everything I have resumed the core of my script here, using text instead of images:
    /* load a master document, only containing an empty text frame in the master spread, connected to the main text flow */
    var doc = app.open(new File("~/Desktop/mySampleDoc.indd"));
    /* I work on the story, thinking that whenever the textframe of the first page will be full, another text frame will be created in the next page (automatically created) */
    var story = doc.pages[0].textFrames[0].parentStory;
    /* now I put some lines of text into the story, expecting the creation of a new page when the first one will be full */
    for (var i = 0; i < 100; i++) {
       /* this is next line: */
        story.insertionPoints[-1].contents = "this is line n. " + i + "\r";
        /* here I want to know on which page is the line just created (error is generated here just during the creation of the new page + text frame) */
        thisPage = story.insertionPoints[-1].parentTextFrames[0].parentPage.documentOffset;
       /* and now I print page number */
        story.insertionPoints.item(-1).contents = "current page: " + thisPage + "\r";
    The big problem is: when the first text frame is full and an overflow is generated, a new page with a new text frame belonging to the main text flow (as the master spread wants) is generated; but it seems my script requests the page number before the new page with the new text frame is born, and an error is given.
    It seems like the script goes too fast in respect to the creation of the new page.
    If I delete the line thisPage = story.insertionPoints[-1].parentTextFrames[0].parentPage.documentOffset; everything is ok.
    I tried to introduce a delay until 3 seconds without any effect.
    I tried also to show or zoom the new page before the page number request, thinking to force the system to wait until page is really born, also without any effect (by the way, I was not able to show the page during the script's additions of text!).
    Someone can help me?
    Many thanks to everyone
    Roberto

    Many thanks: you are right!
    Unfortunately, I am at the very beginning with ExtendScript, and there are so many things I don't know until now...
    With recompose() everything works very well, and it give me a solution also for redrawing the page while the script is working...
    Many thanks, again!
    Roberto

  • How to get the page number's i nthe xml output

    Hi All,
    Greetings!!!!!!!!!!!!!!!!!!!!!!
    Need help to show the page number in this format 1/1 & 1/2.
    How to get this by defining a variable and getting it randomly.
    Please help...
    Thanks
    Rajesh
    Edited by: Badsha on Mar 26, 2010 12:20 AM

    Hi,
    Thanks for your reply.
    code works fine but it calculates total pages and shows page number as 1/2...
    But my requirement is i am converting AR remittance report to xml. and output will have diff outputs for a check date based on the supplier.
    For Ex..pdf output for check date '01-jan-2010' will have 5 pages firts two pages belong to same supplier(for this i want page number to be shown as 1/2 & 2/2) and rest of the pages belong to different supplier(for this i want page number to be shown as 1/1..)
    Please help to achieve this in my output.
    Thanks
    Rajesh

  • Showing/Hiding certain fields based on Radioset selection

    Hello all,
    I'm like to know whether it is possible to Show/Hide certain fields using a RadioSet selection as it is done in Forms in ADF UIX. Kindly go through this post.
    Showing/Hiding certain fields based on Radio Group selection
    kindly help me out on this.
    Thanks & Regards,
    Arun.V

    Hi Arun,
    Here is what I do with my checkboxes, but I think that the radiobutton will do the same:
    <af:selectBooleanCheckbox text="selectBooleanCheckbox 1"
                          label="Label 1"
                          binding="#{backing_page1.selectBooleanCheckbox1}"
                          id="selectBooleanCheckbox1"
                          autoSubmit="true"
                          immediate="true"/>
    <af:inputText label="Label 1" binding="#{backing_page1.inputText1}"
                          id="inputText1"
                          disabled="#{!backing_page1.selectBooleanCheckbox1.selected}"
                          partialTriggers="selectBooleanCheckbox1"
                          value="#{backing_page1.selectBooleanCheckbox1.selected}"/>

  • Why are my images scrolling from outside the Page width?

    Why are my images scrolling from outside the Page width? I am positive i has all the settings correct, to have an image parallax scroll from the edge of the page into the page and out again. But the images are flying in from the browser width - not the page width. This is not the effect I am after.
    Any suggestions on how to fix this? Given the key position is only linked to the height, I can't for the life of me work out how to ensure the images start moving from a certain position onthe left and right of the page.
    Thanks

    I think the effect you are seeing is a result of how the lineHeight is set up. By default, the lineHeight will be calculated as 120% of the size of the largest thing on the line -- in your case, this is the inline graphic. This is designed to leave space between the line before and the line with the graphic. So it is taking the height of the graphic, multiplying by 120%, and making this the distance between the previous line and the line with the graphic. So the bigger the graphic, the bigger the space above the graphic. Normally this works well with text, but in this case you may want to get closer to "set solid". You can do this by setting the lineHeight to 100%. Or you may wish to leave a couple of percent for the descenders of the previous line. Or, another alternative that may work well for you if you really know exactly where you want the line set, you could measure the graphic, add on the number of extra pixels to leave for the descenders, and make the lineHeight a constant. So you could do something like this:
    <img lineHeight="104%" height="411"/>
    or this:
    <img lineHeight="423" height="411"/>
    Obviously you would still need to specify the source and any other parameters you want on the image.
    Note that if you are trying to fit a 200 pixel high graphic into a 200 pixel high container, you will hit the same problem -- in order to fit the graphic, the container will have to be slightly bigger than the graphic in order to fit the descenders on the last line. This is true even if the last line contains only the graphic, and no descenders (or text) at all.
    Hope this helps,
    - robin

Maybe you are looking for

  • [b]Error during JSP page processing[/b]

    hi , i'm mech. i have some probs with jsp. i am trying to connect jsp page with database and printing the data on the browser page. i have created DSN mm using microsoft odbc for oracle and oracle9i's driver oracle in orahome90 but it is giving yet .

  • Invalid Form error

    Dear Experts, I have created one matrix and one button in Purchase Order form. when i click on that button one form(frmopr) will be loaded. that form contains one matrix with data and one button. now i select one or more line in the matrix and click

  • BPM Work flow User escalation

    PROBLEM SUMMARY-_ How to achieve User escalation when we have User task with one Stage, 2 Sequential Participant blocks with one user in each block. DETAILED DESCRIPTION-_ In my user task I have a stage with 2 participant block configured sequentiall

  • Can I Skip Uncommitted Row ?

    Hi SQL Gurus, I have a requirement in our query to skip uncommitted row. eg : After I insert in table A, after insert trigger will insert row into table B before commit, when I query to Table B, how can skip the uncomitted row ? Is there such functio

  • Anywhere access domain users and rights

    Hello, I am working with anywhere access on server 2012 R2, and I am wondering if it has the ability to use the existing domain user rights to existing file share's and folders instead of using its own system. For example I added a new share and poin