You are not logged in.

klctal

Trainee

  • "klctal" is male
  • "klctal" started this thread

Posts: 70

Date of registration: Jul 13th 2009

Location: Shanghai

Hobbies: Developing software

  • Send private message

1

Friday, July 24th 2009, 11:30am

Printing RTF

Hi everbody,

Here is how to show print dialog:

Source code

1
2
Dim p As java#awt#print#PrinterJob = java#awt#print#PrinterJob.getPrinterJob 
p.printDialog


But how to print a file? :?:

Thanks,

klctal
:D

This post has been edited 1 times, last edit by "klctal" (Jul 27th 2009, 2:55am)


klctal

Trainee

  • "klctal" is male
  • "klctal" started this thread

Posts: 70

Date of registration: Jul 13th 2009

Location: Shanghai

Hobbies: Developing software

  • Send private message

2

Monday, July 27th 2009, 2:54am

I've found out something but never tested it:

Source code

1
2
3
4
5
6
7
8
9
Import java.awt.*
Import java.awt.event.*
Import javax.swing.*
Import java.awt.print.*
Public Sub PrintDoc(RTB As RichTextBox)
   Dim G As Graphics 
   G.drawString(RTB.Text,100,100)
   RTB.Parent.print(G) 
End Sub


I found it over here: http://java.sun.com/docs/books/tutorial/…rldPrinter.java
:D

klctal

Trainee

  • "klctal" is male
  • "klctal" started this thread

Posts: 70

Date of registration: Jul 13th 2009

Location: Shanghai

Hobbies: Developing software

  • Send private message

3

Friday, August 7th 2009, 4:29am

I've found a way to print text without formating:

Source code

1
2
Public Sub Printtxt
    Dim File As vbFileHandler = Open("TempFile.txt") Write(File,RichTextBox1.Text) Dim D As Desktop = Desktop.getDesktop D.print(New file("TempFile.txt"))End Sub


It saves a txt file then prints the txt file out.
Well, that's my best idea.

klctal
:D

This post has been edited 2 times, last edit by "klctal" (Aug 7th 2009, 4:50am)


klctal

Trainee

  • "klctal" is male
  • "klctal" started this thread

Posts: 70

Date of registration: Jul 13th 2009

Location: Shanghai

Hobbies: Developing software

  • Send private message

4

Thursday, August 13th 2009, 1:30pm

I found out a more buggier way:

Jabaco Source

1
2
3
4
5
Public Sub Print
    Dim print As PrintRequestAttributeSet
    Dim printer As PrinterJob
    printer.print(print)
End Sub


When you continuly click continue(a jabaco expection occurs) it works!
:D

Similar threads

Rate this thread
WoltLab Burning Board