E D R , A S I H C RSS

i Text

No older revisions available

No older revisions available



Java를 이용하여 PDF 파일을 제작을 도와주는 라이브러리. 라이선스는 MPL과 LGPL.
RefactorMe 페이지이름이 부적절하다고 생각하시는 분은 페이지이름바꾸기해 주세요. 프로젝트(라이브러리) 이름을 그대로 사용했습니다.

예제

  • HelloWorld

    ~cpp 
    package spike;
    
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.Paragraph;
    import com.lowagie.text.pdf.PdfWriter;
    
    
    public class HelloWorld {
        public HelloWorld() {
            writeHello();
        }
        
        private void writeHello() {
            Document document = new Document();
            try {
                PdfWriter.getInstance(document, new FileOutputStream("Hello.pdf"));
    	        document.open();
    	        document.add(new Paragraph("Hello, World"));
    	        document.close();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (DocumentException e) {
                e.printStackTrace();
            }
        }
    
        public static void main(String args[]) {
            new HelloWorld();
        }
    }
      
    결과 파일 : Upload:Hello.pdf
----
도구분류, 프로그래밍분류
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:41
Processing time 0.5617 sec