This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int minimum = 10; | |
int maksimum = 25; | |
int randomSayi = new Random().nextInt((maksimum - minimum ) + 1) + minimum; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Her Sayfayı A4 Boyutuna getirdik | |
pdfDosyam.setPageSize(PageSize.A4); | |
// Şu şekilde A5 boyutuna da getirebiliriz | |
// Bunun gibi bir çok boyutu bulunmakta | |
pdfDosyam.setPageSize(PageSize.A5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pdfDosyam.addTitle("PDF Başlığı"); | |
pdfDosyam.addSubject("PDF Açıklaması"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Oluşturma tarihini girdik | |
pdfDosyam.addCreationDate(); | |
// Yazar ve Kurucu adını ekledik | |
pdfDosyam.addAuthor("PDF Yazar Adı"); | |
pdfDosyam.addCreator("PDF Oluşturucu Adı"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
// Document pdfDosyam = new Document(); | |
// pdfDosyam isimli dosyayı yukarıdaki gibi önce oluşturmalıyız. | |
// Oluşturmadan sonra aşağıdaki gibi kaydediyoruz | |
PdfWriter.getInstance(pdfDosyam, new FileOutputStream(new | |
File(Environment.getExternalStorageDirectory(),"test.pdf"))); | |
} catch (DocumentException | FileNotFoundException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Paragraph paragraf = new Paragraph("Merhaba Dünya"); | |
// Paragrafın konumunu ayarlamak | |
paragraf.setAlignment(Element.ALIGN_CENTER); | |
// Paragrafı pdf dosyamıza ekleme | |
pdfDosyam.add(paragraf); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Separator tanımlama ve renklendirme | |
LineSeparator lineSeparator = new LineSeparator(); | |
lineSeparator.setLineColor(new BaseColor(0, 0, 0, 68)); | |
// Ekleme | |
pdfDosyam.add(new Chunk(lineSeparator)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2 Sütunlu tablo oluşturma | |
PdfPTable tablo_1 = new PdfPTable(2); | |
// Hücre oluşturma kısmı | |
PdfPCell hucre_1 = new PdfPCell(new Paragraph(new Chunk("Satır - 1"))); | |
PdfPCell hucre_2 = new PdfPCell(new Paragraph(new Chunk("Satır - 2"))); | |
// Hücrelere iç boşluk verme | |
hucre_1.setPadding(5); | |
hucre_2.setPadding(5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Chapter bolum1 = new Chapter("Bölüm", 1); | |
Paragraph bolum1_icerik = new Paragraph("Bölüm 1 İçerik"); | |
bolum1.add(bolum1_icerik); | |
pdfDosyam.add(bolum1); | |
Chapter bolum2 = new Chapter("Bölüm", 2); | |
bolum2.add(new Paragraph("Bölüm 2 İçerik")); | |
pdfDosyam.add(bolum2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List liste1 = new RomanList(); | |
liste1.add(new ListItem("Item 1")); | |
liste1.add(new ListItem("Item 2")); | |
pdfDosyam.add(liste1); | |
List liste2 = new List(); | |
liste2.add(new ListItem("İtem 1")); | |
liste2.add(new ListItem("İtem 2")); |