Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #28635 > unrolled thread
| Started by | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| First post | 2014-06-02 09:20 -0700 |
| Last post | 2014-06-05 12:47 -0700 |
| Articles | 20 on this page of 29 — 5 participants |
Back to article view | Back to comp.lang.java.programmer
Java printing Margins Roedy Green <see_website@mindprod.com.invalid> - 2014-06-02 09:20 -0700
Re: Java printing Margins Roedy Green <see_website@mindprod.com.invalid> - 2014-06-02 09:38 -0700
Re: Java printing Margins Roedy Green <see_website@mindprod.com.invalid> - 2014-06-02 09:51 -0700
Re: Java printing Margins Knute Johnson <eternal@knutejohnson.com> - 2014-06-02 13:15 -0700
Re: Java printing Margins Roedy Green <see_website@mindprod.com.invalid> - 2014-06-03 11:04 -0700
Re: Java printing Margins Knute Johnson <eternal@knutejohnson.com> - 2014-06-04 20:25 -0700
Re: Java printing Margins Roedy Green <see_website@mindprod.com.invalid> - 2014-06-08 06:17 -0700
Re: Java printing Margins Knute Johnson <eternal@knutejohnson.com> - 2014-06-08 14:09 -0700
Re: Java printing Margins Martin Gregorie <martin@address-in-sig.invalid> - 2014-06-08 22:40 +0000
Re: Java printing Margins Knute Johnson <eternal@knutejohnson.com> - 2014-06-09 07:26 -0700
Re: Java printing Margins Martin Gregorie <martin@address-in-sig.invalid> - 2014-06-09 16:10 +0000
Re: Java printing Margins Knute Johnson <eternal@knutejohnson.com> - 2014-06-09 11:41 -0700
Re: Java printing Margins Martin Gregorie <martin@address-in-sig.invalid> - 2014-06-09 22:02 +0000
Re: Java printing Margins Knute Johnson <eternal@knutejohnson.com> - 2014-06-09 15:56 -0700
Re: Java printing Margins Knute Johnson <eternal@knutejohnson.com> - 2014-06-04 20:27 -0700
Re: Java printing Margins Jeff Higgins <jeff@invalid.invalid> - 2014-06-05 19:56 -0400
Re: Java printing Margins Knute Johnson <eternal@knutejohnson.com> - 2014-06-05 20:38 -0700
Re: Java printing Margins Roedy Green <see_website@mindprod.com.invalid> - 2014-06-08 06:19 -0700
Re: Java printing Margins Martin Gregorie <martin@address-in-sig.invalid> - 2014-06-08 15:49 +0000
Re: Java printing Margins Jeff Higgins <jeff@invalid.invalid> - 2014-06-08 22:50 -0400
Re: Java printing Margins Jeff Higgins <jeff@invalid.invalid> - 2014-06-08 23:32 -0400
Re: Java printing Margins Martin Gregorie <martin@address-in-sig.invalid> - 2014-06-09 15:30 +0000
Re: Java printing Margins Jeff Higgins <jeff@invalid.invalid> - 2014-06-09 13:29 -0400
Re: Java printing Margins Jeff Higgins <jeff@invalid.invalid> - 2014-06-09 14:00 -0400
Re: Java printing Margins Jeff Higgins <jeff@invalid.invalid> - 2014-06-09 14:16 -0400
Re: Java printing Margins markspace <markspace@nospam.nospam> - 2014-06-09 14:04 -0700
Re: Java printing Margins Jeff Higgins <jeff@invalid.invalid> - 2014-06-09 17:38 -0400
Re: Java printing Margins Roedy Green <see_website@mindprod.com.invalid> - 2014-06-03 11:36 -0700
Re: Java printing Margins Roedy Green <see_website@mindprod.com.invalid> - 2014-06-05 12:47 -0700
Page 1 of 2 [1] 2 Next page →
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-06-02 09:20 -0700 |
| Subject | Java printing Margins |
| Message-ID | <a09po9pqijpqnrnohtd3etkb3b52qanood@4ax.com> |
Java tells me it wants one inch margins for printing with a LaserJet 1200. I have seen it get much closer to the edges than that. Is there something I am doing wrong? -- Roedy Green Canadian Mind Products http://mindprod.com In former times, people who craved absolute power became gangsters. Today, they become computer programmers.
[toc] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-06-02 09:38 -0700 |
| Message-ID | <f3apo9dbv8fhq89nirsr7brn2qbcb3qul8@4ax.com> |
| In reply to | #28635 |
On Mon, 02 Jun 2014 09:20:51 -0700, Roedy Green <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted someone who said : >Java tells me it wants one inch margins for printing with a LaserJet >1200. I have seen it get much closer to the edges than that. Is >there something I am doing wrong? The Canon MP210 does the same thing. I wonder if Java is ignoring what the printer says, and just uses as standard one inch. -- Roedy Green Canadian Mind Products http://mindprod.com In former times, people who craved absolute power became gangsters. Today, they become computer programmers.
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-06-02 09:51 -0700 |
| Message-ID | <hpapo9psm235jnq294egeo49qd0cp42hai@4ax.com> |
| In reply to | #28635 |
On Mon, 02 Jun 2014 09:20:51 -0700, Roedy Green <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted someone who said : >Java tells me it wants one inch margins for printing with a LaserJet >1200. I have seen it get much closer to the edges than that. Is >there something I am doing wrong? I found that the HP can physically print with .3" side margins and .25 top and bottom margins. I found the Canon an print with .3" side margins and a 0.1 top and bottom margin. I can do this from Java if I ignore the printable regions that PrinterJob tells me. -- Roedy Green Canadian Mind Products http://mindprod.com In former times, people who craved absolute power became gangsters. Today, they become computer programmers.
[toc] | [prev] | [next] | [standalone]
| From | Knute Johnson <eternal@knutejohnson.com> |
|---|---|
| Date | 2014-06-02 13:15 -0700 |
| Message-ID | <lmim07$9sa$1@dont-email.me> |
| In reply to | #28635 |
On 6/2/2014 09:20, Roedy Green wrote: > Java tells me it wants one inch margins for printing with a LaserJet > 1200. I have seen it get much closer to the edges than that. Is > there something I am doing wrong? > See PageFormat.setPaper(), Paper.setImageableArea() and Paper.setSize(). -- Knute Johnson
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-06-03 11:04 -0700 |
| Message-ID | <bpuro9pjieki3r116m5lbdd0kbvg2qm8gg@4ax.com> |
| In reply to | #28638 |
On Mon, 02 Jun 2014 13:15:05 -0700, Knute Johnson <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone who said : >See PageFormat.setPaper(), Paper.setImageableArea() and Paper.setSize(). That lets me handle setting margins a bit more elegantly, and tells me where the 1" margins came from, but it does not let me query now narrow the margins of any given printer can be. Another related question. When you print landscape, are you supposed to just pretend you are printing on an 11 x 8.5 paper, or are you supposed two print on an 8.5 x 11 paper and rotate the image yourself? -- Roedy Green Canadian Mind Products http://mindprod.com In former times, people who craved absolute power became gangsters. Today, they become computer programmers.
[toc] | [prev] | [next] | [standalone]
| From | Knute Johnson <eternal@knutejohnson.com> |
|---|---|
| Date | 2014-06-04 20:25 -0700 |
| Message-ID | <lmonvd$jj6$1@dont-email.me> |
| In reply to | #28646 |
On 6/3/2014 11:04, Roedy Green wrote:
> On Mon, 02 Jun 2014 13:15:05 -0700, Knute Johnson
> <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone
> who said :
>
>> See PageFormat.setPaper(), Paper.setImageableArea() and Paper.setSize().
>
> That lets me handle setting margins a bit more elegantly, and tells me
> where the 1" margins came from, but it does not let me query now
> narrow the margins of any given printer can be.
>
> Another related question. When you print landscape, are you supposed
> to just pretend you are printing on an 11 x 8.5 paper, or are you
> supposed two print on an 8.5 x 11 paper and rotate the image yourself?
>
I think you should set the PageFormat to landscape. Please see the
following code that I wrote to print images.
//
//
// ImagePrinter
//
//
// Version Date Modification
//
---------------------------------------------------------------------------
// 00.10 20 Jun 08 Incept
// 00.11 23 Jun 08 add image file path to frame
// 00.12 11 Jul 08 correct minor bug with page format
// 00.20 22 Aug 08 add file filter to filechooser
// 00.30 11 Dec 09 add code to persist page format
// 00.31 22 Feb 10 change Image menu name to View and move Load
Image
// to File menu
// 00.32 01 Apr 10 remove the orientation parameter from the page
// format persistence
// 00.34 09 Mar 12 modify to put data file in user.home
// 00.40 03 Dec 13 center frame in screen
//
//
package com.knutejohnson.tools.imageprinter;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.awt.print.*;
import java.io.*;
import javax.imageio.*;
import javax.swing.*;
public class ImagePrinter extends JFrame implements ActionListener,
Printable {
static final String VERSION = "00.40";
static final String DATE = "3 Decemter 2013";
static final String HOME =
System.getProperties().getProperty("user.home");
static final String DATA_FILE = ".imageprinter";
private final File dataFile;
private final JFileChooser fc;
private final PrinterJob pj;
// the following are thread constrained
private PageFormat pf;
private BufferedImage bi;
private boolean centered;
private boolean scaled;
private String fileName = "";
public ImagePrinter() {
super("ImagePrinter");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent we) {
saveData(pf);
}
});
dataFile = new File(HOME,DATA_FILE);
pj = PrinterJob.getPrinterJob();
pf = pj.defaultPage();
pj.setPrintable(this);
fc = new JFileChooser("/");
fc.addChoosableFileFilter(new ImageFileFilter());
loadData(pf);
JMenuBar mb = new JMenuBar();
setJMenuBar(mb);
JMenu file = new JMenu("File");
JMenu view = new JMenu("View");
JMenu help = new JMenu("Help");
mb.add(file);
mb.add(view);
mb.add(help);
JMenuItem pageFormat = new JMenuItem("Page Format");
JMenuItem print = new JMenuItem("Print");
JMenuItem quit = new JMenuItem("Quit");
JMenuItem selectImage = new JMenuItem("Load Image");
JCheckBoxMenuItem center = new JCheckBoxMenuItem("Center");
JCheckBoxMenuItem scale = new JCheckBoxMenuItem("Scale To Fit");
JMenuItem about = new JMenuItem("About");
pageFormat.addActionListener(this);
print.addActionListener(this);
quit.addActionListener(this);
selectImage.addActionListener(this);
center.addActionListener(this);
scale.addActionListener(this);
about.addActionListener(this);
file.add(selectImage);
file.add(pageFormat);
file.add(print);
file.add(new JSeparator());
file.add(quit);
view.add(center);
view.add(scale);
help.add(about);
add(new ImagePanel(),BorderLayout.CENTER);
pack();
setLocationRelativeTo(null);
setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
String ac = ae.getActionCommand();
if (ac.equals("Page Format")) {
pf = pj.pageDialog(pf);
repaint();
} else if (ac.equals("Print")) {
if (pj.printDialog())
try {
if (bi == null)
throw new PrinterException("No Image Loaded");
pj.print();
} catch (PrinterException pe) {
JOptionPane.showMessageDialog(ImagePrinter.this,pe,
"Printing Error",JOptionPane.ERROR_MESSAGE);
}
} else if (ac.equals("Quit")) {
dispose();
} else if (ac.equals("Load Image")) {
int opt = fc.showOpenDialog(ImagePrinter.this);
if (opt == JFileChooser.APPROVE_OPTION) {
try {
File file = fc.getSelectedFile();
bi = ImageIO.read(file);
if (bi == null) {
JOptionPane.showMessageDialog(ImagePrinter.this,
"Selected File Is Not An Image File",
"Error Loading Image",JOptionPane.ERROR_MESSAGE);
fileName = "";
} else {
fileName = file.getPath();
}
} catch (IOException ioe) {
JOptionPane.showMessageDialog(ImagePrinter.this,
ioe,"Error Loading Image",
JOptionPane.ERROR_MESSAGE);
}
repaint();
}
} else if (ac.equals("Center")) {
JCheckBoxMenuItem center = (JCheckBoxMenuItem)ae.getSource();
centered = center.isSelected();
repaint();
} else if (ac.equals("Scale To Fit")) {
JCheckBoxMenuItem scale = (JCheckBoxMenuItem)ae.getSource();
scaled = scale.isSelected();
repaint();
} else if (ac.equals("About")) {
JOptionPane.showMessageDialog(ImagePrinter.this,
"ImagePrinter\nVersion: " + VERSION + " - " + DATE + "\n" +
"Copyright \u00a9 Knute Johnson 2008-2013. All rights
reserved.",
"About",JOptionPane.INFORMATION_MESSAGE);
}
}
public int print(Graphics g,PageFormat pf,int index) {
if (index == 0) {
render(g);
return Printable.PAGE_EXISTS;
} else
return Printable.NO_SUCH_PAGE;
}
void render(Graphics g2D) {
Graphics2D g = (Graphics2D)g2D;
int x = (int)pf.getImageableX();
int y = (int)pf.getImageableY();
int w = bi.getWidth();
int h = bi.getHeight();
if (scaled) {
double aspectRatioOfPage =
pf.getImageableWidth() / pf.getImageableHeight();
double aspectRatioOfImage = (double)w / h;
if (aspectRatioOfImage > aspectRatioOfPage) {
double scale = pf.getImageableWidth() / bi.getWidth();
w = (int)(w * scale);
h = (int)(h * scale);
} else {
double scale = pf.getImageableHeight() / bi.getHeight();
w = (int)(w * scale);
h = (int)(h * scale);
}
}
if (centered) {
int adjust = ((int)pf.getImageableWidth() - w) / 2;
x += adjust;
adjust = ((int)pf.getImageableHeight() - h) / 2;
y += adjust;
}
g.drawImage(bi,x,y,w,h,null);
}
private void loadData(PageFormat pf) {
Paper paper = pf.getPaper();
try {
BufferedReader br = new BufferedReader(new
FileReader(dataFile));
double x = Double.parseDouble(br.readLine());
double y = Double.parseDouble(br.readLine());
double iX = Double.parseDouble(br.readLine());
double iY = Double.parseDouble(br.readLine());
double w = Double.parseDouble(br.readLine());
double h = Double.parseDouble(br.readLine());
br.close();
paper.setImageableArea(x,y,iX,iY);
paper.setSize(w,h);
pf.setPaper(paper);
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (NumberFormatException nfe) {
nfe.printStackTrace();
}
}
private void saveData(PageFormat pf) {
Paper paper = pf.getPaper();
try {
BufferedWriter bw = new BufferedWriter(new
FileWriter(dataFile));
bw.write(Double.toString(paper.getImageableX()));
bw.newLine();
bw.write(Double.toString(paper.getImageableY()));
bw.newLine();
bw.write(Double.toString(paper.getImageableWidth()));
bw.newLine();
bw.write(Double.toString(paper.getImageableHeight()));
bw.newLine();
bw.write(Double.toString(paper.getWidth()));
bw.newLine();
bw.write(Double.toString(paper.getHeight()));
bw.newLine();
bw.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
class ImagePanel extends JPanel {
public ImagePanel() {
setPreferredSize(new Dimension(500,500));
}
public void paintComponent(Graphics g2D) {
// anti-alias all drawing
Graphics2D g = (Graphics2D)g2D;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
// draw file pathname
g.drawString(fileName,10,20);
// set scale
g.scale(0.5,0.5);
// center the paper in the frame
g.translate((getWidth() * 2.0 - pf.getWidth()) / 2.0,
(getHeight() * 2.0 - pf.getHeight()) / 2.0);
// draw the paper
g.drawRect(0,0,(int)pf.getWidth(),(int)pf.getHeight());
// draw the imageable area
g.drawRect((int)pf.getImageableX(),(int)pf.getImageableY(),
(int)pf.getImageableWidth(),(int)pf.getImageableHeight());
// draw the image if it exists
if (bi != null)
render(g);
}
}
static class ImageFileFilter extends
javax.swing.filechooser.FileFilter {
public boolean accept(File file) {
return file.isDirectory() || file.getName().matches(
"^.*\\.(?i:jpg|jpeg|png|bmp|wbmp|gif)$");
}
public String getDescription() {
return "Image Files";
}
}
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
new ImagePrinter();
}
});
}
}
--
Knute Johnson
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-06-08 06:17 -0700 |
| Message-ID | <6eo8p9lrdvp70st73bhbj8c3ughv5slbaj@4ax.com> |
| In reply to | #28659 |
On Wed, 04 Jun 2014 20:25:38 -0700, Knute Johnson <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone who said : > >I think you should set the PageFormat to landscape. Please see the >following code that I wrote to print images. Nothing rotated. I could get it to rotate by choosing landscape by clicking into the Windows printer dialog. And of course I was able to get it to rotate with AffineTransform. -- Roedy Green Canadian Mind Products http://mindprod.com In former times, people who craved absolute power became gangsters. Today, they become computer programmers.
[toc] | [prev] | [next] | [standalone]
| From | Knute Johnson <eternal@knutejohnson.com> |
|---|---|
| Date | 2014-06-08 14:09 -0700 |
| Message-ID | <ln2jeq$gls$1@dont-email.me> |
| In reply to | #28681 |
On 6/8/2014 06:17, Roedy Green wrote: > On Wed, 04 Jun 2014 20:25:38 -0700, Knute Johnson > <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone > who said : > >> >> I think you should set the PageFormat to landscape. Please see the >> following code that I wrote to print images. > > Nothing rotated. I could get it to rotate by choosing landscape by > clicking into the Windows printer dialog. > > And of course I was able to get it to rotate with AffineTransform. > Maybe I misunderstood what you wanted. To print landscape just select landscape but if you want your image drawn rotated, you have to do that yourself. -- Knute Johnson
[toc] | [prev] | [next] | [standalone]
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Date | 2014-06-08 22:40 +0000 |
| Message-ID | <ln2oo5$er0$1@dont-email.me> |
| In reply to | #28684 |
On Sun, 08 Jun 2014 14:09:46 -0700, Knute Johnson wrote: > On 6/8/2014 06:17, Roedy Green wrote: >> On Wed, 04 Jun 2014 20:25:38 -0700, Knute Johnson >> <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone >> who said : >> >> >>> I think you should set the PageFormat to landscape. Please see the >>> following code that I wrote to print images. >> >> Nothing rotated. I could get it to rotate by choosing landscape by >> clicking into the Windows printer dialog. >> >> And of course I was able to get it to rotate with AffineTransform. >> >> > Maybe I misunderstood what you wanted. To print landscape just select > landscape but if you want your image drawn rotated, you have to do that > yourself. Knute's program works here and does exactly what it says on the tin: pick an image that's longer than its wide, select landscape, select the printer, hit print and its done. The printed result is exactly what I expected: the image occupies the full printable area of the page (without changing default margins, which Knute's program doesn't allow, and is in landscape mode on the page. I'm running Linux Fedora 20, java version "1.6.0_45", and printing to a LAN-attached HP Laserjet 5 with a JetDirect network interface card. I assume that's pretty close what you wanted. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |
[toc] | [prev] | [next] | [standalone]
| From | Knute Johnson <eternal@knutejohnson.com> |
|---|---|
| Date | 2014-06-09 07:26 -0700 |
| Message-ID | <ln4g6j$oif$1@dont-email.me> |
| In reply to | #28685 |
On 6/8/2014 15:40, Martin Gregorie wrote: > On Sun, 08 Jun 2014 14:09:46 -0700, Knute Johnson wrote: > >> On 6/8/2014 06:17, Roedy Green wrote: >>> On Wed, 04 Jun 2014 20:25:38 -0700, Knute Johnson >>> <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone >>> who said : >>> >>> >>>> I think you should set the PageFormat to landscape. Please see the >>>> following code that I wrote to print images. >>> >>> Nothing rotated. I could get it to rotate by choosing landscape by >>> clicking into the Windows printer dialog. >>> >>> And of course I was able to get it to rotate with AffineTransform. >>> >>> >> Maybe I misunderstood what you wanted. To print landscape just select >> landscape but if you want your image drawn rotated, you have to do that >> yourself. > > Knute's program works here and does exactly what it says on the tin: pick > an image that's longer than its wide, select landscape, select the > printer, hit print and its done. The printed result is exactly what I > expected: the image occupies the full printable area of the page (without > changing default margins, which Knute's program doesn't allow, and is in > landscape mode on the page. > > I'm running Linux Fedora 20, java version "1.6.0_45", and printing to a > LAN-attached HP Laserjet 5 with a JetDirect network interface card. > > I assume that's pretty close what you wanted. > > To be honest I default the margins to 0.3 inches for my printer. But select PageFormat from the File menu and you can set the margins. -- Knute Johnson
[toc] | [prev] | [next] | [standalone]
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Date | 2014-06-09 16:10 +0000 |
| Message-ID | <ln4mac$bvm$2@dont-email.me> |
| In reply to | #28688 |
On Mon, 09 Jun 2014 07:26:29 -0700, Knute Johnson wrote: > To be honest I default the margins to 0.3 inches for my printer. But > select PageFormat from the File menu and you can set the margins. Oddly, I can't set anything apart from 25.4 mm margins on your program. I can set one of the margins how I like, but a soon as I tab to the next (or just click on it) the one I just changed reverts to 25.4 mm. I was going to see what happened if I printed an image with zero width margins all round. PS: and OTT: Knute, I've just been watching a BBC program about D-Day technology, which showed shots of Horsa troop-carrying gliders landing, seen from the ground. I don't think I've even seen such steep approaches (the Horsa could manage a 1:2 approach angle) or such low level and sudden rotations into the flare. The film is here: http://www.bbc.co.uk/iplayer/episode/b045gr8m/the-science-of-dday though I don't know if you'll be able to see it as the BBC often limits viewing the the UK. However, I'm told there are a lot of videos of Horsas on U-tube. Well, there are, but most are pretty bad. This is one of the better ones: https://www.youtube.com/watch?v=6HBZbOnmUPw -- martin@ | Martin Gregorie gregorie. | Essex, UK org |
[toc] | [prev] | [next] | [standalone]
| From | Knute Johnson <eternal@knutejohnson.com> |
|---|---|
| Date | 2014-06-09 11:41 -0700 |
| Message-ID | <ln4v54$jnl$1@dont-email.me> |
| In reply to | #28690 |
On 6/9/2014 09:10, Martin Gregorie wrote: > On Mon, 09 Jun 2014 07:26:29 -0700, Knute Johnson wrote: > >> To be honest I default the margins to 0.3 inches for my printer. But >> select PageFormat from the File menu and you can set the margins. > > Oddly, I can't set anything apart from 25.4 mm margins on your program. I > can set one of the margins how I like, but a soon as I tab to the next > (or just click on it) the one I just changed reverts to 25.4 mm. I was > going to see what happened if I printed an image with zero width margins > all round. > > PS: and OTT: Knute, I've just been watching a BBC program about D-Day > technology, which showed shots of Horsa troop-carrying gliders landing, > seen from the ground. I don't think I've even seen such steep approaches > (the Horsa could manage a 1:2 approach angle) or such low level and > sudden rotations into the flare. The film is here: > > http://www.bbc.co.uk/iplayer/episode/b045gr8m/the-science-of-dday > > though I don't know if you'll be able to see it as the BBC often limits > viewing the the UK. However, I'm told there are a lot of videos of Horsas > on U-tube. Well, there are, but most are pretty bad. This is one of the > better ones: > > https://www.youtube.com/watch?v=6HBZbOnmUPw > > The BBC video is blocked. The Horsa with those big flaps would really come down. Better than the Waco CG4As. My folks had a friend who was a glider troop. He was training in the the northeast US somewhere when the war ended. He told me that during training he never "landed" in a glider. They were always destroyed when they came to a stop. He wasn't looking forward to actually being in a combat landing. Have you see this video? https://www.youtube.com/watch?v=jsAKWma3zbY -- Knute Johnson
[toc] | [prev] | [next] | [standalone]
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Date | 2014-06-09 22:02 +0000 |
| Message-ID | <ln5ats$7ci$1@dont-email.me> |
| In reply to | #28694 |
On Mon, 09 Jun 2014 11:41:41 -0700, Knute Johnson wrote: > My folks had a friend who was a glider troop. He was training in the > the northeast US somewhere when the war ended. He told me that during > training he never "landed" in a glider. They were always destroyed when > they came to a stop. He wasn't looking forward to actually being in a > combat landing. > > Have you see this video? > > https://www.youtube.com/watch?v=jsAKWma3zbY No, that is not yet, but I will see it. It looks interesting and is bookmarked for future reference. BTW, there are persistent stories that a few CG4As were thermalled during training out west, presumably without a full load of troops on board! Thinking of that, you may enjoy this bit of fun. Note the flap settings during high speed passes. http://www.youtube.com/watch?v=Fs666zqMw0s -- martin@ | Martin Gregorie gregorie. | Essex, UK org |
[toc] | [prev] | [next] | [standalone]
| From | Knute Johnson <eternal@knutejohnson.com> |
|---|---|
| Date | 2014-06-09 15:56 -0700 |
| Message-ID | <ln5e3b$857$1@dont-email.me> |
| In reply to | #28697 |
On 6/9/2014 15:02, Martin Gregorie wrote: > On Mon, 09 Jun 2014 11:41:41 -0700, Knute Johnson wrote: > >> My folks had a friend who was a glider troop. He was training in the >> the northeast US somewhere when the war ended. He told me that during >> training he never "landed" in a glider. They were always destroyed when >> they came to a stop. He wasn't looking forward to actually being in a >> combat landing. >> >> Have you see this video? >> >> https://www.youtube.com/watch?v=jsAKWma3zbY > > No, that is not yet, but I will see it. It looks interesting and is > bookmarked for future reference. > > BTW, there are persistent stories that a few CG4As were thermalled during > training out west, presumably without a full load of troops on board! > Thinking of that, you may enjoy this bit of fun. Note the flap settings > during high speed passes. > > http://www.youtube.com/watch?v=Fs666zqMw0s > > > When I was towing gliders at El Mirage in the middle 70s, there were stories of guys that had soared CG4As. I never met any of them but it hadn't been that long after the war then. A couple of years later when I was a powered airplane flight instructor, we regularly had students that were WWII military pilots that were taking up flying again after 30 years. Sometimes they were awful and we had to tell some of them to go back to golf. Great ridge. I've only ridge soared once and that was in Hawaii at Dillingham. That was 30 years ago too. -- Knute Johnson
[toc] | [prev] | [next] | [standalone]
| From | Knute Johnson <eternal@knutejohnson.com> |
|---|---|
| Date | 2014-06-04 20:27 -0700 |
| Message-ID | <lmoo2s$jj6$2@dont-email.me> |
| In reply to | #28646 |
On 6/3/2014 11:04, Roedy Green wrote: > That lets me handle setting margins a bit more elegantly, and tells me > where the 1" margins came from, but it does not let me query now > narrow the margins of any given printer can be. No it doesn't and if you figure that out I would love to know. I originally thought that you could get that information from the PrinterJob somehow but I can't figure it out. -- Knute Johnson
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2014-06-05 19:56 -0400 |
| Message-ID | <lmr0b7$ptv$1@dont-email.me> |
| In reply to | #28660 |
On 06/04/2014 11:27 PM, Knute Johnson wrote: > On 6/3/2014 11:04, Roedy Green wrote: >> That lets me handle setting margins a bit more elegantly, and tells me >> where the 1" margins came from, but it does not let me query now >> narrow the margins of any given printer can be. > > No it doesn't and if you figure that out I would love to know. I > originally thought that you could get that information from the > PrinterJob somehow but I can't figure it out. > I've not tested javax.print.attribute.standard.MediaPrintableArea.
[toc] | [prev] | [next] | [standalone]
| From | Knute Johnson <eternal@knutejohnson.com> |
|---|---|
| Date | 2014-06-05 20:38 -0700 |
| Message-ID | <lmrd3n$s4k$1@dont-email.me> |
| In reply to | #28672 |
On 6/5/2014 16:56, Jeff Higgins wrote: > On 06/04/2014 11:27 PM, Knute Johnson wrote: >> On 6/3/2014 11:04, Roedy Green wrote: >>> That lets me handle setting margins a bit more elegantly, and tells me >>> where the 1" margins came from, but it does not let me query now >>> narrow the margins of any given printer can be. >> >> No it doesn't and if you figure that out I would love to know. I >> originally thought that you could get that information from the >> PrinterJob somehow but I can't figure it out. >> > I've not tested javax.print.attribute.standard.MediaPrintableArea. > I'll look into that, thanks. -- Knute Johnson
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-06-08 06:19 -0700 |
| Message-ID | <oho8p9lgg9hbsmof48t4evs6s6fn1slqtg@4ax.com> |
| In reply to | #28660 |
On Wed, 04 Jun 2014 20:27:30 -0700, Knute Johnson <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone who said : >No it doesn't and if you figure that out I would love to know. I >originally thought that you could get that information from the >PrinterJob somehow but I can't figure it out. I had a look at the code. The margins are set to one inch all the time. There is no native method to find out the actual margins. I suppose you could collect the numbers for thousands of printers. I don't know if PrintJob will give you a manfacturer and model number. Maybe a bit of JNI could add that ability. -- Roedy Green Canadian Mind Products http://mindprod.com In former times, people who craved absolute power became gangsters. Today, they become computer programmers.
[toc] | [prev] | [next] | [standalone]
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Date | 2014-06-08 15:49 +0000 |
| Message-ID | <ln20m8$2pq$1@dont-email.me> |
| In reply to | #28682 |
On Sun, 08 Jun 2014 06:19:47 -0700, Roedy Green wrote: > On Wed, 04 Jun 2014 20:27:30 -0700, Knute Johnson > <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone > who said : > >>No it doesn't and if you figure that out I would love to know. I >>originally thought that you could get that information from the >>PrinterJob somehow but I can't figure it out. > > I had a look at the code. The margins are set to one inch all the time. > There is no native method to find out the actual margins. > I'm not altogether surprised: to complexity of getting these details for any accessible printer no matter where it is and how it is accessed by the requesting system or where the printer server that supports it is located. There is a standard protocol (IPP) that can be used to get hold of paper sizes and printer capabilities, and its even supported by UNIX, Linux, OSX and Windows (post XP) for remote job submissions. While it could certainly be used to get these details from a remote printer or print server, its not at all obvious whether it can be used by an application to interrogate a local print spooler (on the same machine): even CUPS print servers, which do use IPP to talk to remote printers, don't necessarily allow an application to ask them about their printers and their capabilities. Are there any Java classes that support IPP? -- martin@ | Martin Gregorie gregorie. | Essex, UK org |
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2014-06-08 22:50 -0400 |
| Message-ID | <ln37ma$2v7$1@dont-email.me> |
| In reply to | #28683 |
On 06/08/2014 11:49 AM, Martin Gregorie wrote: > Are there any Java classes that support IPP? java+ipp brings up cups4j, ippclient, jspi and <http://docs.oracle.com/javase/8/docs/technotes/guides/jps/spec/JPSTOC.fm.html>.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.java.programmer
csiph-web