Java Tutorial/PDF/BMP Image — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:21, 1 июня 2010
Load bmp image
<source lang="java">
import java.io.FileOutputStream; import com.lowagie.text.Document; import com.lowagie.text.Image; import com.lowagie.text.Paragraph; import com.lowagie.text.pdf.PdfWriter; public class MainClass {
public static void main(String[] args) throws Exception { Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream("2.pdf")); document.open(); document.add(new Paragraph("dog.bmp")); Image img1 = Image.getInstance("dog.bmp"); System.out.println(img1.getClass().getName()); document.add(img1); document.close(); }
}</source>