Bug 13651 - [printing] Printed output issues
Summary: [printing] Printed output issues
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P5 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
: 35550 45619 51605 52008 64155 70825 73491 78213 78304 78966 90531 189027 (view as bug list)
Depends on: 14955 14954 14956
Blocks:
  Show dependency tree
 
Reported: 2002-04-12 11:42 EDT by Jeff Brown CLA
Modified: 2023-05-13 00:24 EDT (History)
16 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Brown CLA 2002-04-12 11:42:30 EDT
Printing a Java file from the Java editor has the following issues:
- should not highlight the line containing the cursor
- should always print on a white background (is completely unreadable
  otherwise because it gets shaded)
  -- I use a light shade of blue rather than solid white for window
     backgrounds because I find it much easier on the eyes.
- should support printing all text in black (ie. respect the fonts
  and styles, but ignore the colours specified in the Editor colour
  preferences)
- should support pagination, headers, and footers
- should support specifying different fonts for viewing and for printing
Comment 1 Erich Gamma CLA 2002-04-12 13:09:54 EDT
Is there SWT support for these requested printing enhancments?

Moving to SWT 
Comment 2 Mike Wilson CLA 2002-04-12 14:18:36 EDT
StyledText printing problem. KR to investigate.
Comment 3 Knut Radloff CLA 2002-04-14 17:54:39 EDT
    -should not highlight the line containing the cursor:
There are two options to address this:
 1) StyledText never prints line highlighting
 2) JDT temporarily turns off line highlighting when printing
I would favor the latter because there may be clients that want to print the 
line highlighting.

    -should always print on a white background 
Agree. We should change this

    -should support pagination, headers, and footers
StyledText would need to add API for this. Unlikely to happen for 2.0. Printing 
page numbers seems like a reasonable request, though.

    -should support printing all text in black
    -should support specifying different fonts for viewing and for printing
JDT can do this now:
Right before calling the StyledText print API you would change all styles to 
black (remove all non-bold styles, change bold styles to black). When the 
printing API returns you would change the styles back to the original. Same for 
the font.
Note that there may be a flash when you are done with this as the setStyleRange 
and setFont API issues a redraw. There shouldn't be any visible style change 
though.
Comment 4 Knut Radloff CLA 2002-04-30 15:54:46 EDT
Entered JDT bug 14954 for the line highlight and page background issue (which 
are related).
Entered JDT feature request 14955 to add printing in black and printing using a 
different font.
Entered SWT feature request 14956 to add pagination and headers and footers.
Please add yourself to those bugs if you want to track progress.
Comment 5 Knut Radloff CLA 2002-08-01 14:59:56 EDT
Reopening because this bug covers all the printing issues.
Bug 14955 may still be valid, depending on how we address the printing support.

Could not reproduce the background color printing. I always get a white 
background when I print and I don't think I changed anything wrt. the 
background color.
Comment 6 Knut Radloff CLA 2002-08-01 15:31:50 EDT
Propose adding API to StyledText:
Runnable print(Printer printer, StyledTextPrintOption options)

StyledTextPrintOptions would define the following fields

public String header = null; // "left '\t' center '\t' right"
public String footer = null; // left, center, right = <PAGE> | #PCDATA
public int options = 0;	    

header and footer is defined as three separate regions for arbitrary text or 
the page number placeholder <page>. The regions are left aligned, centered or 
right aligned and are separated by a tab character.

options is defined as 0 or more of the following:
ST.TEXT_FOREGROUND 
  print the text foreground color as defined in style ranges
ST.TEXT_BACKGROUND 
  print the text background color as defined in style ranges
ST.FONT_STYLE 
  print the font style (BOLD)
ST.LINE_BACKGROUND
  print the line background color

By default none of the styles will be printed, neither will be the line 
background.
The widget font can be set for printing as described in bug 14955.

Erich: Please review the proposal/suggest changes/required other print options. 
Comment 7 Knut Radloff CLA 2002-09-16 09:26:47 EDT
StyledTextPrintOptions should also have a field to specify the print job name.
public String jobName
Comment 8 Erich Gamma CLA 2002-10-01 05:10:55 EDT
These enhancements make sense.
I don't understand the assymetry between header and footer, i.e., I cannot show 
the page number in the header?

Did you consider passing in a formatted string (MessageFormat.format) to 
support rendering the page number? It would be more flexible and allow 
rendering the page number like this -1-.

The JavaEditor adds additional adornments to the text through PaintListeners 
(e.g. wiggley lines, matching bracket highlighting, print margin). I assume the 
recommendation is to remove these listeners before and add them back after, 
since the StyledTextWidget cannot not about them.

I've carboned Kai (but he is on vacation this week). 
Comment 9 Knut Radloff CLA 2002-10-01 09:34:36 EDT
Header and footer can be exactly the same.

I don't see how a formatted string would make the header/footer more flexible. 
The StyledText printing engine supplies the page number. You can use 
header = "\t-<page>-" to get a centered page number like -1-
Please elaborate if I am missing something.

