Using Javascript to print and close window

I found that I could open my document in a browser and using Javascript, automatically bring up a print dialog and send it to the printer. My problem is that this document opens in a browser that is being used as a kiosk touch screen with no address or navigation bar at the top (they are hidden).
I would like to ave the pdf open in a new window, print and then close, making the original window viewable again. Is this possible?
I have tried adding window.close() right after the print command, but it doesn't seem to work. Am I simply adding the close command incorrectly?
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
this.print(pp);
window.close();

This is what commands are allowed in Javascript for Mozilla Products. IF they haven't been touched by the user of the browser many of these are turned off by default.

Similar Messages

  • Using JavaScript to Print and Overwrite Active Form Files

    Hello all,
    I have zero knowledge of JavaScript and I am hoping someone can help me
    quickly solve an issue I am having with active forms. I tried using the flatten
    feature in the action wizard but it is not working. I also tried using
    "this.flattenPages()" but I can still edit the fields in my PDF file.
    What I am looking for is a JavaScript command that allows me to overwrite the existing
    PDF file using the PDF printer and overwrite the active form so it is
    finalized. Maybe there is an easier more efficient way to accomplish this? Any
    input or help would be much appreciated. I am using Adobe Acrobat XI
    Pro. Thanks.
    P.S. I realize I can manually selected the Adobe PDF printer and finalize my
    active form that way but I am looking for a one click solution.

    Have you seen these?
    A tutorial on how to flatten form fields:
    http://acrobatusers.com/tutorials/how-to-flatten-form-fields
    And a free "Flatten Page Content" tool:
    http://www.pdfscripting.com/public/Free_Acrobat_Automation_Tools.cfm

  • Javascript Open and Close window

    I am creating a new website and am having problems getting
    the open window and close window to work. I want this window to
    open a new window (NOT a popup window used with the "onload"
    option). I am using an img tag so that when you click on the image
    thumbnail this new window opens. It is my understanding in order to
    use the window.close option, you must have the javascript in the
    header of the html document for the close to work. In the heading
    of the document that contains the link to open a new window I have
    the following:
    <SCRIPT language="JavaScript1.2">
    function popuponclick()
    Cellex = window.open("products/cellex.htm",
    "console","status=1,width=350,height=150");
    function closepopup()
    if(false == cellex.closed)
    cellex.close ();
    else
    alert('Window already closed!');
    </SCRIPT>
    Then I have this in the body:
    <img src="images/thumbnails/dermalogicath.jpg"
    alt="Dermalogica" width="94" height="84" border="0"
    /></a></td>
    <td><a href="products/mdskin.htm"
    onclick="window.open('products/mdskin.htm','mdskin',width=610,height=780,scrollbars=yes') ;return
    false; target="_blank">
    However, I'm getting script errors when opening the window on
    the lines in the body Unterminated error. I have tried using the
    help in Dreamweaver as well as many docs posted, but still cannot
    get this to work. Once I get the script errors resolved, the when
    the window opens, it will not close. I get the message that a
    window is trying to be closed and do I want to close the window
    which closes internet explorer entirely. I'm using IE 7.0 as well
    as foxfire and have the same issue on both. If I use the
    dreamweaver behaviors to call a javascript, it puts "onload" and if
    I change to "onclick" then the script will not work. When I use the
    behavior "open window" it still doesn't work. I'm totally lost as
    to what I'm doing wrong as I have followed about 10 papers all
    using the same instructions.
    Hopefully some one can help me, I'm getting fustrated as this
    seems to be pretty straight forward.
    Thanks, vienie

    Try this on for size:
    I have included two functions.
    windowRebuild() - opens a new window, maximizes it based on the screen size, removes all toolbars, and then closes the old window.
    myLocation(appName, pageName) - builds a url referencing an HTMLDB application, specfic to what server you are currently on. Very useful when you have an application on 3 different servers(dev, test, prod servers), you wouldn't want the server name hardcoded if you plan to export the app to another server.
    Also, you need to be careful when using &APP_ID. I am not completely certain how that is resolved at runtime, but I've found it only works when the javascript is in the HTML Header of a page and not stored in the template of the page.
    <script language="JavaScript1.1" type="text/javascript">
      This functions is for internal application use.
      Examples of myLocation:
      url = myLocation('&APP_ID.', 'APP_PUBLIC_PAGE');
      url = myLocation('MY_APP_ALIAS', 'MY_PAGE_ALIAS');
      url = myLocation('184', '10');
    function myLocation(myApp, myPage){
      var myHost = location.host;
      var newURL;
      newURL = 'http://'+myHost+'/pls/htmldb/f?p='+myApp.toString()+':'+myPage.toString();
      return newURL;
    /*  Function windowRebuild()
    *   This function will open a new window and close the old window.
    *   This function will also maximize the new window and remove all toolbars.
    function windowRebuild(){
       if(window.name != 'myAppWin'){
        var url = myLocation('&APP_ID.', 'PAGE_ALIAS');
        var myWin = window.open(url,'myAppWin','toolbar=0,scrollbars=1,menubar=0,status=1,resizable=1,location=0');
        window.opener = 'x';
        window.close();
       if(window.name == 'myAppWin'){
        window.moveTo(0,0);
        window.resizeTo(screen.availWidth,screen.availHeight);
    </script>Let me know if that works or you need some more explanation.
    Chris

  • Download using open data set and close data set

    can any body please send some sample pgm using open data set and close data set .the data should get downloaded in application server
    very simple pgm needed

    Hi Arun,
    See the Sample code for BDC using OPEN DATASET.
    report ZSDBDCP_PRICING no standard page heading
    line-size 255.
    include zbdcrecx1.
    *--Internal Table To hold condition records data from flat file.
    Data: begin of it_pricing occurs 0,
    key(4),
    f1(4),
    f2(4),
    f3(2),
    f4(18),
    f5(16),
    end of it_pricing.
    *--Internal Table To hold condition records header .
    data : begin of it_header occurs 0,
    key(4),
    f1(4),
    f2(4),
    f3(2),
    end of it_header.
    *--Internal Table To hold condition records details .
    data : begin of it_details occurs 0,
    key(4),
    f4(18),
    f5(16),
    end of it_details.
    data : v_sno(2),
    v_rows type i,
    v_fname(40).
    start-of-selection.
    refresh : it_pricing,it_header,it_details.
    clear : it_pricing,it_header,it_details.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    FILENAME = 'C:\WINDOWS\Desktop\pricing.txt'
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = it_pricing
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7.
    WRITE : / 'Condition Records ', P_FNAME, ' on ', SY-DATUM.
    OPEN DATASET P_FNAME FOR INPUT IN TEXT MODE.
    if sy-subrc ne 0.
    write : / 'File could not be uploaded.. Check file name.'.
    stop.
    endif.
    CLEAR : it_pricing[], it_pricing.
    DO.
    READ DATASET P_FNAME INTO V_STR.
    IF SY-SUBRC NE 0.
    EXIT.
    ENDIF.
    write v_str.
    translate v_str using '#/'.
    SPLIT V_STR AT ',' INTO it_pricing-key
    it_pricing-F1 it_pricing-F2 it_pricing-F3
    it_pricing-F4 it_pricing-F5 .
    APPEND it_pricing.
    CLEAR it_pricing.
    ENDDO.
    IF it_pricing[] IS INITIAL.
    WRITE : / 'No data found to upload'.
    STOP.
    ENDIF.
    loop at it_pricing.
    At new key.
    read table it_pricing index sy-tabix.
    move-corresponding it_pricing to it_header.
    append it_header.
    clear it_header.
    endat.
    move-corresponding it_pricing to it_details.
    append it_details.
    clear it_details.
    endloop.
    perform open_group.
    v_rows = sy-srows - 8.
    loop at it_header.
    perform bdc_dynpro using 'SAPMV13A' '0100'.
    perform bdc_field using 'BDC_CURSOR'
    'RV13A-KSCHL'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RV13A-KSCHL'
    it_header-f1.
    perform bdc_dynpro using 'SAPMV13A' '1004'.
    perform bdc_field using 'BDC_CURSOR'
    'KONP-KBETR(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KOMG-VKORG'
    it_header-f2.
    perform bdc_field using 'KOMG-VTWEG'
    it_header-f3.
    **Table Control
    v_sno = 0.
    loop at it_details where key eq it_header-key.
    v_sno = v_sno + 1.
    clear v_fname.
    CONCATENATE 'KOMG-MATNR(' V_SNO ')' INTO V_FNAME.
    perform bdc_field using v_fname
    it_details-f4.
    clear v_fname.
    CONCATENATE 'KONP-KBETR(' V_SNO ')' INTO V_FNAME.
    perform bdc_field using v_fname
    it_details-f5.
    if v_sno eq v_rows.
    v_sno = 0.
    perform bdc_dynpro using 'SAPMV13A' '1004'.
    perform bdc_field using 'BDC_OKCODE'
    '=P+'.
    perform bdc_dynpro using 'SAPMV13A' '1004'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    endif.
    endloop.
    *--Save
    perform bdc_dynpro using 'SAPMV13A' '1004'.
    perform bdc_field using 'BDC_OKCODE'
    '=SICH'.
    perform bdc_transaction using 'VK11'.
    endloop.
    perform close_group.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Unix command to click button on dialog box and close windows?

    I administer an elementary school computer lab of 35 eMacs all with OS 10.4.7 and with ARD 3.0. Our network server configuration requires a mounted server on each desktop in order to administer certain software packages we use. Every morning at start-up I have to walk around and manually click "Connect" on the dialog boxes. Then, with this configuration, each time a server is mounted, it opens up a Finder Window on the host machine so I've got to walk around and close windows on all the machines. I'm sure there must be an AppleScript or Unix command that I can set up to do these two tasks but I've not found it (or learned how to write it) in a few days of searching. Any suggestions?
    Thanks,
    Dan

    OK guys,
    I just succeeded in saving the AppleScript command as an application. I put it in the Login Items just after the servers. It worked beautifully! No more open windows exposing sensitive files to the risks of elementary students (how come the mounted volumes always appear on the desktop even when the "hide" button is checked?). It would be great if the mounted volumes were not showing at least in a setting like a school computer lab.
    Now, I'm still dealing with the mounting process requiring me to manually click on "Connect" every time. The Student account doesn't even have a password just to make such things easier. Still the process displays this:
    (Oh well, I guess I can't insert a ScreenShot.)
    Here's what it says: Connect to the file server "server name."
    Connect as: Registered User
    Name: "account name"
    √Remember password in keychain
    (and then two buttons) Cancel or Connect
    That's where I'm at right now. My district Tech. Support folks say that there's no way to avoid the dialog box but John seems to do it OK. They also pointed me to an online source (www.bombich.com) that I haven't yet checked out.
    Thanks again,
    Dan

  • How to use javascript to print on the client side

    hi all,
    Now i'm facing a problem:
    I want to use javascript to print something(for example, a table) on the client side. So i must get a connection with the printer installed in the client computer.
    some says that getObject() function can do this,but i don't know how?
    Who please help me!

    window.print();

  • I am trying to print a color photo on my MacBook Pro from iPhoto (not using Photoshop) using Epson 2200 printer, and everything I do in the Color Matching and Print Settings results in a photo with a pink cast to it. What am I doing wrong?

    I am trying to print a color photo on my MacBook Pro from iPhoto (not using Photoshop) using Epson 2200 printer, and everything I do in the Color Matching and Print Settings results in a photo with a pink cast to it. What am I doing wrong?

    Have you checked the ink cartridges and made sure the nozzles are clear? Are you able to print from outside of iPhoto with the correct color?
    Try the following: make temporary copy of the library and do the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    OT

  • Can I use JavaScript HTML Portlet and PDK Portlets

    Can I use JavaScript HTML Portlet and PDK Portlets?
    My Script works fine with the an HTML portlet but it always gives a an Error Message in the status bar is that normal...
    Other then that I have JavaScript in my PDK portlet page it does not work.. it is the the same javascript I use for in my HTML portlet which works in HTML portlets..

    You'll have to place your JavaScript in the header section of your Portal page. To do so, use HTML/UI templates. For more information, refer to the How to Design and Build Compelling Portal Interfaces whitepaper.
    Good luck,
    Peter

  • Change the Colors of Expand, Minimize and Close Window Buttons

    How do I change the colors of the Expand, Minimize and Close window buttons?
    Red, green, and yellow are not conducive to red-green colorblind individuals, and the gray scheme in the Graphite appearance is too dull.

    If the change in theme can do it, there must be an alternative.

  • HT3986 In using bootcamp to partition and install Windows on my computer, the partition step stops and sends me a message that "files cannot be moved" so partitioning is incomplete.  I am stuck. Please help.

    In using bootcamp to partition and install Windows on my computer, I keep hitting a snag.  Message says that partitioning can not be completed because files can not be moved.  I have tried several things but nothing seems to be helping to move the process along.  What should I do?

    Welcome to the Apple Support Communities
    In most of the cases, that message appears when there's a problem with the filesystem, so you have to repair the disk. This doesn't mean that the hard drive is damaged.
    First of all, open  > About this Mac, and check Version. If it's 10.5 or 10.6, insert the Mac OS X DVD of the version you are using and press C key while your Mac is starting. If it's 10.7 or 10.8, press Command and R keys while your Mac is starting. After doing this:
    1. Go to Utilities menu > Disk Utility (if you have 10.5 or 10.6) or open Disk Utility (10.7 and 10.8).
    2. Choose Macintosh HD in the sidebar and repair the disk.
    3. Restart, open Boot Camp Assistant and follow the steps to install Windows on the Mac

  • Where did Close Tab and Close Window under the File tab go? I end up with all these open windows or exiting altogether.

    Under the File tab, I no longer see Close Tab or Close Window. Thus, I end up with a lot of open windows, because if I click File Exit, I'm logged out.

    You need to create a file userChrome.css in the chrome folder in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] and paste the above posted code in the file.<br />
    You can use the ChromEdit Plus extension to make it easier to edit the file.
    You can access the profile folder via this button:
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    That code will cause all hidden menu entries to get visible all the time, so you can use the mouse to open the menus and do not need to use the keyboard.

  • Using the 'route print' Command in Windows 7 - Detailed Screen Captures

    The 'route print' Command from an Administrative Command Prompt in Windows 7 provides a variety of useful information.  Let's take a look at the output of a 'route print' Command to examine how the output data is grouped and to understand its logic.
    Let's begin by simply issuing the following command:
    route print
    An Administrative Command Prompt output shows the following the following sections of the Command Output:
    Figure 1 - Issuing the 'route print' Command from an Administrative Command Prompt in Windows 7
     Observing the output of the Command indicates there are 5 Major Sections.  The Sections include:
    Interface List
    IPv4 Route Table
    IPv4 Persistent Routes
    IPv6 Route Table
    IPv6 Persistent Routes
    On this Workstation a single Physical Network Interface is visible and has been assigned a DHCP Address of '10.1.1.36'. 
    The IP Stack for this Workstation is as follows:
    IP Address: 10.1.1.36
    Subnet Mask: 255.255.255.0
    Default Gateway: 10.1.1.1
    DNS Server: 10.1.1.1
    DHCP Server: 10.1.1.1
    DNS Suffix: YYY.YYY.isp-provider.net
    Most of the time our focus is upon the IPv4 Routing Table output.  Here are the sections of the IPv4 Routing Table output for reference.
    Figure 2 - The IPv4 Route Table output listing the 'all networks' route through the Default Gateway.
    The next IPv4 Routing Table entry indicates '10.1.1.36' (the Host Workstation' is a member of the '10.1.1.1/24' Network and would route packets out the '10.1.1.36' Interface.
    Figure 3 - The Workstation Host at '10.1.1.36' is a member of the '10.1.1.0/24' Network Subnet.
     The next IPv4 Routing Table entry indicates '10.1.1.36' may receive a Broadcast from the '10.1.1.0/24' Network (as noted by the Subnet Mask of '255.255.255.255').
    Figure 4 - The Workstation Host at '10.1.1.36' can offer a Broadcast on the '10.1.1.0/24 Network' (as noted by the 255.255.255.255 Subnet Mask).
     Another IPv4 Routing Table entry focused on Broadcast Addresses is the following.  The Host Workstation at '10.1.1.36' may offer Network Broadcasts to the '10.1.1.0/24' Network.
    Figure 5 - The Workstation Host at '10.1.1.36' can receive Network Broadcasts from the '10.1.1.0/24' Network (as noted by the '10.1.1.255' Network Destination).
     The next IPv4 Routing Table entries (3 of them) are focused on the Loopback Network Values of '127.0.0.0/8',  '127.0.0.1/32' and the Loopback Network Address of '127.255.255.255/32' respectively.  These Addresses provide Services to the Local Host (or Loopback Adapter).  The Loopback Network Destination of '127.0.0.0' provides access to the Loopback Network through '127.0.0.1' the Loopback IP Address.  The Loopback IP Address of '127.0.0.1/32' receives Limited Local Broadcast to the Loopback Network while the Loopback IP Address of '127.255.255.255/32' provides Limited Broadcast to the Loopback Network.
    Figure 6 - The Workstation Host at '10.1.1.36' uses 3 Addresses for Services to the 'Local Host'. All 3 Addresses incorporate the '127.x.x.x' format.
     Next the Routing Table includes 2 specific entries for the Multicast Network (224.0.0.0/4) for both the 'Local Host' or Loopback  Address of '127.0.0.1' and the Host IP Address of '10.1.1.36' that are '224.0.0.0/4' .  These are used for Multicast Network functions.
    Figure 7 - The Workstation Host at '10.1.1.36' includes 2 Multicast Addresses (starting with '240.0.0.0') reserved for use through either the Loopback Address '127.0.0.1' or the Host IP Address '10.1.1.36'.
     The last 2 Routing Table entries provides Services through Limited Broadcast Addresses.  The Network Destination of '255.255.255.255/32' are the Limited Broadcast Address Ranges for both the Loopback Adapter '127.0.0.1' and the Host IP Address '10.1.1.36'.
    Figure 8 - The Workstation Host at '10.1.1.36' includes 2 Limited Broadcast IP Address Values to Service both the Loopback Network '127.0.0.1' and the Host IP Network '10.1.1.36'.
    Finally, upon understanding the sections of the Windows 7 Routing Table there are additional functions available when using the 'route' Command.  This Blog entry is focused solely on output from the 'route print' Command.
    Summary: In this Blog entry focused on using the 'route print' Command from an Administrative Command Prompt in Windows 7.  Each of the defined routes for a Workstation running Windows 7 Enterprise were reviewed for reference.
    Lynn Lunik
    Chief Security Architect
    IT Pro Secure Corporation
    and exchangesummit.net
    blog <at> itprosecure.com

    I thought, it is my browser issues of not seeing the images.
    but as seen on the other comments, this not in my browser case.
    Can someone check on this and repost the images if needed?

  • Why does my Mac not allow me to use my own printing preferences? Windows does.

    I have a new Mac and have found to my dismay that I can no longer have any control over what type of paper I want to print on, along with many other printing preferences that I want to have control over as I did with my Windows Computer. Therefore, I am at the mercy of my computer or printer to figure out what kind of paper I am using...which is ridiculous, as that is impossible. Needless to say, many of my photos that I am trying to print on different papers, are printing out all kinds of crazy ways. I am using my same printer than I used with my Windows computer....the Epson Artisan 810 Photo Printer. I am a very serious photo printer person and I want my control back. What is the problem here and when will it be corrected?  Thanks for any help that anyone can offer me.  

    Hi ,
    Go to System preference > Printers & Scanner
    select your printer and change its default print paper .
    If you want to change more settings .
    1) Open any image in PSE EDITOR.
    2) Go to Print.
    3) Select your printer  Click on Print button w/o changing the size and other things.
    4) save the settings in this window.

  • Trackpad is presenting a bug to open and close windows, mission control, and to move/roll the application (App) up and down.

    Totally out of the blue, my trackpad is presenting a "bug". Every time that I try to open and close my mission control, or in the moments that I move / roll up and downs the Applications Screen, my Mac freezes for less than a second.
    It never suffered any damage (NEVER!)! I am feeling very frustrated because I have no idea about what could cause such problem.
    My MacBook Air is running OS X 10.9.5.
    Any help will be very welcome!

    Well, it all really depends on the custom program and how it was written. Does it have an ActiveX interface? If it does, than that's the easiest way to go. If you put an automation refnum on the fron panel, you can right click and it and choose Select ActiveX Class>Browse. The browser will list all of the ActiveX type libraries that are registered on your system. If you can find one that refers to your custom program, then you should be able to use it's methods and properties to control. If it does not have an ActiveX interface, then things get much more difficult.

  • How can I use a wireless printer and the internet at the same time?

    Hi there, I just installed a wireless printer but to use it I have to click on the Airport icon and select the printer in the 'devices' list. This deselects my connection to my wireless modem. Is there any way I can print and look at the internet at the same time? This does not seem right to me, I print a lot of info from the net and don't want to spend time selecting and waiting for connection back and forth all the time.
    Bo

    I have a Linksys WAG54G2 wireless G router. This router has a Wireless Protected Setup button which I understood would initiate a search for wireless devices and aid setup but it seems to do nothing. I made the mistake of tryig to use the linksys installation disk to access a setup wizard and that just reset my entire network back to factory settings and it took me 4 hours to reconfig my system. Won't be touching that again. It all seems odd, the printer is compatible with the router as far as I can see but I don't know how to get the router to recognise the printer.
    bo

Maybe you are looking for

  • FRM-47023: No such parameter named G_QUERY_FIND

    Hi All: I am getting following Error when i am opening my form from apps(11.5.10.2) FRM-47023: No such parameter named G_QUERY_FIND exists in form XXEMP FRM-40105 : Unable to resolve reference to item PARAMETER.G_QUERY_FIND i am using apps11.5.10.2 (

  • Error when trying to create a JCO Destination

    Hi I receives the following error when trying to creat a JCO Destination, clicking on the button in the host:port/webdynpro/dispatcher/sap.com/tcwdtools/Explorer I get the following error: Error stacktrace: java.lang.NullPointerException      at com.

  • Digital camera setup not working

    Hi, My computer all of the sudden is not reading my camera when pluged into the usb. In the past I was able to use my camera with the usb. My computer (flat screen G4) Although is able to read my ipod with no problems. I tried all three usb ports in

  • Unable to insert PDF object into Word 2013

    Hi, While trying to insert PDF (Adobe Reader X 10.1.0) document into Word (Microsoft office Professional plus 2013 15.0.4420.1017) getting below error. Error Message: The Program used to create this object is Acroexch.That program is either not insta

  • OK to Bind Server to AD currently running OD?

    Hi All, I'm currently running an OS X 10.5.8 Open Directory Server. Does anyone see any issues with binding this server to an Active Directory Server while in production?? This way all new users we be added from AD. And in my spare time I can remove