use of com.itextpdf.layout.element.Paragraph in project i7js-highlevel by itext.
the class C03E17_MaryReillyV10 method createPdf.
public void createPdf(String dest) throws IOException {
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
Document document = new Document(pdf);
Paragraph p = new Paragraph("Mary Reilly is a maid in the household of Dr. Jekyll: ");
Image img = new Image(ImageDataFactory.create(MARY));
img.scale(0.5f, 0.5f);
img.setRotationAngle(-Math.PI / 6);
p.add(img);
document.add(p);
document.close();
}
use of com.itextpdf.layout.element.Paragraph in project i7js-highlevel by itext.
the class C04E06_CustomParagraph method createPdf.
public void createPdf(String dest) throws IOException {
// Initialize PDF document
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
// Initialize document
Document document = new Document(pdf);
Paragraph p1 = new Paragraph("The Strange Case of Dr. Jekyll and Mr. Hyde");
p1.setBackgroundColor(ColorConstants.ORANGE);
document.add(p1);
Paragraph p2 = new Paragraph("The Strange Case of Dr. Jekyll and Mr. Hyde");
p2.setBackgroundColor(ColorConstants.ORANGE);
p2.setNextRenderer(new MyParagraphRenderer(p2));
document.add(p2);
document.close();
}
use of com.itextpdf.layout.element.Paragraph in project i7js-highlevel by itext.
the class C01E02_Text_Paragraph_Cardo method createPdf.
public void createPdf(String dest) throws IOException {
// Initialize PDF document
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
// Initialize document
Document document = new Document(pdf);
// Add content
FontProgram fontProgram = FontProgramFactory.createFont(REGULAR);
PdfFont font = PdfFontFactory.createFont(fontProgram, PdfEncodings.WINANSI, EmbeddingStrategy.PREFER_EMBEDDED);
PdfFont bold = PdfFontFactory.createFont(BOLD, PdfEncodings.WINANSI, EmbeddingStrategy.PREFER_EMBEDDED);
PdfFont italic = PdfFontFactory.createFont(ITALIC, PdfEncodings.WINANSI, EmbeddingStrategy.PREFER_EMBEDDED);
Text title = new Text("The Strange Case of Dr. Jekyll and Mr. Hyde").setFont(bold);
Text author = new Text("Robert Louis Stevenson").setFont(font);
Paragraph p = new Paragraph().setFont(italic).add(title).add(" by ").add(author);
document.add(p);
// Close document
document.close();
}
use of com.itextpdf.layout.element.Paragraph in project i7js-highlevel by itext.
the class C01E01_Text_Paragraph method createPdf.
public void createPdf(String dest) throws IOException {
// Initialize PDF document
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
// Initialize document
Document document = new Document(pdf);
// Add content
PdfFont font = PdfFontFactory.createFont(StandardFonts.TIMES_ROMAN);
PdfFont bold = PdfFontFactory.createFont(StandardFonts.TIMES_BOLD);
Text title = new Text("The Strange Case of Dr. Jekyll and Mr. Hyde").setFont(bold);
Text author = new Text("Robert Louis Stevenson").setFont(font);
Paragraph p = new Paragraph().add(title).add(" by ").add(author);
document.add(p);
// Close document
document.close();
}
use of com.itextpdf.layout.element.Paragraph in project i7js-highlevel by itext.
the class C07E08_FullScreen method createPdf.
public void createPdf(String dest) throws IOException {
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
pdf.getCatalog().setPageMode(PdfName.FullScreen);
PdfViewerPreferences preferences = new PdfViewerPreferences();
preferences.setNonFullScreenPageMode(PdfViewerPreferencesConstants.USE_THUMBS);
pdf.getCatalog().setViewerPreferences(preferences);
Document document = new Document(pdf, PageSize.A8);
document.add(new Paragraph("Mr. Jekyl"));
document.add(new AreaBreak());
document.add(new Paragraph("Mr. Hyde"));
document.close();
}
Aggregations