Class BengaliPdfGenerationHelloWorld
- java.lang.Object
-
- org.apache.pdfbox.examples.pdmodel.BengaliPdfGenerationHelloWorld
-
public class BengaliPdfGenerationHelloWorld extends java.lang.ObjectInspired 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.
-
-
Field Summary
Fields Modifier and Type Field Description private static intFONT_SIZEprivate static intLINE_GAPprivate static java.lang.StringLOHIT_BENGALI_TTFprivate static intMARGINprivate static java.lang.StringTEXT_SOURCE_FILE
-
Constructor Summary
Constructors Modifier Constructor Description privateBengaliPdfGenerationHelloWorld()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.util.List<java.lang.String>getBengaliTextFromFile()private static PDRectanglegetPageSize()private static java.util.List<java.util.List<java.lang.String>>getReAlignedTextBasedOnPageHeight(java.util.List<java.lang.String> originalLines, PDFont font, float workablePageHeight)private static java.util.List<java.lang.String>getReAlignedTextBasedOnPageWidth(java.util.List<java.lang.String> originalLines, PDFont font, float workablePageWidth)static voidmain(java.lang.String[] args)
-
-
-
Field Detail
-
LINE_GAP
private static final int LINE_GAP
- See Also:
- Constant Field Values
-
LOHIT_BENGALI_TTF
private static final java.lang.String LOHIT_BENGALI_TTF
- See Also:
- Constant Field Values
-
TEXT_SOURCE_FILE
private static final java.lang.String TEXT_SOURCE_FILE
- See Also:
- Constant Field Values
-
FONT_SIZE
private static final int FONT_SIZE
- See Also:
- Constant Field Values
-
MARGIN
private static final int MARGIN
- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.io.IOException- Throws:
java.io.IOException
-
getReAlignedTextBasedOnPageHeight
private static java.util.List<java.util.List<java.lang.String>> getReAlignedTextBasedOnPageHeight(java.util.List<java.lang.String> originalLines, PDFont font, float workablePageHeight)
-
getReAlignedTextBasedOnPageWidth
private static java.util.List<java.lang.String> getReAlignedTextBasedOnPageWidth(java.util.List<java.lang.String> originalLines, PDFont font, float workablePageWidth) throws java.io.IOException- Throws:
java.io.IOException
-
getPageSize
private static PDRectangle getPageSize()
-
getBengaliTextFromFile
private static java.util.List<java.lang.String> getBengaliTextFromFile() throws java.io.IOException- Throws:
java.io.IOException
-
-