回覆列表
  • 1 # 何以笙丶丶

    public class StampStationery {

    public static final String filename = "F://demo.pdf";

    public static void main(String[] args) throws IOException,

    DocumentException{

    Document document = new Document(new Rectangle(400, 400));

    PdfWriter writer = PdfWriter.getInstance(document,new FileOutputStream(filename));

    document.open();

    PdfContentByte cb = writer.getDirectContent();

    String content = "hello word!";

    cb.beginText();

    Font f = new Font();

    f.setSize(18);

    Phrase p = new Phrase(content, f);

    //(100,200) 是x,y座標 45 是偏移角度 字型的演示自己設定

    ColumnText.showTextAligned(cb, 0, p, 100, 200, 45);

    cb.endText();

    document.close();

    }

    }

  • 中秋節和大豐收的關聯?
  • 如何簡單快速使全身面板變白變嫩變光滑?