Skip to main content

Documents

16 replies [Last post]
freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

I have two weird questions but bear with me for a while.

The first question is about the printing of a styled document using the printable interface. i am using windows 98 and using the windows page format and print dialog. I have managed to print all the contents of the document using the windows print dialog but when i try to print a selected portion of the styled document(windows print dialog has an option of printing selected pages) always only the first page is printed.

This is what i did in my print method

</p>
<p>public void printData()<br />
{<br />
//This is the main printing function that prints out the document</p>
<p>try<br />
{</p>
<p>          PrinterJob prnJob = PrinterJob.getPrinterJob();</p>
<p>          PageFormat format = prnJob.pageDialog(prnJob.defaultPage());<br />
          prnJob.setPrintable(new RTFRenderer(), format);</p>
<p>if (prnJob.printDialog() == false)<br />
{<br />
          return;<br />
}</p>
<p>//The below command line prints out the document if the user clicked Ok</p>
<p>         prnJob.print( );<br />
}</p>
<p>catch (PrinterException e)<br />
{<br />
       e.printStackTrace();<br />
       System.out.println("An error has occured");<br />
}</p>
<p>}</p>
<p>

RTFRenderer is an external class where i implemented the printable interface

My next question is about the html document i have in a JTextPane and its printing functionality works on all java sdks(ie.1.1 - 1.4.2)
but when i compile my program under java sdk 1.5 update 1 only the text is printed but all the images are not printed but this is not the case on the other java sdks(ie.1.1 - 1.4.2). I find this rather weird.

I was thinking i was doing something wrong in both my questions so i downloaded a third party package called Document Renderer at www.fawcette.com but still had the same results.

I also went to manning website(www.manning.com) where they had a swing book with a chapter(Chapter22) on printing and i used the examples there to do the printing but i still got the same results.

Has anyone ever encountered this before. Could anyone point me to a tutorial or an open source package in which i can print the contents of the JTextPane if it contains either a styled document or HTML document.

I also went to sun's website and could not find out if both my problems is a bug or not and i hope someone can help me with this problem. Please note that no exceptions were thrown in both my problems.

Any help is greatly appreciated

Yours Sincerely

Richard West

Message was edited by: freesoft_2000

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
shan-man
Offline
Joined: 2006-02-17
Points: 0

Hi,

In response to your first question:
Does your RTFRenderer() look at the page indexes that are passed to it? For example, if you specify in the dialog to print pages 5-10, your Printable will be called starting with page indexes 5 through 10.

Regards,
Shannon

freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

Your right shannon that's what i expected but it seems that not what's happening. I am listing my RTFRenderer class here so maybe you can see if it is something i am doing wrong.

[code]

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import java.awt.print.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.plaf.basic.*;
import javax.swing.text.rtf.*;

