mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-23 23:37:06 +00:00
gnujpdf reformat
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package gnu.jpdf;
|
||||
|
||||
|
||||
import gnu.jpdf.PDFJob;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -10,31 +9,30 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class Test {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
PDFJob job=new PDFJob(new FileOutputStream("test.pdf"));
|
||||
PageFormat pf=new PageFormat();
|
||||
PDFJob job = new PDFJob(new FileOutputStream("test.pdf"));
|
||||
PageFormat pf = new PageFormat();
|
||||
pf.setOrientation(PageFormat.PORTRAIT);
|
||||
Paper p = new Paper();
|
||||
p.setSize(210,297); //A4
|
||||
p.setSize(210, 297); //A4
|
||||
pf.setPaper(p);
|
||||
|
||||
|
||||
BufferedImage img = ImageIO.read(new File("earth.jpg"));
|
||||
|
||||
|
||||
int w = 200;
|
||||
|
||||
for(int i=0;i<10;i++){
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
Graphics g = job.getGraphics();
|
||||
g.drawImage(img, 0, 0,w,w, null);
|
||||
g.drawImage(img, 0, 0, w, w, null);
|
||||
g.dispose();
|
||||
}
|
||||
|
||||
|
||||
job.end();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user