Top Description Fields Constructors Methods
org.apache.pdfbox.examples.pdmodel

public Class BengaliPdfGenerationHelloWorld

extends Object
Class Inheritance
Imports
java.io.BufferedReader, .IOException, .InputStreamReader, java.nio.charset.StandardCharsets, java.util.ArrayList, .List, .StringTokenizer, org.apache.pdfbox.pdmodel.PDDocument, .PDPage, .PDPageContentStream, org.apache.pdfbox.pdmodel.common.PDRectangle, org.apache.pdfbox.pdmodel.font.PDFont, .PDType0Font

Inspired from PdfBox Example. This attempts to correctly demonstrate to what extent Bengali text rendering is supported. We read large amount of text from a file and try to render it properly.
Author
Palash Ray

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final String
private static final int
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static List<String>
private static PDRectangle
private static List<List<String>>
getReAlignedTextBasedOnPageHeight(List<String> originalLines, PDFont font, float workablePageHeight)

private static List<String>
getReAlignedTextBasedOnPageWidth(List<String> originalLines, PDFont font, float workablePageWidth)

public static void
main(String[] args)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FONT_SIZEback to summary
private static final int FONT_SIZE
LINE_GAPback to summary
private static final int LINE_GAP
LOHIT_BENGALI_TTFback to summary
private static final String LOHIT_BENGALI_TTF
MARGINback to summary
private static final int MARGIN
TEXT_SOURCE_FILEback to summary
private static final String TEXT_SOURCE_FILE

Constructor Detail

BengaliPdfGenerationHelloWorldback to summary
private BengaliPdfGenerationHelloWorld()

Method Detail

getBengaliTextFromFileback to summary
private static List<String> getBengaliTextFromFile() throws IOException
getPageSizeback to summary
private static PDRectangle getPageSize()
getReAlignedTextBasedOnPageHeightback to summary
private static List<List<String>> getReAlignedTextBasedOnPageHeight(List<String> originalLines, PDFont font, float workablePageHeight)
getReAlignedTextBasedOnPageWidthback to summary
private static List<String> getReAlignedTextBasedOnPageWidth(List<String> originalLines, PDFont font, float workablePageWidth) throws IOException
mainback to summary
public static void main(String[] args) throws IOException