Hii 나는 인쇄 할 파일 경로와 함께 레이아웃 오리엔테이션, 인쇄 매수, 페이지 수 등의 인쇄 사양을 보낼 수있는 Windows 용 Java 프로그램을 원합니다.사양이있는 Java 인쇄 프로그램?
M이 코드를 사용하면 인쇄 사양을 제공 할 수 없습니까?
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
public class PrintFile {
public static void fileToPrint(File fis) {
try {
Desktop desktop = null;
if (Desktop.isDesktopSupported())
{
desktop = Desktop.getDesktop();
}
desktop.print(fis);
System.out.print("Printing Document");
}
catch (IOException ioe)
{
ioe.printStackTrace();
}
}
}
attr_set.add (MediaSize.ISO_A4); 오류를 제공하고 있습니다. 그것을 해결할 수 없습니다. – Harinder
http://stackoverflow.com/q/5742143/689853 ..이 부분도 확인하십시오 .. – Harinder
어떤 종류의 오류가 있습니까? MediaSize 클래스를 가져와야합니다. http://download.oracle.com/javase/1.4.2/docs/api/javax/print/attribute/standard/MediaSize.html –