TextPrinter Release Notes
Notes on applet signing:

We have gotten numerous requests on how to sign applets in order to enable printing from browsers.  Two good memos on applet signing we recommend are:
       http://www.adelaide.net.au/~bmodra/PrintJob.html
       http://www.suitable.com/docs/signingsignexp.html
These pages explain how to sign your Java applet so that it can be used in both Netscape Navigator/Communicator and Microsoft Internet Explorer.  Basically, for Internet Explorer you need to create a signed .cab file, and at the same time for Netscape you need to create a signed .jar file and include some extra code in your applet.  Here is a sample TextPrinter-based Java applet with this additional code. 

As to how to sign applets in general, in addition to the references above, the following Q&A from Peter van der Linden's excellent Java FAQ contain some more useful links on applet signing:

Question 17 (Sect. 13):  How do I sign an applet? 

Answer:  The browser vendors have produced independent and different solutions for applet signature (alas). Here are some URLs on this topic.

     See the Java Signing FAQ at http://www.fastlane.net/~tlandry/javafaq.txt 

     Read the basics of signing at: http://www.javareport.com/html/features/archive/9802/somers.shtml
     Be aware that the mechanism of signing and administering signed code changed significantly between Java 1.1 and Java 2. 

     Netscape signing: 
        http://developer.netscape.com/docs/manuals/signedobj/javadoc/netscape_security_Target.html 
        https://certs.netscape.com/client.html 
        http://developer.netscape.com/docs/manuals/signedobj/capabilities/contents.htm 
        http://developer.netscape.com/docs/manuals/signedobj/targets/contents.htm 

     Microsoft signing: 
        http://www.microsoft.com/java/security/secfaq.htm
        http://www.microsoft.com/java/sdk/20/tools/signcode.htm 
 

Changes in TextPrinter 1.3.1

TextPrinter 1.3.1 fixes a problem with line break processing present in TextPrinter 1.3 on Windows and Mac. 

TextPrinter's detection of end-of-line characters was revamped in version 1.3 to fix line separator handling problems on certain non-Windows platforms.  TextPrinter 1.3 looked for System.getProperty("line.separator") as the line separator, which may be CR ("\r"), LF ("\n"), or CRLF ("\r\n") on different platforms.  This allowed TextPrinter 1.3 to handle line breaks in text read from files correctly on all systems.. 

However, it turns out that the Java components themselves (e.g. TextArea) insert LF when the user types "Enter" regardless of what the platform line separator is (which will be wrong on Windows and Mac).  In additon, some Java developers always use LF (or CR, or CRLF) rather than the platform line.separator for line separation in their programs.  Also, programs may encounter text files imported from other OS's.  Since TextArea always displays a line break for any occurances of LR, CR, or CRLF regardless of the platform line separator, TextPrinter 1.3.1 has likewise been changed to detect any of CR, LF, or CRLF as valid line separators on all platforms regardless of the platform line separator. 

This fix also fixed a related bug wherein with line wrap off, TextPrinter 1.3 inserted an extra blank line between lines that needed wrapping.

In addition, the PrintTextFile sample code contains updated "defaultMargins" sample code, including support for Windows 98 and the latest JDK releases plus small optimizations to certain default values.
 

Changes in TextPrinter 1.3

TextPrinter 1.3 fixes the following bugs and problems in previous releases:
1) Bug in handling Unicode strings with character codes >127 (common in European languages) that caused illegal subscript exception now fixed
2) Form feed (page break) character ("\f") now works properly
3) Print monitor job name can now be specified, following Sun's fix of this bug in JDK 1.1.7
4) Double quote characters now work correctly in the string (text) property editor window
5) The time and date no longer change on each page of a given print job
6) Top and bottom page margins now correct if no header and/or footer are specified
7) Print dialog frames now properly disposed
8) No blank page emitted if nothing printed (or all pages out of range)
9) PrintTextFile sample application Page Setup Dialog layout improved
10) Absolute and relative tab spacing corrected
11) Pagination page ranges now work correctly
12) Header and footer centering now work correctly
13) In Free Version, thank you page prints every 5 pages rather than printing a maximum of 5 pages
 

Changes in TextPrinter 1.2.1

