Example usage for java.io FileOutputStream FileOutputStream

List of usage examples for java.io FileOutputStream FileOutputStream

Introduction

In this page you can find the example usage for java.io FileOutputStream FileOutputStream.

Prototype

public FileOutputStream(FileDescriptor fdObj) 

Source Link

Document

Creates a file output stream to write to the specified file descriptor, which represents an existing connection to an actual file in the file system.

Usage

From source file:MainClass.java

public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    document.open();/*  w w  w  .jav  a2 s. c  om*/
    Image tiff = Image.getInstance("dog.tiff");
    document.add(tiff);
    document.add(new Paragraph("Original width: " + tiff.width() + "; original height: " + tiff.height()));

    document.close();
}

From source file:PhraseWithLeadingLinePDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {/*from   w  w  w  . java2 s.  c o  m*/
        PdfWriter.getInstance(document, new FileOutputStream("PhraseWithLeadingLinePDF.pdf"));

        document.open();

        Phrase phrase0 = new Phrase();
        Phrase phrase1 = new Phrase("this is a phrase\n");

        Phrase phrase2 = new Phrase(24,
                "this is a phrase with leading 24. Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text \n");
        document.add(phrase0);
        document.add(phrase1);
        document.add(phrase2);
    } catch (Exception ioe) {
        System.err.println(ioe.getMessage());
    }
    document.close();
}

From source file:PdfVersion1_3.java

public static void main(String[] args) {
    Document document = new Document();
    try {//  ww  w . ja  va  2 s.c om
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("PDFversion1_3.pdf"));
        writer.setPdfVersion(PdfWriter.VERSION_1_3);
        //writer.setPdfVersion(PdfWriter.VERSION_1_4);
        //writer.setPdfVersion(PdfWriter.VERSION_1_5);
        //writer.setPdfVersion(PdfWriter.VERSION_1_6);
        document.open();
        document.add(new Paragraph("This is a PDF-1.3 document"));
    } catch (Exception ioe) {
        System.err.println(ioe.getMessage());
    }
    document.close();
}

From source file:MainClass.java

public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    document.open();/*from  w  ww . ja  va  2s  .c om*/
    Image jpg = Image.getInstance("dog.jpg");
    jpg.scalePercent(50);
    document.add(new Paragraph("scalePercent(50)"));
    document.add(jpg);
    document.close();
}

From source file:MainClass.java

public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    document.open();/*from  ww  w  .  j a v a2 s  .  co m*/
    document.add(new Paragraph("dog.tiff"));
    Image img1 = Image.getInstance("dog.tiff");
    System.out.println(img1.getClass().getName());
    document.add(img1);

    document.close();
}

From source file:MainClass.java

public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    document.open();//  w ww . j a v a 2  s  . c o  m
    List list1 = new List(List.ORDERED, List.ALPHABETICAL, 20);
    list1.add(new ListItem("A"));
    list1.add(new ListItem("B"));
    list1.add(new ListItem("C"));
    document.add(list1);

    document.close();
}

From source file:MainClass.java

public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    document.open();//  w  w w.ja  v  a2 s  .c om
    document.add(new Paragraph("dog.eps"));
    Image img1 = Image.getInstance("dog.eps");
    System.out.println(img1.getClass().getName());
    document.add(img1);

    document.close();
}

From source file:MainClass.java

public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    document.open();/*from  w  w w  .j  av  a  2s  . com*/
    document.add(new Paragraph("dog.bmp"));
    Image img1 = Image.getInstance("dog.bmp");
    System.out.println(img1.getClass().getName());
    document.add(img1);

    document.close();
}

From source file:MainClass.java

public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    document.open();/*ww w.java 2  s. c  o m*/
    document.add(new Paragraph("dog.gif"));
    Image img1 = Image.getInstance("dog.gif");
    System.out.println(img1.getClass().getName());
    document.add(img1);

    document.close();
}

From source file:MainClass.java

public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    document.open();/*from   ww w  .  j  a v a2s .co  m*/
    document.add(new Paragraph("dog.jpg"));
    Image img1 = Image.getInstance("dog.jpg");
    System.out.println(img1.getClass().getName());
    document.add(img1);

    document.close();
}