Solved

Printing in a Java applet

Posted on 1998-04-06
4
468 Views
Last Modified: 2008-02-01
I am trying to write a Java applet that can print. It is easy enough to disable print security in Microsoft Internet Explorer. However, I cannot seem to find a way to do this in Netscape Navigator 4.04. Can anyone help me with this problem?
0
Comment
Question by:chieh061297
  • 2
4 Comments
 
LVL 1

Expert Comment

by:datadesign
Comment Utility
when using jdk 1.02 simply generate a html file and open this in a new browser window, then u can print from the browser....( u can also print directly from jdk 1.02 , but then u need to know which system u r using (e.g sending a dos string to print a file) but u will have many problöems with the layout etc.
using jdk 1.1, u can use the print functionality.
0
 

Author Comment

by:chieh061297
Comment Utility
Thank you for help. Unfortunately, I did not phrase the question correctly. We are currently implementing the applet in Java 1.1 because of its print capability. We need to use Java 1.1 because our applet must be cross-platform capable. Plus it is a graphics applet, so we have to print graphics rather than text. The applet renders a vector graphics file in real-time. We would appreciate any help you can provide. We have also increased the points on this question, since it seems harder than we first thought.

0
 
LVL 5

Accepted Solution

by:
fontaine earned 100 total points
Comment Utility
In order to be able to print from an applet, it has to be signed. Here is some doc. about the security model used in Java 1.1:

http://www.javasoft.com/products/jdk/1.2/docs/guide/security/spec/security-spec.doc1.html#18314

Here is a page at the Netscape site intended for Java developers who are writing applets or libraries that need access to local system resources:

http://developer.netscape.com:80/docs/manuals/signedobj/capabilities/index.html

That's for the theory. The following page explains you  how to sign with an example:

http://java.sun.com/security/usingJavakey.html

If you want some sample code for printing from an applet, you can read at the end of this page:

http://developer.javasoft.com/developer/techDocs/SearchData/dd/newbie/59.html

The discussion should also interest you. Be sure to have full JDK 1.1 support before beginning:

http://developer.netscape.com/software/jdk/download.html
0
 

Author Comment

by:chieh061297
Comment Utility
That's what we were afraid of. Signed certificate must be obtained from a third party. And for our project, we need to generate it ourself. We were hoping there is an easy way of turning off the security feature in Netscape Navigator like in Internet Explorer. I guess now the question is how do we sign our own certificates? I'll ask that in another thread.

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bunnyEars challenge 6 62
java set up 1 44
@SBGen Method 3 25
Unexpected HttpURLConnection connection behavior 2 45
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now