TextPrinter 1.2.1 was updated to correspond to changes made by Sun to the Java printing support in their newest releases JDK 1.1.7 and JDK 1.2beta4.  These new JDK releases addressed the long-standing page dimension and resolution problems discussed at length below and in the TextPrinter documentation.  These fixes have led to the following changes in TextPrinter:
1) Printing resolution is now always set to 72 "points" per inch, regardless of screen resolution or page resolution of the system.  Margin and gap values expressed in inches now really work in inches on all printers.
2) Page dimensions now correspond to the physical page, not the printable page, and as a result the default margins have been changed to:
          leftMargin = 0.28, rightMargin = 0.56, topMargin = 0.14, bottomMargin = 0.7
3) The following default values were also changed:
          gapBelowHeader = 0.25 and gapAboveFooter = 0.125
In addition, errors were fixed in the computations using the gapBelowHeader and gapAboveFooter values.
4) The default point size for the printer (body) font has been reduced from 12 to 10.
5) Fixing these problems while allowing programs to maintain compatibility with previous JDK releases required adding the following public methods to allow access to previously internal data values:
          setHeaderFooterFont(Font f) - sets font to be used for the header and footer
          Font getHeaderFooterFont() - returns the current header and footer font
          setTabStops(double[] tabStops) - where tabStops is an array of doubles giving variable tab stop positions in inches
          double[] getTabStops() - returns the current tab stop values as an array of doubles
The methods setInchesPerTab and getInchesPerTab still work.  Internally, there are 50 tab stops and additional tab stops beyond those set by setTabStops are set at fixed intervals as indicated by setInchesPerTab.

In the free PrintTextFile sample application that accompanies TextPrinter, the following changes were made:
1) a serious bug was fixed in the code generated by the Symantec Cafe builder that caused any use of the About box and PageSetupDialog dialog windows to hang the application in JDK 1.1.6 and 1.1.7.
2) the About box and main screen were redesigned to eliminate the use of extra Symantec Cafe classes, so that PrintTextFile is now completely self-contained.
3) the batch file supplied to run PrintTextFile now includes the -Djava2d.font.usePlatformFont=true option as a workaround for bugs caused by the JDK 1.2beta4 Java2D font generaion (see documentation).
4) font selection now works correctly in the PageSetupDialog method
5) source code for a new method defaultMargin is provided which automatically detects which JDK and OS is running and sets the TextPrinter margins correctly for Windows, Solaris, and Macintosh and JDKs 1.1.4 though 1.2beta4 (see documentation).  This takes into account and supercedes all the margin settings for previous versions described below.

Known bug in TextPrinter (problem with Symantec Visual Cafe JAR command)
If you are using Symantec Visual Cafe 2.5 and have loaded and used TextPrinter.jar as a bean, the use of the JAR command to package your program will result in an "Internal error" message from Cafe.  This is despite the fact that Cafe is able to read TextPrinter.jar both to use TextPrinter as a bean as well as  to build, run, and save your programs that use TextPrinter.class.

There are two workaround solutions:
1) Create com\wildcrest\TextPrinter.class in a directory of your choosing and under the Project menu, select Options, then the Directories tab, then click on the "New" (left arrow) button and add this directory to the Class files list.  Make sure this line is ABOVE the line specifying TextPrinter.jar.  In this way you can use TextPrinter as a bean to build your programs, but the JAR command will find the class, avoiding its problem with TextPrinter.jar.
2) JAR your program with Sun's JDK jar utility, which works fine with TextPrinter.jar.
 

Changes in TextPrinter 1.2

In TextPrinter 1.2, a problem was fixed that caused a nullPointerException on bringing up the getPrintJob Dialog Frame on Solaris.  Previously the Frame was saved and reused, which worked fine on other platforms, but Solaris seems to require a new Frame each time. 

It appears that Solaris platforms place the 0,0 origin right at the physical upper left corner of the page, even though as a practical matter most printers are unable to print right to the edge.  By contrast, leftMargin and topMargin of 0.0 seem to work fine on Windows and Macintosh, which appear to place the 0,0 page origin at the upper left of the actual printing area.  For this reason the default values of left and top margin for TextPrinter itself have been kept at 0.0, but it is recommended you experiment with your system(s) and printer(s) and look to setting your margins to some value greater than 0.0 to be safe. 

