使用HP Universal Printing PS将页面属性分配给使用Java生成的postscript文件

时间:2011-12-20 12:26:23

标签: java pdf postscript

我正在尝试生成纸张大小为7 * 8.5英寸的postscript文件。我能够生成postscript文件。但页面大小为8.5 * 11英寸。

我怀疑它是否正在考虑我正在使用的属性集。

感谢任何帮助。

// Load the PDF document

PDFPrint pdfPrint = new PDFPrint(pdfFile, null);
File outputFile   = new File (psFile);

PrintSettings ps = new PrintSettings ();
pdfPrint.setPrintSettings(ps);

// Create attribute set to print to a file
HashPrintRequestAttributeSet attrSet = new HashPrintRequestAttributeSet();
attrSet.add (new Destination (outputFile.toURI()));
attrSet.add(OrientationRequested.LANDSCAPE);

attrSet.add(new MediaPrintableArea((float)0,(float) 0,(float)7,(float)8.5,MediaPrintableArea.INCH));            

//Send the PDF to the printer                                                 
pdfPrint.print("HP Universal Printing PS", ps, attrSet);

谢谢, Siri的

0 个答案:

没有答案