Printing on paper without spaces ?

Sir,
I have a problem with printing the page of course it is printing the page without any problem but the problem does exists in the setup.I have used the code provided in the forum for printing.Where here when the printing is on, the printer starts the printing after leaving
some spaces. But i want to print the page from where i start(from where i insert the paper).I have used the following code for printing.Here i couldn't find out where i need to make the changes.So,pls. do help me in this regard.I will be so thankful to u.
My code is:-
public int print(Graphics g, PageFormat pageFormat,int pageIndex) throws PrinterException
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.black);
g2.setFont(fnt);
int fontHeight=g2.getFontMetrics().getHeight();
int fontDesent=g2.getFontMetrics().getDescent();
//leave room for page number
double pageHeight = pageFormat.getImageableHeight()-fontHeight;
double pageWidth = pageFormat.getImageableWidth();
double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
double scale = 1;
if (tableWidth >= pageWidth) {
scale = pageWidth / tableWidth;
double headerHeightOnPage=
tableView.getTableHeader().getHeight()*scale;
double tableWidthOnPage=tableWidth*scale;
double oneRowHeight=(tableView.getRowHeight()+
tableView.getRowMargin())*scale;
int numRowsOnAPage=
(int)((pageHeight-headerHeightOnPage)/oneRowHeight);
double pageHeightForTable=oneRowHeight*numRowsOnAPage;
int totalNumPages= (int)Math.ceil((
(double)tableView.getRowCount())/numRowsOnAPage);
if(pageIndex>=totalNumPages)
return NO_SUCH_PAGE;
g2.translate(pageFormat.getImageableX(),
pageFormat.getImageableY());
g2.drawString("Page: "+(pageIndex+1),(int)pageWidth/2-35, //For printing the page no. at the bottom
(int)(pageHeight+fontHeight-fontDesent));//bottom center
g2.translate(0f,headerHeightOnPage);
g2.translate(0f,-pageIndex*pageHeightForTable);
//If this piece of the table is smaller than the size available,
//clip to the appropriate bounds.
if (pageIndex + 1 == totalNumPages)
int lastRowPrinted = numRowsOnAPage * pageIndex;
int numRowsLeft = tableView.getRowCount() - lastRowPrinted;
g2.setClip(0, (int)(pageHeightForTable * pageIndex),
(int) Math.ceil(tableWidthOnPage),
(int) Math.ceil(oneRowHeight * numRowsLeft));
//else clip to the entire area available.
else{
g2.setClip(0, (int)(pageHeightForTable*pageIndex),
(int) Math.ceil(tableWidthOnPage),
(int) Math.ceil(pageHeightForTable));
g2.scale(scale,scale);
tableView.paint(g2);
g2.scale(1/scale,1/scale);
g2.translate(0f,pageIndex*pageHeightForTable);
g2.translate(0f, -headerHeightOnPage);
g2.setClip(0, 0,(int) Math.ceil(tableWidthOnPage),
(int)Math.ceil(headerHeightOnPage));
g2.scale(scale,scale);
tableView.getTableHeader().paint(g2);//paint header at top
return Printable.PAGE_EXISTS;
Thanx,
m.ananthu

i believe that there are hardware constraings on this, for example when you use microsoft word there is a minimum size for the margiens, so i believe that there are limitations. There are methods in the printing api to find out just how much of the page you can and can't print on, as well as how big the page is
check out the api documentation
hope this helps
webaf409java

Similar Messages

  • Tutorial: Print index cards without removing paper from tray for Officejet Pro 8000.

    The HP Officejet Pro 8000 and Officejet Pro 8000 wireless do not have a slot for inserting index cards and envelopes.
    If you are wanting to print index cards without removing the paper from the tray, follow these steps.
    The steps below are for 3 x 5 index cards.
    1.) Open Microsoft Word
    2.) Go to the Insert tab and insert a rectangle shape
    3.) Draw a rectangle of any size
    4.) Right click on the rectangle and select "Format Autoshape..."
    5.) Under the Size tab, enter 5" for the height and 3" for the width (make sure "Absolute" is selected)
    6.) Under the Layout tab, select "Center" for the horizontal alignment
    7.) Click OK
    8.) Use the keyboard up arrow key to move the rectangle to the top of the page.  Make sure the top edge of the rectangle touches the top edge of the document.
    9.) Print this document on plain 8.5" x 11" paper
    10.) When you want to print an index card, place this 8.5x11 document in the paper tray printed side face up.  Then place an index card over the rectangle and align with the border of the rectangle.  After you print the index card, remove the 8.5x11 paper for the next time you need to print an index card.
    Note 1: This are USA instructions.  If you live in the UK or other countries you may have different paper size standards.

    I can't tell you how much I HATE this printer.  I will never buy an HP product again.  BROTHERS printers are simply and easy to use.

  • My Labels Print without spaces ?

    I am printing avery labels that were produced by the "label assistant.
    All good... except when I print the label items print without spaces.
    Like This:
    JamesHammil
    123MainStreet
    AlbuquerqueNM87111
    Any Ideas how to fix this?

    Duuuu I figured it out.
    Sorry

  • How to AUTO print DMS with Shop Paper without 3rd party software?

    Since standard SAP cannot AUTOMATICALLY print DMS with shop paper.
    Is there a way to AUTOMATICALLY print DMS with shop paper without using 3rd party software ?  I've heard that there's a user exit or Function Modules that we can use so this will be possible. We don't really want to deal with 3rd party software if we can avoid it.
    Has anyone resolved this problem without using 3rd party software?
    Thank you,
    Sam

    It would easier to get an ABAPER to debug the manual process and then use those function modules etc in the modified program.
    The ability to print attached documents exists as a manual process of navigate and click, the process is as follows:
    1.     Access transaction IW32 (or IW33).
    2.     Enter order number (initial screen).
    3.     Click enter (change order central header screen).
    4.     Select the operations tab page (change order operation overview screen).
    5.     Select the relevant operation (change order operation overview screen).
    6.     Click the PRT icon (change order operation overview screen).
    7.     Select the PRT (PRT list of operation screen).
    8.     Click the PRT display button (PRT list of operation screen).
    9.     Click the print button (display document screen).
    The process prerequisites are:
    •     Work order created with assigned PRT document.
    •     PRT documents.
    •     DMS configuration to allow document to be opened and printed.

  • I am trying to delete pages I have crated in numbers, but can only see them in print preview. Without print preview I do not see them. How can I delete these pages, but keep others before and after?

    I am trying to delete pages I have crated in numbers, but can only see them in print preview. Without print preview I do not see them. How can I delete these pages, but keep others before and after?

    Hi Crushed,
    Numbers doesn't have pages. It has a canvas that holds objects such as tables and charts.
    Drag the objects from the bottom of the canvas onto the white space above. That will reduce the number of "pages" (sheets of paper) that will print.
    Regards,
    Ian.

  • How to: if email empty, print by paper?

    Hello Gurus,
    Using the forum posts, I have implemented sending dunning letters per email.
    I want that if the debitor email address is empty then the dunning letter is printed by paper.
    I tried modifiyng user exit EXIT_SAPF150D_001 so that if the email address is empty, the output device is set to '1', that is printer: FINAA-NACHA = '1'
    So I create a dunning run (F150) as usual, selects the ouput device 'EMAIL' (created for email output)
    For customers without email address, there is a spool request created but it does not come out of the printer, it still contains the original output device 'EMAIL'. I don't know if I need more coding in the user exit or...
    Thank you for your help.
    Alex-

    Hello,
    I solved my problem the following way:
    - not use a specific EMAIL output device
    - use the usual paper printer device but in the user exit, add such code:
    IF T047E-LISTN = 'NET'.      "Internet für die Mahnstufe gewünscht
      IF SAVE_INTAD NE SPACE.    "Internetadresse gepflegt
        FINAA-NACHA = 'I'.       "Ausgabe über Internet
        FINAA-INTAD = SAVE_INTAD.
        FINAA-TEXTF = 'PDF'.
      ELSE.
        FINAA-NACHA = '1'.                 "Ausgabe auf Drucker
      ENDIF.
    ELSE.
      IF T047E-LISTN = 'FAX'               "Fax für die Mahnstufe gewünscht
    The first test (T047E-LISTN = 'NET') is an attribure of the dunning form: T.code FBMA --> dunning texts.

  • How can I print a booklet without a white outline around the border?

    How can I print a booklet without a white outline around the border? I'd like the front page to be covered entirely.

    You either need a borderless printer, or you have to print on oversize paper and trim off the bleed.

  • Incorrect Number of Pages Printing - Custom Paper Size

    Hello Everyone,
    I am new to Crystal Reports but have recently become responsible for supporting a report that my office has been using for several years.  We utilize a fairly simple Crystal Report to create temporary and guest parking passes in the parking services department of my University.  These passes simply take some data from our internal database and add the current and calculated expiration dates - again, pretty simple.  These passes are then printed on a custom paper stock roughly the size of a #10 envelope that has a hole in the paper to hang around a car's rear view mirror.  This solution has been working for years but we have recently run into a very annoying problem.
    The passes are being printed from our four customer service computers.  Each computer is identical - an HP dc7900 workstation running Windows XP SP3 and Crystal Reports 11.  The computers also have identical printers; HP DeskJet 6940s.  A couple of weeks ago the customer service representatives who handle the parking passes started experiencing a problem.  When they would print a the report (the temporary or guest pass) the printer would occasionally pick up the custom page, make a strange grinding noise, and spit the page out without printing.  It was only by putting the paper back in a second or third time that the pass would actually print.  This problem seems to happen randomly with some people experiencing the problem more than others.
    Like I mentioned before, this method of creating the passes has been working for several years.  We have been using the same Crystal Report and the same printers.  One of the four CSRs has not experienced any problems with her printing - the passes come out of the printer correctly every time.  Other CSRs are able to specify only printing page 1 and the pass will print correctly; even though it is only a one page report to start with.  There is only one CSR who has the problem most frequently - about 80% of the time - and she cannot use the "print page 1" technique.  We have tried to figure out what sets her apart from the others but they should all have identical machines.
    In troubleshooting the problem I have attempted everything I could think of.  Our first thought was to clean the printer or swap it out with a spare, but this did not solve the problem.  Since it was happening on multiple computers, we thought the report was to blame.  We checked to make sure all of the data was fitting withing the margins, there were no extra sections or section breaks, and that the report had not been corrupted somehow.  We also tried to create a new report from scratch - again none of these actions helped.  I then tried to upgrade one computer to all of the latest updates available for Crystal Reports 11 from the website.  These updates did not solve the problem either.  The final straw was to re-image the computer to a known good state, but this did not help.
    Since we are still not sure of the root cause of the problem I have posted a similar topic on HP's customer support forum.  I was hoping that someone in the Crystal Reports community may have some insight into my problems as well.  I have searched through the forums previously and that's where I got many ideas including updating, checking for hidden/over sized text, changing the print engine, and turning of Data Execution Prevention.  However, none of these suggestions improved our situation.  Does anyone have any insights as to what could be causing our problem?  It is getting very annoying for the CSRs and I feel bad that I have not been able to come up with a solution for them.
    To recap, here are my environment specifications:
    -Crystal Reports 11
    -Windows XP Service Pack 3 + all available Windows Updates
    -HP dc7900 Workstations
    -HP DeskJet 6940 printers connected through USB
    -Microsoft Office 2007
    -McAfee Anti-Virus 8.7i
    I appreciate any help or guidance anyone can provide.  Thank you in advance for your support.
    Jeff

    The "strange grinding noise" leads me to believe it is the printer or paper stock.  I know you said you changed printers, but did you swap the printer having the problem with the one that never does?  My HP color laserjet makes a strange grinding noise now that the fuser needs to be replaced (which I will be doing this weekend).  Usually the louder the noise, the worse the printout looks...
    Nothing in Crystal should cause a printer noise...
    HTH,
    Carl

  • How do I print a pdf without the standard crop marks that appear when I have created it in Illustrator originally?

    Hi
    I am so frustrated as I cannot work out why my pdf files that I have created in Illustrator, print out on my printer with crop marks as well as scaling the image to fit them in on the paper. I just want to be able to print it out without the crop marks at the correct and original size it was designed in.
    Help Please.

    The crop marks are part of the design, no reason why Acrobat wouldn't print them. You could try cropping them out in Acrobat.

  • URGENT -- Printing reports adds extra spaces in between pages

    Hello Experts,
    I would like to ask for your help regarding printing from concurrent requests.
    I am currently having an issue with printing multiple pages from Oracle reports, both in text format and RTF/PDF formats.
    When I generate a multiple page report and print it directly from a concurrent request, print outs generate extra space after each page even though page size is indicated in the reports (all of them are in letter size).
    I have already tried editing the printer drivers both the actual driver config file and through the application but the results are still the same.
    This is very important since printing is done on continuous paper and continuous pre-printed forms
    Any ideas would be greatly appreciated.
    Regards,
    Jovelyn

    Please post the details of the application release, database version and OS.
    I would like to ask for your help regarding printing from concurrent requests.
    I am currently having an issue with printing multiple pages from Oracle reports, both in text format and RTF/PDF formats.
    When I generate a multiple page report and print it directly from a concurrent request, print outs generate extra space after each page even though page size is indicated in the reports (all of them are in letter size).What if you print the output file from the OS, can you reproduce the issue then?
    Troubleshooting (Printing) [ID 104528.1]
    An Extra Empty Page Is Printed at the End of Requests Output [ID 1011499.7]
    I have already tried editing the printer drivers both the actual driver config file and through the application but the results are still the same.Can you reproduce the issue with other printers?
    This is very important since printing is done on continuous paper and continuous pre-printed forms
    Any ideas would be greatly appreciated.If the issue is urgent, please log a SR.
    Thanks,
    Hussein

  • How do I select to print a document without margins?

    How do I select to print a document without margins?

    fieldhockey,
    The printer driver is the software that drives the printer.
    You can File>Print Setup, then select the printer (driver) by its name in the dropdown list. Note that there may be different drivers for one and the same printer (such as PostScript and non PostScript, borderless and non borderless).
    Choosing a borderless printer (driver) the printable area should be identical to the Artboard (with no dotted line inside to show the boundary between printable area and paper edge).

  • OfficeJet Pro 8600 no longer can print #10 envelopes without mangling them

    I've had this printer for a year or two. It used to print #10 envelopes without a problem. Recently it has started mangling envelopes, at first just once in a while, by now it mangles every envelope. These are envelopes that meet all the requirements (no window, etc.). What's the problem and how do I fix it?

    Hi @TaglineJim, 
    I see by your post that the envelopes are getting mangled. I can help you with this.
    Here are a couple of documents that should be helpful in resolving this issue.
    Printer Paper Tears, Wrinkles, or is Damaged while Printing from the All-in-One.
    A 'Paper Jam' Message Displays on the Printer.
    Usually cleaning the rollers will help with this issue.
    I would check the position and clean the pick up roller also. Skip to Solution four: Clean the paper rollers.
    An 'Out of Paper' or 'Pick Motor Stalled' Message Displays, and the Printer Does Not Pick Up or Feed... Check the paper settings in the print driver to make sure they match, in Solution five: Adjust the paper settings in the print driver.
    Do you have the same issue with other types of paper?
    If you need further assistance, just let me know.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Printing individual slides without border problems

    Hello,
    I'm trying to print out my slides that I have created in Keynote 9 so each slide will print to A4 width x height constraints(842x595 pixels). I wish to print the slides WITHOUT a border because the slide background has a colour right to the edge of the slide. When I go the print dialogue box, I uncheck ALL options so the preview contains no borders, margins, the slide will print to the edge of the page... great! But.... oh no, wait...... it's not that easy... when I print my fabulous design a border/margin of about 0.5cm all around the sides appear! It's even worse for my client who sees different margins when they print it on their printer. Yes, paper in printer is properly aligned.
    Thoughts on why my document has margins appended to all sides when I print is MOST welcome, and how I can stop this will be even MORE welcome.
    Cheers

    File > Page-Setup > Layout > A4 borderless (admitedly, not all printers will facilitate borderless but at least the template will facilitate it if the option is detected. (thanks Jerry)

  • When i print , the paper is clear

    G.M
    i get a new printer before 6 month
    to day , when i try to print some paper , the paper was out to me clear 
    no words , no letter , no color also ...
    the inks is new .
    my printer is Diskjet 4615 .
    thank you .
    hazem
    kingdom of saudi arabia .
    [edited email by Moderator]

    Hi @hzooooom ,
    Thank you for visiting the HP Support Forums. I needed to edit your post and remove the Serial Number. From our Rules of Participation:
    Protect privacy - yours and others'. Don't share anything about yourself that you would not want to see on a road-side billboard. Don't post contact or other personal information-your own or anyone else's-or any content that you receive in one-to-one communications without the author's consent. For example, don’t post your computer’s serial # or contact information publicly, and do not allow someone you don’t know to remotely take control of your computer.
    If you need people to contact you directly, either ask them to send you a private message or subscribe to the thread so you will be notified when there are replies. You may also click on your name anywhere in the forum and you will be taken to your profile page, where you can find a list of threads you have participated in.
    Sharing personal email addresses, telephone numbers, and last names is not allowed for your safety. If you have any questions feel free to send me a private message in reply.
    Thank you
    George
    I work for HP

  • C4380 printer: Feeding paper problem

    Using the HP Photosmart C4380 printer, I load the paper properly, no problems, then as the paper feeds into the printer, the paper veers to the right and jams. HELP!

     This video shows how to resolve a carriage jam for the HP Photosmart C4280.  The steps in that video will address paper jams as well.  If you get the 'service the printer' statement without resolving the problem, you are probably at a point where the printer needs to be replaced.  It's probably worth your time to contact HP to see what your service options are. 
    I am an HP employee.

Maybe you are looking for

  • Can't see video display in color

    I'm new to color and I can't seem to see my video playback. The video output setting comes up disabled and won't let me choose a display. Everything is grayed out. How do I get it so I can see my playback above the scopes? I'm working in standard def

  • IR, RWB,SLD - Opening in English & ID in German

    Dear all, The XI Server which we are using has a peculiar problem. IR, RWB, SLD and all other applications open in English, where as Integration Directory (ID) opens up in German. What could be the problem here? Can anyone guide me with the step by s

  • Lost access to Jam Pack instruments after migration to new macbook pro

    I just migrated to a Macbook Pro and now all the instruments from my Symphony Orchestra Jam Pack are no longer available. I was also getting a message "Native Instruments Installation Folder not found" but after copying the instrument files into the

  • Gestures in Mountain Lion

    Hello to everybody, do you know if in mountain lion there is a way (without installing a third part software) to reintroduce the gestures with 4 fingers: slide 4 fingers up=show desktop slide 4 finger horizontally= show all the open applications (the

  • HP ProBook 470 G2 switching video IntelGraphics with AMD Radeon R5 M255

    Notebook HP ProBook 470 G2 - OS Windows 8.1 Pro Although the device manager appears R5 M255 AMD Radeon video card, display adapter option only appears in Intel Graphics. Mention that was installed on the HP website driver AMD Hybrid Graphics Video Dr