Huge Collections of Software Manuals and Knowledgebase

GreatManuals.com
Huge Collections of Software Manuals and Knowledgebase

 
Home Contact us Request to publish your help manuals Request to remove your help manuals Buy Now
Introduction
» J2PrinterWorks
» Print Samples and Screen Shots
» Sample Programs and Sample Code
» Installing and Uninstalling
» Pageable and Flowable
Using J2PrinterWorks
» J2Printer
» J2Printer14
» J2PrinterWebStart
» J2TextPrinter
» J2TablePrinter
» J2TreePrinter
» J2ListPrinter
» J2PanelPrinter
» J2ComponentPrinter
» J2FlowPrinter
» Working with HTML
» Utility Classes
» Converting from 1.x
» Class Diagram
» Removed Methods
Support Details
» Known Problems and Bug Reporting
» Frequently Asked Questions
» Technical Support
 
Buy J2PrinterWorks Online! Buy J2PrinterWorks Online!

Frequently Asked Questions

General

Q1: Was there a J2PrinterWorks 1.0?
A: No. J2PrinterWorks is the successor product to our earlier products J2TextPrinter and J2TablePrinter, which were both released as versions 1.0, 1.1, 1.2, and 1.3. The J2TextPrinter and J2TablePrinter classes within J2PrinterWorks were the 2.0 versions of the earlier J2TextPrinter and J2TablePrinter products, so it made sense to number the initial release of J2PrinterWorks to be 2.0 as well.

Q2: Is the "J2PrinterWorks Text Edition the same as the "J2PrinterWorks, J2TextPrinter Edition"?
A: Yes. When J2PrinterWorks 2.0 first came out, we used the name J2PrinterWorks, J2TextPrinter Edition, to make explicit the relationship to the earlier J2TextPrinter 1.x product. As of J2PrinterWorks 3.0, we have simplified the name to J2PrinterWorks Text Edition. Similarly, the new name for the J2PrinterWorks, J2TablePrinter Edition, is J2PrinterWorks Table Edition.

Q3: How do I convert my code to J2PrinterWorks from J2TextPrinter 1.x or J2TablePrinter 1.x?
A: See "Converting from 1.x" section of this documentation.

Q4: Does my component need to be on the screen in order to print?
A: For Swing components, it is not necessary that your JTextPane, JTable, JTree, JList, JPanel, etc. be in a JFrame visible on the screen at the time of printing or to have ever been displayed at all (however, this is not necessarily true for third-party components, see below J2PanelPrinter Q8). You may be printing from a server application and have no display. Or you may have, for example, a JTextPane displayed but wish to print from a different non-GUI copy of the JTextPane. The latter situation can arise when you want to set the printing JTextPane properties different from your on-screen JTextPane display, such as to force white backgrounds, different page width, borders, or fonts appropriate for a printed page. In such cases, you can use code like:
JTextPane pane2 = new JTextPane();
pane2.setStyledDocument(pane1.getStyledDocument());
pane2.setSize(pane2.getPreferredSize()); // setting a size is required
printer.print(new J2TextPrinter(pane2));
Even if you do use a JFrame, you can still specify JFrame.setVisible(false) so it does not appear on the screen, or alternatively JFrame.setLocation(10000,10000) to move it off-screen.

repair digital camera photos recovery undelete usb files
best data recovery software data recovery utility downloads send group sms
flash drive restore recover usb drive data restore usb drive files

Q5: How do I control the size of my printed components?
A: Either get them drawn on the screen explicitly with the sizes you want, or setPreferredSize (not setSize) for your components, which J2PrinterWorks will use to determine their sizes. If your components are not displayed, J2PrinterWorks internally puts your component in a non-visible JFrame and calls pack(), which Java redraws based on the preferred sizes of your components.

Q6: Can I build a web page that prints on the user's printer?
A: Yes, but there are multiple issues you need to be aware of. First, you can build a server-side application that prints, but it can only print on printers known to the server machine, which may or may not include the printer desired by your user. To print on the user's printer, the appropriate technique is to build an applet which downloads to the user's machine and prints on the printers known to the user's machine. However, Java specifies that it is a security violation to print from a regular (untrusted) applet, just as it is a security violation for an applet to read or write files on the user's machine. As a result, Java will automatically prompt the user with "An applet would like to print. Is this OK?", so the user can say "yes" or "no". In order to print from an applet without this prompt, you need to "sign" your applet or set up the security policy on the user's machine to grant your applet the printing privilege (see "How do I sign an applet" under Miscellaneous ).

Another consideration is that J2PrinterWorks uses the Java 2 printing model, that is, it requires JDK 1.2 or later. Therefore you need to assure that your user's browser has a Java plug-in for JDK 1.2 or later. This is generally true for recent most recent verions of most popular browsers. If the user's browser does not have the Java plug-in for JDK 1.2 or later, it is readily available by free download from Sun, and it is possible to configure your web page so that it offers to download and install the Java 2 plug-in if it is detected that the user's browser does not have it.

Alternatives to using a Java applet to print are to install a regular Java application on the user's machine, or to download and use a Java Web Start application on the user's machine.

Q7: Is J2PrinterWorks a report generator?
A: Not really. J2PrinterWorks is a solution for printing the contents of Java components and assumes you wish to define and arrange these yourself to create a document or report representing your data. A true report generator is a tool that will take your data and use it to create and arrange components with specific contents for you, such as forms, reports, charts, etc. There are several Java report generator solutions in the marketplace such as InetSoft Style Report, Elixir Report, or Big Faceless Report Generator that you may prefer to buy (though report generators tend to be expensive). But if you already have or can readily produce the report document you want using Java components, J2PrinterWorks is the ideal solution for printing it out.

Q8: Since Java has a printing API, what do I need J2PrinterWorks for, can't I just do all this myself?
A: Sure. But be forewarned that Java printing is an elaborate, complex API that's not easy to use, with many subtle nuances to making it work right. In addition, there is essentially no support for breaking your content properly over page boundaries or combining Java components into a single document, not to mention headers, footers, margins, print preview, background printing, etc. etc. You won't find all that many books, articles, or sample programs out there to help you, especially when you move beyond the basics. In addition, printing is likely not the primary goal of your application and is something often left until the end when you then discover just how hard it is. J2PrinterWorks represents thousands of lines of code you really don't want to figure out on your own. We strongly suggest you consider the value of your time before undertaking Java printing yourself.

»

Buy J2PrinterWorks Online! Buy J2PrinterWorks Online!
Home | Contact Us | Request to publish your help manuals | Request to remove your help manuals