Any extra painting done on top of StyledText needs to be turned off (it already 
is in the current printing implementation). StyledText has no control over 
these.
Comment 10 Knut Radloff CLA 2002-10-31 18:30:19 EST
Added new printing API as per bug 14956.
See class StyledTextPrintOptions.
Moving to JDT Text to add desired printing options.
Note that bug 6140 may take care of the print job name.
Comment 11 Dani Megert CLA 2003-10-27 04:15:20 EST
marking as later since all dependent bugs are also marked later.
Comment 12 Dani Megert CLA 2003-11-03 06:41:49 EST
*** Bug 45619 has been marked as a duplicate of this bug. ***
Comment 13 Dani Megert CLA 2004-02-11 06:46:39 EST
*** Bug 51605 has been marked as a duplicate of this bug. ***
Comment 14 Dani Megert CLA 2004-02-16 05:58:34 EST
*** Bug 52008 has been marked as a duplicate of this bug. ***
Comment 15 Dani Megert CLA 2004-05-26 14:56:01 EDT
*** Bug 64155 has been marked as a duplicate of this bug. ***
Comment 16 C William Underwood CLA 2004-05-26 18:39:43 EDT
Can a target be given for this?

Also, it would be nice if eclipse supported some more advanced features, such as
printing the source for all selected files / working sets / projects, etc,
although this would be more of a request for enhancement rather than a bug.

Resolved Later... but when!?  :)
Comment 17 Dani Megert CLA 2004-07-26 11:19:27 EDT
*** Bug 70825 has been marked as a duplicate of this bug. ***
Comment 18 Dani Megert CLA 2004-07-26 11:35:58 EDT
*** Bug 35550 has been marked as a duplicate of this bug. ***
Comment 19 Dani Megert CLA 2004-09-15 07:00:19 EDT
*** Bug 73491 has been marked as a duplicate of this bug. ***
Comment 20 Dani Megert CLA 2004-11-10 11:07:00 EST
*** Bug 78213 has been marked as a duplicate of this bug. ***
Comment 21 Dani Megert CLA 2004-11-10 11:34:09 EST
*** Bug 78304 has been marked as a duplicate of this bug. ***
Comment 22 Dani Megert CLA 2004-11-19 04:43:32 EST
*** Bug 78966 has been marked as a duplicate of this bug. ***
Comment 23 Dani Megert CLA 2005-04-07 04:22:07 EDT
*** Bug 90531 has been marked as a duplicate of this bug. ***
Comment 24 Marco Massenzio CLA 2005-04-09 12:01:10 EDT
(In reply to comment #23)
> *** Bug 90531 has been marked as a duplicate of this bug. ***

the bug I reported is far from just about printing headers,footers, etc.
I cannot print anything meaningful, as the fonts used are so large (40-50points
+) that only a few letters per page are output.
This is an Eclipse-only problem - all other app's can print happily.

Also, the Print dialog (is there one?) is not presented.
Comment 25 abrahamd CLA 2006-03-28 14:04:45 EST
(In reply to comment #23)
> *** Bug 90531 has been marked as a duplicate of this bug. ***

It's been almost a year since this bug had it's 12th duplicate bug.  I was wondering where things are on fixing the problem.  Is there anything blocking this bug (of the three bugs listed as blocking, the only one that looks to me to be actually blocking was fixed)?  Is there some estimate of when "Later" is?  Is it that big a task?

Thank you very much.  Be well.
Comment 26 Dani Megert CLA 2006-03-28 14:16:43 EST
LATER means that we don't plan to work on this in the near future. We will gladly accept help from people who really want that feature.
Comment 27 Dani Megert CLA 2007-05-25 09:31:28 EDT
*** Bug 189027 has been marked as a duplicate of this bug. ***
Comment 28 Dani Megert CLA 2007-06-22 09:58:59 EDT
Get rid of deprecated state.
Comment 29 Dani Megert CLA 2007-10-23 12:47:00 EDT
It now prints the name in the header and the page number (e.g. "Page 1") in the footer. I can't print the page count due to bug 207196.
Comment 30 Teddy Walker CLA 2007-11-03 03:48:20 EDT
Please let the user configure the new printing features (3.4 M3).
Comment 31 Eclipse Genie CLA 2019-05-12 12:40:33 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 32 J.F.Lanting CLA 2019-05-12 13:05:01 EDT
As far as I know none of the suggestions has been implemented until now.
It still has my interest, at least the heading facility.
;JOOP!
Comment 33 Eclipse Genie CLA 2021-05-02 09:43:47 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 34 J.F.Lanting CLA 2021-05-03 02:07:02 EDT
Some issues seem to have been repaired:
- fonts: since the use of menlo, font size 11 shows acceptable and prints readable with the same amount per line as is reasonable in the editors.
- colours: I find it very nice to have the syntax colouring in the editor also
on paper.
- heading etc.: a heading and page numbering exist now; footers would require
extra data inserted somewhere.

Anybody other wishes? I'm satisfied with the current status.
;JOOP!
Comment 35 Eclipse Genie CLA 2023-05-12 20:34:39 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 36 J.F.Lanting CLA 2023-05-13 00:24:00 EDT
I believe you may close this one.
;JOOP!