class RTFRenderer implements Printable
{
//This external class that does all the printing of all the rtf document pages

int currentPage = -1;
JTextPane jtextPane = new JTextPane();
double pageEndY = 0;
double pageStartY = 0;
boolean scaleWidthToFit = true;

public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
{
//This function is the main printable overided function

double scale = 1.0;
Graphics2D graphics2D;
View rootView;
graphics2D = (Graphics2D) graphics;

jtextPane.setSize((int)pageFormat.getImageableWidth(),Integer.MAX_VALUE);
jtextPane.validate();

rootView = jtextPane.getUI().getRootView(jtextPane);

if((scaleWidthToFit) && (jtextPane.getMinimumSize().getWidth() >
pageFormat.getImageableWidth()))
{
scale = pageFormat.getImageableWidth()/jtextPane.getMinimumSize().getWidth();
graphics2D.scale(scale, scale);
}
//The below four command lines shows that the content is clipped
//to the size of the printable page

graphics2D.setClip((int) (pageFormat.getImageableX()/scale),
(int)(pageFormat.getImageableY()/scale),
(int)(pageFormat.getImageableWidth()/scale),
(int)(pageFormat.getImageableHeight()/scale));

//The below if statement is to check to see if there is a new page to render

if(pageIndex > currentPage)
{
currentPage = pageIndex;
pageStartY += pageEndY;
pageEndY = graphics2D.getClipBounds().getHeight();
}

graphics2D.translate(graphics2D.getClipBounds().getX(),
graphics2D.getClipBounds().getY());

Rectangle allocation = new Rectangle(0, (int)-pageStartY,
(int)(jtextPane.getMinimumSize().getWidth()),
(int)(jtextPane.getPreferredSize().getHeight()));

//The below if else statements return PAGE_EXISTS only if the class
//sees that there are some contents in the document by calling the printView class

if(printView(graphics2D,allocation,rootView))
{
return PAGE_EXISTS;
}

else
{
pageStartY = 0;
pageEndY = 0;
currentPage = -1;
return NO_SUCH_PAGE;
}

}

protected boolean printView(Graphics2D graphics2D, Shape allocation, View view)
{
//This function paints the page if it exists

boolean pageExists = false;
Rectangle clipRectangle = graphics2D.getClipBounds();
Shape childAllocation;
View childView;

if(view.getViewCount() > 0)
{

for(int i = 0;i {

childAllocation = view.getChildAllocation(i,allocation);

if (childAllocation != null)
{
childView = view.getView(i);

if(printView(graphics2D,childAllocation,childView))
{
pageExists = true;

}

}

}

}

else
{
//The below if statement checks if there are pages currently to paint

if(allocation.getBounds().getMaxY() >= clipRectangle.getY())
{
pageExists = true;

if((allocation.getBounds().getHeight() > clipRectangle.getHeight()) &&
(allocation.intersects(clipRectangle)))
{
view.paint(graphics2D,allocation);
}

else
{

if(allocation.getBounds().getY() >= clipRectangle.getY())
{

if(allocation.getBounds().getMaxY() <= clipRectangle.getMaxY() - 15)
{
view.paint(graphics2D,allocation);
}

else
{

if(allocation.getBounds().getY() < pageEndY)
{
pageEndY = allocation.getBounds().getY();
}

}

}

}

}

}

return pageExists;
}

public void setpane(JTextPane TextPane1)
{
//This function gets the JTextPane

jtextPane.setContentType("text/rtf");
jtextPane = TextPane1;
Type = type;
Type1 = type1;
}

}

[/code]

This is the way i call the class to do the printing

[code]

public void printData()
{
//This is the main printing function that prints out the document

RTFRenderer RTFRenderer1 = new RTFRenderer();

RTFRenderer1.setpane(TextPane1);

try
{

PrinterJob prnJob = PrinterJob.getPrinterJob();

PageFormat format = prnJob.pageDialog(prnJob.defaultPage());
prnJob.setPrintable(new RTFRenderer(), format);

if (prnJob.printDialog() == false)
{
return;
}

//The below command line prints out the document if the user clicked Ok

prnJob.print( );
}

catch (PrinterException e)
{
e.printStackTrace();
System.out.println("An error has occured");
}

}

[/code]

please note that TextPane1 is an instance of the swing JTextPane class

I really have no idea what is wrong. Maybe shannon you can help see through my code and see if it is something i am doing wrong.

By the way i am using windows 98 and am using the windows 98 native print dialog to print.

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

shan-man
Offline
Joined: 2006-02-17
Points: 0

Hi Richard,

The way printing works is that if you specify in the print dialog to print pages 5 - 10, your printable will be called with the following page indices: 4, 5, 6, 7, 8, 9 (possibly twice for each page). With a quick glance at your code, it appears to me that you have no provision for catching up when you're called starting with non-zero. You're only using the pageIndex to keep track of what page you've just printed.

But your Printable needs to be able to consider this pageIndex to determine if you're starting at the right page. For the example above, when it's first called with page 4 it needs to be able to figure out what to render for page 4. Hopefully this is an easy caculation - but it may be as complex as looping through the calculations for pages 0 - 3 first.

Hope this helps!
Shannon

freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

Sorry to bother you like that shannon but the user enters the page number range in the native windows print dialog.

Is there a way in which i can get the page number range that the user had entered?

I have seen the the PrinterJob api and there does not seem to be a method in which i can get hold of the page numbers entered in the native print dialog or is there another way of getting hold of those page numbers?

There was also this book i read called Swing that actually said that the printable interface will automatically call the page ranges and i do not have to do anything.

On the other hand i had a JPanel with a buffered image drawn on top of it and it seems that the page range selection seems to work there perfectly even though i did not make any page range provisions for it.

Seriously shannon i am really getting confused

Anyway sorry for being so long winded and i really hope you can really answer my question

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

shan-man
Offline
Joined: 2006-02-17
Points: 0

Hi Richard,

Perhaps I can explain with an example.

The print method of your custom Printable is defined as:
print(Graphics graphics, PageFormat pageForamt, int pageIndex)

The last argument is the pageIndex you should print.

Let's say you show the printer dialog and the user doesn't choose any page numbers, but only clicks OK. Java's printing system will start calling your print method:

print(g, pf, 0) // first page - page counts are 0 based
print(g, pf, 1) // second page
print(g, pf, 2) // third page
...etc...

It will keep going until your print method returns NO_SUCH_PAGE.

Now, let's say the user instead chooses page ranges 5 through 10. Java's printing system will call your printable as follows:

print(g, pf, 4) // fifth page - page counts are 0 based
print(g, pf, 5) // sixth page
print(g, pf, 6) // seventh page
print(g, pf, 7) // eighth page
print(g, pf, 8) // ninth page
print(g, pf, 9) // tenth page

([i]If you return NO_SUCH_PAGE before it gets to 9, it will stop sooner.[/i])

That is, the first time it calls your print method it will be with the first page number you're supposed to print (4). The last time it calls your print method it's with the last page index you're supposed to print (9). You don't have to do anything to fetch page ranges - the printing system deals with them by calling your print method starting and ending at those page ranges.

Your Printable needs to be designed such that it can print the appropriate page. Right now, the printing system tells you to print page 4 and you're printing page 0. What you need to do is create your Printable such that it can either a) print any page at any time or b) catch up if printing starts with a non-zero index.

Does that make sense?

Thanks!
Shannon

freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

First let me say thank you for answering my post. I understand what you are trying to say but how will i be able to catch up to the current page index by using views.

I really have no idea how to do this. I tried to google for any examples but it seems a lot of people are having the same trouble as me with no solutions in sight. I tried using the printing solutions in some java printing books(from manning and O'Reilly)and their printing solutions seem to have the same problem as mine.

Sorry to ask you this but is it possible for you to have a look at my code and see where i would need to make changes or what i would have to add in.

I really need help for this problem shannon.

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

shan-man
Offline
Joined: 2006-02-17
Points: 0

Hi Richard,

Okay - so your Printable assumes you'll be called always like this: 0, 1, 2, 3, 4, 5...

Every time your Printable is called you do two things: You calculate what area to print and then you draw it to the graphics. You calculate the area to print based on what you printed for the previous page. So it looks like this:

The first time you're called, you do the calculations for page 0 and then draw to the graphics. The second time you're called, you do the calculations for page 1 and you base this off of what you know you've already done for page 0. You render this new area to the graphics. This continues...

Obviously, this fails if the first page you're called for is page 5. What you need to do instead is something like:
[code]
while (currentIndex < pageIndex) {
// do calculations for currentIndex

// increment currentIndex yourself
currentIndex++
}

// NOW you've caught up - so render based on the current
// calculations
[/code]
The idea is that if you're called with something higher than what you expect, you run the calculations yourself for the preceeding pages so that you can catch up. In the example we're talking about, if you're called with page 5 (index 4), you detect that that you haven't done 0 - 3 yet. So:

calculate page 0
based on page 0, calculate page 1
based on page 1, calculate page 2
based on page 2, calculate page 3
based on page 3, calculate page 4

No you've caught up!

That's one way to do it, and probably the best for your case. The other alternative is if you have something to print (an image for instance) that you plan to divide evenly between all pages. In this case, there would be a simple mapping between pageIndex and what part of the image to render for that page. You wouldn't need to "catch up" but instead just figure out what to print based on what page you're printing. I'd suggest you try the "catch up" approach.

Hope I've solved the problem :)
Shannon

freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

shannon i tried what you said but it still does not seem to work

Here is what i added to the RTFRenderer class

[code]

while(currentIndex < pageIndex)
{
pageStartY += pageEndY;
pageEndY = graphics2D.getClipBounds().getHeight();
currentIndex++;
}

[/code]

I also tried this

[code]

if(currentIndex < pageIndex)
{
pageStartY += pageEndY;
pageEndY = graphics2D.getClipBounds().getHeight();
}

currentIndex++;

[/code]

Please note that currentIndex is an interger variable with intial value of 0 i added into the RTFRenderer class.

Just before i return NO_SUCH_PAGE i also reset the currentIndex to 0.

I have been trying other combinations of the above code but still no luck.

The output from the printer i get is quite funny in a way that no matter what range i try to print only page 3 is printed.

I really do not know what else to do and hope that you can help me out.

I really need help for this problem

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

shan-man
Offline
Joined: 2006-02-17
Points: 0

Hi Richard,

Sorry you're having so much trouble!

I've presented everything that I can in order to help with this problem. The only other thing I could think of would be for me to obtain a copy of your code and try to debug it, and - I'm sorry - I just don't have the time available.

My suggestion, therefore, would be for you to try to address this problem in another way. Rather than trying to insert code that doesn't quite make sense to you, how about putting this on hold for a second and trying a simpler example (text is pretty hard). How about writing a very simple Printable that covers the concepts that we've discussed. Then, once you've mastered the technique, try applying it to text. If I were to try and debug your application, that's probably what I'd do - reduce it to a smaller problem.

Also, if I may make a suggestion - I found the code in your original posting very hard to follow as a result of the way it's indented. If you'd consider editing that message and fixing your indentation, it may make it easier for others to help out :)

Regards,
Shannon

freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

Here is the new reindented code with a mini test program

[code]

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import java.awt.print.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.plaf.basic.*;
import javax.swing.text.rtf.*;

public class JWord implements ActionListener, CaretListener
{

JFrame fr = new JFrame ("Frame");
JLabel Label1 = new JLabel("Label1 ", SwingConstants.RIGHT);
JButton Button1 = new JButton("Print");

JTextPane TextPane1 = new JTextPane();

//The below two command lines creates instances for fonts

SimpleAttributeSet sas = new SimpleAttributeSet();

StyleContext sc = new StyleContext();

//The below command line sets up the variable for font updating

MutableAttributeSet mas;

//Then below command line sets the style for the JTextPane document

DefaultStyledDocument dse = new DefaultStyledDocument(sc);
JScrollPane ScrollPane1 = new JScrollPane(TextPane1, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

//The below command line is the constructor for the rtf editor kit

RTFEditorKit rtfkit = new RTFEditorKit();

Dimension Size1 = new Dimension();

//The below external class helps in the printing of the rtf document

RTFRenderer RTFRenderer1 = new RTFRenderer();

public void initialize ()
{
Container pane = fr.getContentPane();
pane.setLayout(new FlowLayout());
fr.setSize(250,300);
fr.setLocation(300,300);
fr.setBackground(Color.lightGray);
//The below command line is the JTextPane using the rtf editor kit
//for any rtf editing

TextPane1.setEditorKit(rtfkit);
//The below command line sets the document that the JTextPane will be
//be referencing to

TextPane1.setDocument(dse);
Size1.width = 500;
Size1.height = 300;
ScrollPane1.setPreferredSize(Size1);
pane.add(ScrollPane1);
pane.add(Button1);
pane.add(Label1);
// Use the JAVA constant JFrame.HIDE_ON_CLOSE for subsequent forms in multi form
// applications

fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Button1.addActionListener(this);
TextPane1.addCaretListener(this);
fr.pack();
fr.setVisible(true);
}

public void printData()
{
//This is the main printing function that prints out the document

//The below command line sets the current JTextPane for printing
//by using the external printing class

RTFRenderer1.setpane(TextPane1);

//The below command line gets the attributes for the JAVA print dialog

try
{
//The below two command lines gets the Printer Job and uses the
//external RTFRenderer class as its Printable

PrinterJob prnJob = PrinterJob.getPrinterJob();
PageFormat format = prnJob.pageDialog(prnJob.defaultPage());
prnJob.setPrintable(RTFRenderer1, format);

if (prnJob.printDialog() == false)
{
return;
}

//The below command line prints out the document if the user clicked Ok

prnJob.print();
}

catch (PrinterException e)
{
Label1.setText("A printing error has occurred");
}

}

public void actionPerformed(ActionEvent event)
{
JComponent b = (JComponent)event.getSource();

if(b == Button1)
{
//The below two command lines prints the current content of the document
//and repaints the main frame

printData();
fr.repaint();
}

}

public void caretUpdate(CaretEvent event)
{
JComponent w = (JComponent)event.getSource();
int g;

if(w == TextPane1)
{
g = event.getDot();
Label1.setText("Current Caret Position: " + g);
}

}
public static void main(String args[])
{
JWord a = new JWord();
a.initialize();
}
}

class RTFRenderer implements Printable
{
//This external class that does all the printing of all the rtf document pages

int currentPage = -1;
JTextPane jtextPane = new JTextPane();
double pageEndY = 0;
double pageStartY = 0;
boolean scaleWidthToFit = true;
int currentIndex = 0;

public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
{
//This function is the main printable overided function

double scale = 1.0;
Graphics2D graphics2D;
View rootView;
graphics2D = (Graphics2D) graphics;

jtextPane.setSize((int)pageFormat.getImageableWidth(),Integer.MAX_VALUE);
jtextPane.validate();

rootView = jtextPane.getUI().getRootView(jtextPane);

if((scaleWidthToFit) && (jtextPane.getMinimumSize().getWidth() >
pageFormat.getImageableWidth()))
{
scale = pageFormat.getImageableWidth()/jtextPane.getMinimumSize().getWidth();
graphics2D.scale(scale, scale);
}

//The below four command lines shows that the content is clipped
//to the size of the printable page

graphics2D.setClip((int)(pageFormat.getImageableX()/scale),
(int)(pageFormat.getImageableY()/scale),
(int)(pageFormat.getImageableWidth()/scale),
(int)(pageFormat.getImageableHeight()/scale));

//The below if statement is to check to see if there is a new page to render

if(pageIndex > currentPage)
{
currentPage = pageIndex;
pageStartY += pageEndY;
pageEndY = graphics2D.getClipBounds().getHeight();
}

while(currentIndex < pageIndex)
{
pageStartY += pageEndY;
pageEndY = graphics2D.getClipBounds().getHeight();
currentIndex++;
}

graphics2D.translate(graphics2D.getClipBounds().getX(),
graphics2D.getClipBounds().getY());

Rectangle allocation = new Rectangle(0, (int)-pageStartY,
(int)(jtextPane.getMinimumSize().getWidth()),
(int)(jtextPane.getPreferredSize().getHeight()));

//The below if else statements return PAGE_EXISTS only if the class
//sees that there are some contents in the document by calling the printView class

if(printView(graphics2D,allocation,rootView))
{
return PAGE_EXISTS;
}

else
{
pageStartY = 0;
pageEndY = 0;
currentPage = -1;
currentIndex = 0;
return NO_SUCH_PAGE;
}

}

protected boolean printView(Graphics2D graphics2D, Shape allocation, View view)
{
//This function paints the page if it exists

boolean pageExists = false;
Rectangle clipRectangle = graphics2D.getClipBounds();
Shape childAllocation;
View childView;

if(view.getViewCount() > 0)
{

for(int i = 0;i {

childAllocation = view.getChildAllocation(i,allocation);
if (childAllocation != null)
{
childView = view.getView(i);

if(printView(graphics2D,childAllocation,childView))
{
pageExists = true;
}

}

}

}

else
{
//The below if statement checks if there are pages currently to paint

if(allocation.getBounds().getMaxY() >= clipRectangle.getY())
{
pageExists = true;

if((allocation.getBounds().getHeight() > clipRectangle.getHeight()) &&
(allocation.intersects(clipRectangle)))
{
view.paint(graphics2D,allocation);
}

else
{

if(allocation.getBounds().getY() >= clipRectangle.getY())
{

if(allocation.getBounds().getMaxY() <= clipRectangle.getMaxY() - 15)
{
view.paint(graphics2D,allocation);
}

else
{

if(allocation.getBounds().getY() < pageEndY)
{
pageEndY = allocation.getBounds().getY();
}

}

}

}

}

}

return pageExists;
}

public void setpane(JTextPane TextPane1)
{
//This function gets the JTextPane

jtextPane.setContentType("text/rtf");
jtextPane = TextPane1;
}

}

[/code]

I get what you are saying shannon in that i should try somthing easier. I did that already and that seems to work. What i did was to draw an image onto a JPanel and then try to print that image(which is spread on three pages) selectively(ie. meaning that i can print pages of any selection) and it works over there but when i come over to the styled text side i can't print selectively.

I am doing something wrong but i have been on this problem for weeks and have run out of solutions.

Your code makes sense to me in that what i am trying to do is to is catch up on the current printed page but it still does not work.

I really hope someone can help me with this problem

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

shan-man
Offline
Joined: 2006-02-17
Points: 0

Hi Richard,

Thanks for posting a runnable example. Unfortunately, I don't think you're going to like what I've discovered. But I am suprised if you haven't noticed it yet.

Your Printable doesn't work properly even for the normal case of printing all pages. I ran your test application and pasted the numbers 0 through 999, each on a line of their own, into the text pane. I then printed all pages.

On the first page of the output I got numbers 0 through 38. On the second I got 80 through 118. On the third I got 160 through 198. Etc... The point being that your Printable is leaving quite a bit of text out of the output. Perhaps you can take steps to resolve this first. Otherwise it is rather difficult to tackle the other problem we've discussed.

Keep us posted :)
Shannon

freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

Yes that happens because of this loop

[code]

while(currentIndex < pageIndex)
{
pageStartY += pageEndY;
pageEndY = graphics2D.getClipBounds().getHeight();
currentIndex++;
}

[/code]

I added this loop in an attempt to print selected pages.

Once you remove that loop you will notice that the printing of all pages will revert back to normal.

I included that loop in the code in my previous post to let you know what i was doing to try to print selected pages.

I sincerely apologize for confusing you.

One more thing shannon, in one of your earlier posts in this topic you said "In this case, there would be a simple mapping between pageIndex and what part of the image to render for that page."

I tried converting the entire JTextPane to a single image and drawing it on a JPanel to print it as a multi-page image but the problem is the text always gets clipped at the end of the page no matter which way i try it. i tried doing this to see if i could find an easier way to print the contents of a JTextPane but that didn't work so i am back to my original plan.

I really hope someone can help me with this printing problem

Thank You

Yours Sincerely

Richard West

freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

Is anyone there that can help or guide me??

Yours Sincerely

Richard West

freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

shannon you said that my printable assumes the first page index to print is always 0 but if based on that assumption then would it be possible to add the pages to a book instead. If it is possible then what changes would i have to make to my code and how would i go about doing it.

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

freesoft_2000
Offline
Joined: 2005-09-06
Points: 0

Hi everyone,

Is anyone there??

Richard West

teaglass42
Offline
Joined: 2006-04-15
Points: 0

Not an expert on printing, yet. I ran into a similar problem with an application that would not print. I was using JRE 1.5. I found that I needed to add -Djava.net.preferIPv4Stack=true to the command line of my shell script to revert back to IP 4 stack because the IP v 6 stack does not work well in Java 1.5. Hope this helps.