Prints fine but the second time it prints it's small?

I have an applet that I finally got to print from but now when I load the page it prints the first time perfect but if I refresh the page it prints the correct image but it's half the size. If I close the browser and open it back up same thing, first one is fine and after that they are all small. Any ideas, do I need to clear or restet something with the printer?

import java.io.*;
import javax.print.*;
import javax.print.attribute.*;
import javax.print.attribute.standard.*;
import javax.print.event.*;
import java.net.URL;
import java.applet.*;
import java.awt.*;
import java.lang.Float;
public class BasicPrint2 extends Applet{
        public void BasicPrint2(){
        public void paint( Graphics g ) {
                g.drawString("Hello World",50,25);
                try {
                        PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
                        DocFlavor flavor = DocFlavor.URL.JPEG;
                        PrintService[] services = PrintServiceLookup.lookupPrintServices(flavor, null);
                        PrintService service = null;
                        int y = 30;
                        if (services.length == 0){
                                System.out.println("****NO SERVICES***");
                        for(int i=0;i<services.length;i++){
                                System.out.println(services.getName());
String name = services[i].getName();
g.drawString(""+name,50,y);
if (name.equals("BoardingPass1")){
service = services[i];
y+=20;
if (service != null){
DocPrintJob job = null;
job = service.createPrintJob();
String imageName = getParameter( "imagename" );
URL url = new URL("http://xxx.xxxx.xxxx.xxxx/tmp/"+imageName+".jpg");
SimpleDoc simpleDoc = new SimpleDoc(url, DocFlavor.URL.JPEG, null);
PrintRequestAttributeSet attrs = new HashPrintRequestAttributeSet();
Media med[] = (Media[])service.getSupportedAttributeValues(Media.class, null, null);
float printableX = (float)3.25;
float printableY = (float)7.50;
MediaSizeName mediaSizeName = MediaSize.findMedia(printableX,printableY,MediaPrintableArea.INCH);
attrs.add(mediaSizeName);
job.print(simpleDoc, attrs);
job = null;
mediaSizeName = null;
simpleDoc = null;
url = null;
attrs = null;
}else{
System.out.println("No Printer Found");
defaultPrintService = null;
flavor = null;
services = null;
service = null;
} catch (PrintException e) {
System.out.println(e);
} catch (IOException e) {
System.out.println(e);
Here is the code. I prints to a DataMax M class printer.

Similar Messages

  • My iPod touch 4th gen white's home button doesn't work the first time I press it, but the second time.

    My home button doesn't work the first time I press it, but the second time.  This is very annoying.  Why is it doing this?

    - Try a reset. It cures many ills and nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    -If a hardware problem see:
    fix for Home button

  • Yahoo mail account drops out randomly. I have 2 yahoo mail accounts on my Mac. The primary account works fine but the second account loses connection.

    II have 2 yahoo mail accounts on my Mac. The primary account works fine but the second account loses connection. When I put in the password I get a message that it is not the correct password. The only way round it appears to be to go into Yahoo on Safari, log out then log bck in again. If I then go back into Mail and right click on the account I cn then get mail for this account without having to enter a password. The problem only started when I installed Lion, but is still the same in Mountain Lion.

    Welcome to the Apple Community.
    Enter the details of her second account at system preferences> mail, contacts & calendars.

  • Reader 9.3.3 crashes the second time I print

    Running Adobe Reader 9.3.3 on Slackware Linux 13.1 (Kernel 2.6.33.4, 32 bit Intel). I can print fine, but only once. The second time I try to open the print dialog, Adobe Reader closes - crashes with a segmentation fault.  This is 100% repeatable, and I don't even have to actually send anything to the printer. Just using File => Print, clicking Cancel, then again File => Print will cause the crash.
    Someone else with Slackware Linux 13.1 has reproduced this, but I know it doesn't happen with Xubuntu 10.04 on the same hardware and same Reader version. So something is going on between Reader and Slackware Linux.  Are there any suggestions that I can try to help track this down?

    Hi Just an update on this.
    This seems to now be fixed on slackware 13.1 and current.
    It was indeed the same problem as described in the other threads. The reason it didn't crash firefox on default slackware is because it would only do so when gnome-vfs is installed (which doesn't come directly in the distro)
    The cups package on 13.1 and current have just been updated to fix the problem and I have tested it with Reader 9.4.1 and can confirm the Reader doesn't crash anymore.
    Sorry for the noise.
    Cheers
    Greg

  • HT1725 My first time purchasing, downloading and watching a movie from itunes worked fine but the second did not!  An error (unknown error 50) kept coming up no matter how often I tried resuming the download or restarting my laptop and internet connection

    My first ever purchase and download of a movie was successful but the second didn't download and came up with
    "error 50 has occured".  I tried downloading numerous times again after checking my internet connection and rebooting my
    laptop.  Still no luck and the Itunes store have charged me.  Any suggestions please?

    This error can be quite common:
    iTunes Store: "Error (-50)" when downloading purchased content
    http://support.apple.com/kb/TS1583

  • When I upgraded my Mac Pro HDs I lost the capcity for 2 monitors.  One monitor works fine but the second one is not "seen" by the Mac Pro.  Help?

    My MacPro is a dual quad core 2.8 intell processor system with 6 gig of RAM and 4 HDs.  I recently upgraded the HDs from 500 gig each to 2 TB each.  I did that by copying each existing hard drive to a new hard drive and then inserting the new hard drive where the copied drive had been.  I followed all of the instructions for the OX system that came after copying and replacing the drive with the OX on it.  Unfortunately now I can no longer use the 2 monitors that I used to use on the system.  One monitor works fine, the second on is not found by the OX system and simply won't respond or receive a signal from the computer.  Any ideas?

    Have you tried a NVRAM / PRAM reset?
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

  • PSC 500 - Prints fine, but the scanner is not detected on the 64-bit version of Windows 7

    Last week I decided to update my computer to Windows 7 x64 since my computer crashed. (It was pure dumb luck that I backed up my computer the night before.) Anyway, soon after I was done, I tried to install my HP PSC 500 (C6680A) and I was happy that It worked, however I soon realized that it lost it's ability to scan. I am not talking about the scan button that according to HP no longer works; I am talking about actual ability to scan from the computer.
    Because my computer is telling me that I do not have a scanner connected and hp scanner drivers are missing from the list in the "Scanner and Camera Installation Wizard" and the printer is already installed, I believe I need a driver in order for my scanner to work.
    If someone could post a 64bit driver (*.inf) for xp or vista, I can try to see if it will work it will work. (I don't think a 32bit won't work, but I don't know for sure.)
    Message Edited by Kapusky on 05-22-2009 01:15 PM

    psiwarp7 wrote:
    Sigh, I can't even make my HP PCS 500 print. I looked around for the deskjet 500 driver that HP says to use for Windows Vista 64-ultimate.
    There's a 450 440c and a 5100 but 500 went poof. If you'd interally email me the link or post here. 
    Go to the printers folder, Add Printer, Local printer, LPT1, then when the selection comes up click on "Windows Update".  This will load the updated list of available drivers.  Be patient, it can take a few minutes.  Once the list is updated you will find the HP PSC 500 listed under HP (not Hewlett-Packard) in the printers list.  You can then cancel the isntallation and just plug in the USB cable to have the plug-n-play automatically install.
    Regards,
    Bob Headrick, Microsoft MVP Printing/Imaging
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • When I print from Firefox the first page prints fine but the 2nd and proceding pages print larger and partialy off the page

    Happens anytime I print while in firfox

    Looks like you have '''Print Background (color & images)''' enabled on for all three printers you have installed, Adobe PDF included. ''I see those settings in your More system details.'' That's why you are getting the grey (monochrome Laserjet) or blue background, but that should be printed on the first page, too.
    File > Page Setup - un-check that preference

  • Trying to set up a wireless guest network using Airport base station.  The first network setup was fine but the second one doesn't work.  Any suggestions?

    I purchased the new Airport base station that allows for a wireless setup of a primary network and a guest network.  The primary network installation worked great but I cannot get the guest network to work properly.  Any suggestions on how to make it work?

    The AirPort base station is designed to connect to a simple modem......not a modem/router or gateway device that is often furnished to users by Internet Service Providers.
    So, the first troubleshooting question would be to find out what the make and model of the device that you call your "modem" might be.....to see if you have the right kind of product that will allow the Guest Network to operate correctly.

  • When Firefox tried to recover my two crashed windows, the first one was fine, but the second one only shows blank tabs, though their number is correct.

    Just as it says in the description. I've looked through solutions for similar issues, but to no avail.
    A funny thing is that in the "restore tabs" window that appeared after I tried to start Firefox again, it listed a number of my tabs among other blank tabs (of course they were not originally blank). None of these actually showed up, however. Confusing.

    HI toothandclaw,
    When you restored the window and clicked on the tabs that were blank, did the page show up? It could be that you have the do not load tabs until selected preference on. This can be changed in the Options/Preferences Menu.
    However since the session is blank, it could also be that Firefox did not close properly because of a crash or a force quit. How did you quit Firefox before the session looked like this? Could you also show a screenshot?

  • I keep trying to download firefox but the second time i click run to run the installer is said it cannot as the file is corrupt

    i click download then run and then in downloads and then i click run to run the installer then an error box comes up and says that the file is corrupt ive tried like 5 times! help!

    Temporarily disable your anti-virus application for the download process.

  • When converting PDF into pdf995 or cutepdf the first page converts fine but the second page doesn't

    Any reasons why this would be happening - thanks??

    I think you're referring to third party PDF software.
    That's not an appropriate question for this forum which is devoted to Adobe Reader for iOS.
    Refer to the support provided by the developers for those pieces of software.

  • Picking List Second time onward printing need to use diff logo

    Dear experts :
    Good afternoon, need some idea. If the customer requested the picking list, first time printing need to print logo A. But if second time onward printing (like reprint) then need to print logo B.
    The picking list is writtin in smartform.
    Any idea, how to control it ?
    Thank you very much.

    jay1981 wrote:
    I own a dvd business and would like to use it.
    //Create new DVD objects and add them to the inventory
    DVD theDVD = new DVD("Good Luck Chuck", "Comedy", "1", 10, 19.99);
    theInventoryGUI.addDVDToInventory(theDVD);
    theDVD = new DVD("The Bourne Identity", "Action Adventure", "2", 20, 15.49);
    theInventoryGUI.addDVDToInventory(theDVD);
    theDVD = new DVD("The Reaping", "Horror", "3", 13, 15.99);
    theInventoryGUI.addDVDToInventory(theDVD);
    theDVD = new DVD("Deja Vu", "Action", "4", 17, 14.49);
    theInventoryGUI.addDVDToInventory(theDVD);Bad luck if the customer wants anything other than those 4 DVD's

  • First page prints fine but subsequent pages expand beyond page border

    When I print a web page or selection that extends beyond one page, the first page prints fine, but the type size on subsequent pages is expanded so that the content extends beyond the right edge of the page. This never happened before I upgraded to Firefox 8, but now happens every time. My workaround is to print one page at a time -- very cumbersome.
    I'm printing to an HP Officejet Pro 8500. I have not changed printer settings since upgrading Firefox.

    Same problem here, but it doesn't seem to depend on the printer. Same thing happens when creating pdf files. It has started witha recent upgrade, not sure however whether this hasn't happened already with version 7. Currently I am using Firefox 8.0.1 on Mac OS X 10.6.8.

  • Unable to fetch data for the second time in an ADOBE form

    Hi All,
    I am creating a PDF form and its data is based on the output parameter of an interface, when i drag and drop an object from the data view into the body page twice, only the first time the value is getting printed and from the second time it is not printing any data.
    Kindly let me know if any one have solution for the same or if i am not clear any where.
    Thanks in advance.
    Warm Regards,
    Kasi Raaman.R

    The pbm is now solved

Maybe you are looking for

  • Duplicate attribute key in date Dimension

    Hi, I have created a date dimension using this code http://www.codeproject.com/Articles/647950/Create-and-Populate-Date-Dimension-for-Data-Wareho It contains one attribute 'Month' I have created one fact table which contains the following dates Start

  • I can't read in a date from a txt file

    Im not sure of the code needed to read in a date from the text file, this is an example of the text file: 1 2 2003 ie, day month year I have to read in this date, this is the set method for the date: public void setPurchaseDate (int d, int m, int y)

  • Extend AD Schema and configure Logon Manager

    Hi, i tried to extend schema and configure the logon manager but with no success. When i extend schema in ESSO Admin Console a successful message appear, but when i check the Active Directory for the objects that should appear, non of them are in the

  • Flickr API & crossdomain.xml

    My flickr stream is not loading onto the page. I am using the following code to make it work: Security.allowDomain("http://api.flickr.com/crossdomain.xml"); Security.loadPolicyFile("http://api.flickr.com/crossdomain.xml"); I also did always allow in

  • Call sever-side ActionScript from CFC ?

    Hello, I have two services in a same directory : serv1.CFC write with ColdFusion and serv2.asr write in Actionscript Server-Side. So I want calling a function in serv2.asr directly from a function in serv1.CFC The standard createObject("component","f