Printing forums in exact format

I have a seven page card layout Forms (combination of check box, tables, text fields and text area). I need to print the content of each page in the exact form draw check box, text area, text field and tables all with its content. What would be the exact process? Should I draw each individual component or is there a java class from SUN or 3rd party vendor to draw everything automatically? Cuz drawing each individual component will be painful. Would it be best if I first save them in a file and then send the file to the printer? But even that way I have to draw the components (checkbox, text field, area and tables) individually in the file then their content. Right?
There must be an easy way... can't be that complicated...
Would appreciate your help a lot...

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.print.*;
import java.util.Random;
public class Test extends JFrame {
    CardLayout cardLayout = new CardLayout();
    JPanel cardPanel = new JPanel(cardLayout);
    String currentPanel = "0";
    public Test() {
     setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     Container content = getContentPane();
     content.add(cardPanel, BorderLayout.CENTER);
     JPanel buttonPanel = new JPanel();
     content.add(buttonPanel, BorderLayout.SOUTH);
     for (int i=0; i<8; i++) {
         JPanel jp = new PrintablePanel("Panel "+i);
         cardPanel.add(jp, ""+i);
         JButton jb = new JButton(""+i);
         jb.setBorder(BorderFactory.createRaisedBevelBorder());
         buttonPanel.add(jb);
         jb.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
              currentPanel = ((JButton)ae.getSource()).getText();
              cardLayout.show(cardPanel, (currentPanel));
     JButton jb = new JButton("Print All");
     jb.setBorder(BorderFactory.createRaisedBevelBorder());
     buttonPanel.add(jb);
     jb.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent ae) {
          PrinterJob printJob = PrinterJob.getPrinterJob();
          if (printJob.printDialog()) {
              Component[] c = cardPanel.getComponents();
              for (int i=0; i<c.length; i++) {
               printJob.setPrintable((PrintablePanel)c);
               cardLayout.show(cardPanel, ""+i);
               try { printJob.print(); }
               catch (Exception ex) { ex.printStackTrace(); }
          cardLayout.show(cardPanel, currentPanel);
     setSize(300,300);
     show();
public static void main(String[] args) { new Test(); }
class PrintablePanel extends JPanel implements Printable {
RepaintManager currentManager = RepaintManager.currentManager(this);
private static Random r = new Random();
public PrintablePanel(String Name) {
     JLabel jl = new JLabel(Name);
     jl.setSize(100,20);
     add(jl);
     Component c=null;
     for (int i=0; i<5; i++) {
     switch (r.nextInt(4)) {
          case 0:
          c = new JTextField("Text "+r.nextInt(100)); break;
          case 1:
          c = new JLabel("Label "+r.nextInt(100)); break;
          case 2:
          c = new JTextArea("TextArea "+r.nextInt(100)+"\nand more...");
          break;
          case 3:
          c = new JTree(); break;
     add(c);
public int print(Graphics g, PageFormat pf, int pi)
               throws PrinterException {
     if (pi>0) return Printable.NO_SUCH_PAGE;
     Graphics2D g2 = (Graphics2D)g;
     g2.translate(pf.getImageableX(), pf.getImageableY());
     currentManager.setDoubleBufferingEnabled(false);
     paint(g2);
     currentManager.setDoubleBufferingEnabled(true);
     return Printable.PAGE_EXISTS;

Similar Messages

  • How to print form into pdf format using smart forms in abap

    please let me know how to print form into pdf format using smart forms in abap.
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Mar 25, 2011 2:04 PM

    Hi ,
    refer this link
    <removed by moderator>
    Regards,
    Dhina..
    Moderator message: please do not reply to questions that violate forum rules.
    Edited by: Thomas Zloch on Mar 25, 2011 2:04 PM

  • Is it possible to print a document exactly as it appears on the screen?

    Like the topic question asks, is it possible to print a document exactly as it appears on the screen? I'm fairly new to indesign and I designed my company's manual recently, taking us away from doing so in Word. I fear I may have made a very amateurish mistake and am dreading having to go back and reposition everything. Some of the problem can be alleviated if I can find a way to print the document exactly as it appears on my monitor or when I export the file to PDF.
    What's happening is the page numbering and other items I set up outside of the bleed area (I think that's what it's called...the red box that appears in each document) are refusing to print properly. I want the entire right hand corner of the page to be taken up. Currently, only part of the image is printing. If I choose "scale to fit", then the entire image prints, but it doesn't take up the entire right hand corner. Instead, the graphich repositions itself about an inch away from the edge and bottom of the document.
    Failing that, is there a blanket way to scale all items in indesign?

    In regards to the other question I asked though, is it possible to scale all the items on a page by a set amount? Say for instance I have the font too large on all of the pages in the document and the images are also a little oversized, is ther some way I can scale all of the images down a certain percentage without having to go into each item individually?
    Well, kinda. If you select everything on your page at once (or if they're already grouped)  then you can hold down Control, Shift, and Alt while grabbing a corner to resize and it'll maintain all of the ratios, including scaling the font size. You'd only be able to scale one page or spread at a time, but you could do it that way. Alternately, you can place your InDesign document into another InDesign document, where the source InDesign doc will be displayed as an image in the target doc. So, you could scale each page just like an image.
    However, I'm reluctant to advise that you do that - mostly because I don't understand what you're doing. In my understanding, everything outside of the crop marks is literally going to wiind up on the cutting room floor, so the fact that you have content like page numbers in your bleed makes no sense to me. Is it intended for the press operator who's going to be doing the cutting? We can answer your questions, but honestly I think you should describe what you're trying to achieve in the end with a bit more detail, otherwise the forums regulars will answer your questions at face value and maybe help you, or maybe just help you dig a deeper hole for yourself without realizing it.

  • How can I save a page complete so that I can take our a print later on with its complete texts and pictures.I want that the copy of the page when printed should be exactly the same with all the details.

    When save a web page and try to take out print the pictures in the web page are not coming in the print.I want to know how to save the webpage so that when I take its print it comes out in its entirety without loosing any details of the original webpage.

    If you drop down the "Save as Type" list in the Save page dialog, you have the choices of HTML only (images not saved to your computer) and HTML complete (images are saved to your computer). Neither of these is perfect.
    If you really need a record of what you see today, I suggest printing the page to PDF. There are a number of free print-to-PDF products, as well as paid ones. This isn't perfect either, because some sites look different in print than on screen, but it avoids the problem of sites changing or links breaking after your browsing session ends, etc.
    If you have an example of a page that can't be printed as it appears on the screen, you could post a URL. For example, many blogs print in an "unstyled" format.

  • How to print text in paper format iin smartforms

    Hi all,
      I want a question that  how to print text in paper format like  paper divides into 2 parts and if the firstpart is full of text i.e., it exceeds the first page the text will be displyed in the second part of the first page.
    Usefull answers will be awarded.
    Thanks all...

    Hi,
    U create two windows in the page and same as like second page.
    but in first page first window select the condition print only on first page.
    in second window select conditin print only on second page.
    first try without creating a secondpage. if that doesn't workout create secondpage and try.
    Assign points if useful.
    Regards
    (YUGANDHAR.P)

  • FAQ's, intros and memorable discussions in the ABAP Form Printing Forum

    Welcome to the SDN ABAP Form Printing Forum!
    In addition to release dependent information avalaible by:
    - pressing the F1 key on an ABAP statement,
    - or searching for them in transaction ABAPDOCU,
    - using the [SDN ABAP Development Forum Search|https://www.sdn.sap.com/irj/sdn/directforumsearch?threadid=&q=&objid=c42&daterange=all&numresults=15&rankby=10001],
    - the information accessible via the [SDN ABAP Main Wiki|https://wiki.sdn.sap.com/wiki/display/ABAP],
    - the [SAP Service Marketplace|http://service.sap.com] and see [SAP Note 192194|https://service.sap.com/sap/support/notes/192194] for search tips,
    - the 3 part [How to write guru ABAP code series|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2dac69e-0e01-0010-e2b6-81c1e8e5ce50] ... (use the search to easily find the other 2 documents...)
    ... this "sticky post" lists some threads from the ABAP forums as:
    - An introduction for new members / visitors on topics discussed in threads,
    - An introduction to how the forums are used and the quality expected,
    - A collection of some threads which provided usefull answers to questions which are frequently asked, and,
    - A collection of some memorable threads if you feel like reading some ABAP related material.
    The listed threads will be enhanced from time to time. Please feel welcome to post to [this thread|Suggestions thread for ABAP FAQ sticky; to suggest any additional inclusions.
    Note: When asking a question in the forum, please also provide sufficient information such that the question can be answered usefully, do not repeat interview-type questions, and once closed please indicate which solution was usefull - to help others who search for it.
    Form Printing
    Exporting Graphics from SAP => Download Logo from SE78, except WS_DOWNLOAD has been replaced (see the docs).
    How to check via report if a graphic exist in SE78. => Validating the existence of a graphic from ABAP.

    Welcome to the SDN ABAP Form Printing Forum!
    In addition to release dependent information avalaible by:
    - pressing the F1 key on an ABAP statement,
    - or searching for them in transaction ABAPDOCU,
    - using the [SDN ABAP Development Forum Search|https://www.sdn.sap.com/irj/sdn/directforumsearch?threadid=&q=&objid=c42&daterange=all&numresults=15&rankby=10001],
    - the information accessible via the [SDN ABAP Main Wiki|https://wiki.sdn.sap.com/wiki/display/ABAP],
    - the [SAP Service Marketplace|http://service.sap.com] and see [SAP Note 192194|https://service.sap.com/sap/support/notes/192194] for search tips,
    - the 3 part [How to write guru ABAP code series|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2dac69e-0e01-0010-e2b6-81c1e8e5ce50] ... (use the search to easily find the other 2 documents...)
    ... this "sticky post" lists some threads from the ABAP forums as:
    - An introduction for new members / visitors on topics discussed in threads,
    - An introduction to how the forums are used and the quality expected,
    - A collection of some threads which provided usefull answers to questions which are frequently asked, and,
    - A collection of some memorable threads if you feel like reading some ABAP related material.
    The listed threads will be enhanced from time to time. Please feel welcome to post to [this thread|Suggestions thread for ABAP FAQ sticky; to suggest any additional inclusions.
    Note: When asking a question in the forum, please also provide sufficient information such that the question can be answered usefully, do not repeat interview-type questions, and once closed please indicate which solution was usefull - to help others who search for it.
    Form Printing
    Exporting Graphics from SAP => Download Logo from SE78, except WS_DOWNLOAD has been replaced (see the docs).
    How to check via report if a graphic exist in SE78. => Validating the existence of a graphic from ABAP.

  • How does one print to a Large Format Network Printer in Adobe Reader X?

    I have just installed Adobe Reader X on a machine that previously had Adobe Reader 9 (I had to format the hard drive so this is a fresh installation).  When attempting to print to a large format Printer (36x24) across the network I cannot change the paper size.  Despite attempting to change the paper size to a number of different configurations Adobe X will not print anything but 8.5"x11.0" (which is the default paper size on the local printer).  I have tried making the network printer the default printer and that does not make any difference.  Everything worked fine with Adobe Reader 9 but not X.  Can anyone offer any suggestions?
    Also, I can print to both the local printer and the large format network printer fine through other applications.
    Thanks.
    Ben

    Just finished testing 10.10 printing via a Windows 2008 R2 print share. I also found that when trying to add the printer using CUPS I would get an authentication error. But if I added the printer using the Windows section of the Add printer pane, then I was able to print fine.
    So with you mentioning that using the Windows section of the Add printer window has never worked (which is interesting because it's always worked for me) I want to suggest another approach to adding the printer, still using the Add printer window. With this window open you can right-click on the toolbar and select Customize Toolbar. You can then drag the Advanced icon to the toolbar. Then when you select this, you can set the Type menu to "Windows via spoolss" and then enter the URL as smb://servername/sharename. Select the supporting driver and click Add to complete.
    Then when you select to print for the first time using this printer you will be prompted to authenticate. Enter the account details, set the save to Keychain option and OK to send the print job.
    This worked fine for me and creates the same queue as using the Windows add printer setting. Curious to hear if this gets your co-worker printing again.

  • Print script in pdf format

    Hi all,
    I have a script and i need to print it in pdf format ,right now its printing in orginal or normal .Please let me know what i should do in order to print it in pdf form, i don't want to save it somewhere and then print it,i need to print it directly rather than saving it.
    Any help would be greatly appreciated
    Thanks
    deepthi

    hi,
    can anyone check the code and tell me what iam missing
    I don't want to save the pdf file i want to print it or see it under print preview.
    WAITING FOR REPLIES
    DATA: PDFTAB TYPE TABLE OF TLINE WITH HEADER LINE,
    DATATAB TYPE TABLE OF ITCOO WITH HEADER LINE.
    DATA: BINFILESIZE TYPE I,
    FILE_NAME TYPE STRING,
    FILE_PATH TYPE STRING,
    FULL_PATH TYPE STRING.
    data: begin of itcpp.
            include structure itcpo.
    data: end of itcpp.
    itcpp-tdcopies = 1.
    itcpp-tdimmed  = 'X'.
    itcpp-tddelete = 'X'.
    itcpp-tdnewid  = ' '.
    ITCPP-tddest = 'LP01'.
    ITCPP-tdgetotf = 'X'.
    itcpp-tdpreview = 'X'.
    Call function 'OPEN_FORM'
          exporting
            device                            = 'PRINTER'
            dialog                            = 'X'
           form                              = 'ZZ_PICK_LIST '
            form                              = space
            language                          = sy-langu
            options                           = itcpp.
    call function 'START_FORM'
             exporting
             ARCHIVE_INDEX          =
               form                   = 'ZTEST'
             LANGUAGE               = ' '
             STARTPAGE              = ' '
             PROGRAM                = ' '
             MAIL_APPL_OBJECT       =
           IMPORTING
             LANGUAGE               =
           EXCEPTIONS
             FORM                   = 1
             FORMAT                 = 2
             UNENDED                = 3
             UNOPENED               = 4
             UNUSED                 = 5
             SPOOL_ERROR            = 6
             OTHERS                 = 7
    LOOP AT ITAB.
    call function 'WRITE_FORM'
            exporting
            element                        = 'HEAD'
            function                       = 'SET'
            window                         = 'MAIN'
    ENDLOOP.
    CALL FUNCTION 'CLOSE_FORM'
       IMPORTING
         RESULT                         = itcpp
         RDI_RESULT                     =
       TABLES
          OTFDATA                        = DATATAB[]
        EXCEPTIONS
          UNOPENED                       = 1
          BAD_PAGEFORMAT_FOR_PRINT       = 2
          SEND_ERROR                     = 3
          SPOOL_ERROR                    = 4
          OTHERS                         = 5
       IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
          FORMAT                      = 'PDF'
          MAX_LINEWIDTH               = 132
         ARCHIVE_INDEX               = ' '
        IMPORTING
          BIN_FILESIZE                = BINFILESIZE
         TABLES
           OTF                         = DATATAB[]
           LINES                       = PDFTAB[]
        EXCEPTIONS
          ERR_MAX_LINEWIDTH           = 1
          ERR_FORMAT                  = 2
          ERR_CONV_NOT_POSSIBLE       = 3
          OTHERS                      = 4
       IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    *ENDIF.

  • How To Generate And Print Reports In PDF Format From EBS With The UTF8 Char

    Hi,
    I want to know How To Generate And Print Reports In PDF Format From EBS With The UTF8 Character Set in R12.0.4.
    Regards

    Refer to Note: 239196.1 - PASTA 3.0 Release Information
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=239196.1
    Or, you can use XML Publisher.
    Note: 551591.1 - Need Latest XML Publisher / BI Publisher Patches For R12
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=551591.1

  • Retain exact format of XML Document

    Hi
    I am trying to search for a particular value in an XML Document and replace with the value given by the user and write back the XML document, using xerces parser with jdk1.4.
    I am successfull in doing this. But i am losing the exact format of my original document. basically all the attributes in all tags are getting sorted alphabetically.
    for e.g <test NAME ="myname" LEVEL ="0" HIDDEN ="NO" DATATYPE ="char" />
    my output xml looks like this
    <test DATATYPE ="char" HIDDEN ="NO" LEVEL ="0" NAME ="myname" />
    how to retain the same format. Any help?

    Since the order of attributes is specifically defined as not important in the XML definition, why do you care.
    There is no requirement for any parser to present the attributes in the same order they are coded -- they can either be in sequential order or any other order that is convenient.
    I guess my question would be why is it a problem that the sequence is different?
    Dave Patterson

  • Wide format printing with Officejet7610 wide format printer

    When setting up a print job needing 13" x 19" paper (A3+ paper size ), there is NO 13" x 19" (or A3+) paper size to select in the drop down list of paper sizes. The size doesn't seem to be recognized and yet the printer is a wide format printer and says it will handle up to 13" x 19" paper. I have tried printing out of Photoshop Elements, Picasa, and Windows Photo Viewer. There is no 13" x 19" paper size category.  Whats happening here? Why can't I use a paper size that this HP 7610 wide format is supposed to handle? Thanks to all.

    I have that same question with an Officejet 7000 Wide Format printer

  • Printer not selectable from drop down when printing any pdf file. Printer is available when printing any other file format.

    Client is running Adobe Acrobat X. When trying to print their Ricoh printer can not be seen in the drop down menu. The Printer was added locally and the printer can print any other file format.

    Your ps file should be good, the problem likely resides elswehere. Maybe in your acrobat install, distillers settings. what error did distiller give?
    Mine ran good and got a multi page document, here is a screenshot to help you troubleshoot.
    On mac go to system preferences / print and fax / and change your default printer if you have another option. I know sounds like this should not help, but there are problems like Illustrator for example not making .pdfs if you do not have a printer chosen or an old or corrupt .ppd assigned.

  • HT4168 I have written a family history in Pages format that I would like to have printed in hard copy format to give to my family. Any suggestions as to to do that?

    I have written a family history in Pages format that I would like to have printed in hard copy format to give to my family. Any suggestions as to to do that?

    Try a google search on "self publish" to find things like
    http://www.lulu.com/publish/books/

  • Printing 4 x 6 format

    I've recently tried to print photographs using 4x6 paper. With both an HP PSC 1510 and an Epson Picture Mate I am unable to print when selecting 4x6 format from either the menu or by creating the size as a custom paper size from the print functions menus. Have tried using Photoshop CS and iPhoto with the same results. The file is sent to the printer and the printer seems to reject the file due to the size.
    By selecting letter size paper both printers will generate prints but either print a small image on the 4x6 paper or print a section of a letter size image on the paper.
    Any thoughts on resolving this?
    Thanks

    You might want to go to File - Page Setup and make sure the printer you are using is selected. Do this just before you print. Its worth a try. It works on some of my programs.

  • How to Print in the desired format

    Hi, I'm pretty new to this site. I've some problem in printing out in the format that i was looking to.
    for(i=0;i<3;i++)
    for(j=0;j<3;j++)
    if(a==0)
    out[i][j]=3;
    }//end of if
    if(a==1)
    out1[i][j]=2;
    }//end of if
    }//end of j
    }//end of ii had some kind of coding for that 'a' value to change from 0 to 1
    Upon doing all the kind of computations the data that is present is out[][] array is as follows:
    3 3 3 3 3
    3 3 3 3 3
    3 3 3 3 3
    3 3 3 3 3the data that is present is out1[][] array is as follows:
    2 2 2 2 2
    2 2 2 2 2
    2 2 2 2 2
    2 2 2 2 2now that I want to print the output as follows:
    3 2 3 2 3 2 3 2 3 2
    3 2 3 2 3 2 3 2 3 2
    3 2 3 2 3 2 3 2 3 2
    3 2 3 2 3 2 3 2 3 2that is the way i like the output to be printed is: Upon printing all the rows of the 1st column of out[][] array, i need all the rows of 1st column of out1[][] array to print. This process continues all the columns of both arrays were printed.
    is there any way to print that way. is there a possibility to print that way.
    Any advice is appreciated. :)
    Thanks in advance
    Edited by: netbeans2eclipse on Sep 8, 2008 9:41 AM
    Edited by: netbeans2eclipse on Sep 8, 2008 9:42 AM
    Edited by: netbeans2eclipse on Sep 8, 2008 9:43 AM

    View the problem like this : print the elements of out[][] and out1[][] alternatively. i.e.
    print an element of out[0][0]
    print an element of out1[0][0]
    print an element of out[0][1]
    print an element of out1[0][1]....
    Something like this :
    I have not tested the code. So you may need some modification to logic.
    for(i=0;i<3;i++)
             for(j=0;j<3;j++)
                     System.out.print(out[i][j]);
                     System.out.print(" "+out1[i][j]);
    }

Maybe you are looking for

  • Two vendor payment against single stage

    Hi I have assigned different partner function for a stage under PARTNER tab in shipment document.My route is direct it has only one leg or stage .Now i want to make different payment for these two vendors .When I am doing VI01 SAP is calculating cost

  • Use backup from 3.1.3 in iOS 5?

    Hi, Is is possible to use a backup from iPhone 3G 3.1.3 on a new iPhone 4S 5.0? I know these jumps has been an issue before. br Anders

  • Archive File --File Adapter

    Hi All, I am using file adapter to Archive File. In Processing mode i have set as Archive and also selected the Add Time stamp checkbox. Now the file is being archived with timestamp being added. EX : 20061204-143518-299abc.txt I want to send the fil

  • PSE 9 install on Windows 7 (32 bit) fails due to "shared technologies"

    I'm installing this older version of elements because it came bundled with an Epson scanner that I just purchased. The install works fine on other computers running Windows 7. My computer also has the following Adobe products loaded: Acrobat Pro 9 Ac

  • Change language for Polish

    I know how to change language in the document. But always when I open pages I have to do that. I have to start working from change the language from english to polish. I checked my settings and in my system preferences I have polish everywhere. What