In particular, the PrintTextFile 1.2 sample application sets left and top margins of 0.125 so that it works on Solaris at the price of a small loss of potential printing area on Windows and Macintosh.  Solaris also appears to work with rightMargin and bottomMargin as small as 0.125, but since values this small don't work on all platforms and because of the cummulative font metrics errors mentioned in the TextPrinter documentation, default values of rightMargin 0.4 and bottomMargin 0.5 are used in both TextPrinter and PrintTextFile. 

The test application PrintTextFile 1.2 fixes a packaging problem that resulted in certain Symantec Visual Cafe classes being omitted in the jar version of PrintTextFile 1.1. This meant that PrinterTextFile 1.1 would not run unless you happened to have Visual Cafe installed, or had downloaded certain other Wildcrest Associates products that provided these classes, or rebuilt PrintTextFile from the sources. 

PrintTextFile 1.2 again improves the PageSetupDialog, providing even more generous text field and label sizes to accomodate the larger system fonts used on some systems. 
 

Changes in TextPrinter 1.1

In TextPrinter 1.1, a problem has been fixed in the custom TextAreaPropertyEditor that displays when you click on the Text property in the property sheet of your favorite bean tool.  The problem caused earlier versions of TextPrinter in some bean tools to not display the previously entered text when reopened. 

The improved TextAreaPropertyEditor described above is being made available as a separate product from Wildcrest Associates.  If you install the separate TextAreaPropertyEditor product on your system, you must switch to TextPrinter 1.1, as earlier versions of TextPrinter conflict with the new TextAreaPropertyEditor product. 

The following default values were changed in TextPrinter 1.1 based on user experience with earlier versions of the product: 
          Default value of rightMargin: was 0.0, is now 0.4 
          Default value of bottomMargin: was 0.0, is now 0.5 
          Default value of Font: point size was 14, is now 12 
          Point size of font used in headers and footers (not a user option): was 12, is now 10 

The recommended values for rightMargin and bottomMargin in TextPrinter 1.1 are the same as for TextPrinter 1.0.1 above. 

The PageSetupDialog in the PrintTextFile sample application has an improved layout.  Label fields were too narrow in previous versions, causing some labels to clip in systems with larger system fonts, notably Macintosh. 

One breaking API change was made between TextPrinter 1.1 and earlier versions: setFont has been renamed to setPrinterFont and getFont has been renamed to getPrinterFont.  This change was necessitated to avoid subclassing setFont, which causes intermittant crashes when instantiating multiple instances of TextPrinter in certain bean tools, notably IBM WebRunner BeanTester. 
 

Changes in TextPrinter 1.0.1

The Windows JDK 1.1.4 incorrectly reports the printer pageWidth and pageHeight.  Appropriate values of rightMargin and bottomMargin in TextPrinter can be used to compensate for this problem.  However, a bug in the rightMargin computation in TextPrinter 1.0.0 caused rightMargin values to not correspond correctly to physical measurements.  This has been corrected in TextPrinter 1.0.1.   The original JDK bug was fixed in JDK 1.1.5, though the values still do not appear to be quite correct. 

Bottom line: All versions of  JDK 1.1.x and TextPrinter will work correctly with appropriate values of rightMargin and bottomMargin.  The best advice is to determine these values empirically for your system.  Here are the values that work on systems tested by Wildcrest Associates: 

TextPrinter 1.0.0 Mac (Metrowerks VM) JDK 1.1.3:  rightMargin = 2.5, bottomMargin = 0.0 
TextPrinter 1.0.1 Mac (Metrowerks VM) JDK 1.1.3:  rightMargin = 0.0, bottomMargin = 0.0 

TextPrinter 1.0.0 Windows JDK 1.1.4:  rightMargin =   0.0 , bottomMargin -2.0 
TextPrinter 1.0.1 Windows JDK 1.1.4:  rightMargin = -1.65, bottomMargin -2.0 
TextPrinter 1.0.1 Windows JDK 1.1.5:  rightMargin =   0.4 , bottomMargin 0.5 

But given the wide variety of printers out there, you really need to experiment to see what values work for you.  One customer using TextPrinter on Windows JDK 1.1.4 reported that he had to use values of rightMargin = -6.65, bottomMargin = -10.0 on his printer!