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.

Similar Messages

  • 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.

  • 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

  • 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

  • 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

  • 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 can I remove the page number from the first page of the document that is the cover page?

    How can I remove the page number from the first page of the document that is the cover page?

    If you open the Pages panel, (Window>Pages) you will see thumbnails of your master pages and your document pages. In new documents, there is usually a master called A-Master and one called None. If you drag the thumbnail of the None master onto the thumbnail of a document page, it will apply that master to that page. Presumably, you have made your page numbers on A-Master, so this will usually do the trick. If you have elements on A-Master that you need on the first page, but just not the page number, you can duplicate A-Master (which, by default will give you B-Master, but you can change the names if you like) and remove the page number on the duplicate and apply that to the document page.
    It might also be worth noting that you can apply master pages in the fly-out of the Pages panel. Go to the fly-out triangle and go down to Apply Master to Pages…, then select a master to apply and the range of pages (1-8 will give you all 8, 1, 3, 5, 7 will be the odds, 1-3, 4, 6-8 if you want continuous ranges and individual pages).

  • How to print the page number in a background processing program

    HI All,
    I have requirement where i need to print the page number in x of y format and the program is getting executed in background and  csv file will be downloaded at application server.
        i tried using sy-pagno but it is not working.

    csv file will be downloaded at application server --> How u are downloading this ? have u coded in ur program ? in tht case u will not get.
    Regards
    Prabhu

  • How do I set twice monthly events based on the week number

    Greetings all. I can't seem to navigate this help system, so hopefully I'm not reasking something that's already been asked. But I have a problem with iCal that I just can't figure out of find an answer to. I need to create a twice monthly event, but it's based on the week number, not every two weeks. For example, I need to be able to create an event for the 2nd and 4th Mondays of the month. Is that possible with iCal? Thanks for your help... and not laughing at me
    Steve

    No problem.
    Go to Monday select the day you want. Create new Event. Then select repeat and you will come up with how you want to repeate it. Select Monthly and then do the following:

Maybe you are looking for