Solved

Printing in a Java applet

Posted on 1998-04-06
4
475 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
ID: 1233948
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
ID: 1233949
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
ID: 1233950
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
ID: 1233951
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 80
Eclipse Neon and jdk 1.8.0 11 143
micro services spring boot application error 3 149
arguments to jar 5 18
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

863 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

23 Experts available now in Live!

Get 1:1 Help Now