Hello,
Here are 3 classes :
- PdfCreator : create PDF
- PDFViewer : render PDF
- clsFormPDF : form to preview PDF (Page navigation, Zoom, Print, Save)
PdfCreator and PDFViewer wraps PDFBox
You have to download pdfbox-app-2.0.20.jar and copy it in the additional folder
You have to download icu4j-67_1.jar and copy it in the additional folder for right to left and connected arabic characters
For right to left and connected arabic characters, you need to uses the "bidi" method to buld your string
The zip contains a small project which show how to create PDF and preview them
To create a PDF :
spsp
Here are 3 classes :
- PdfCreator : create PDF
- PDFViewer : render PDF
- clsFormPDF : form to preview PDF (Page navigation, Zoom, Print, Save)
PdfCreator and PDFViewer wraps PDFBox
You have to download pdfbox-app-2.0.20.jar and copy it in the additional folder
You have to download icu4j-67_1.jar and copy it in the additional folder for right to left and connected arabic characters
B4X:
#AdditionalJar: pdfbox-app-2.0.20.jar
#AdditionalJar: icu4j-67_1.jar
For right to left and connected arabic characters, you need to uses the "bidi" method to buld your string
B4X:
s=pdfcreator.bidi("صباحا")
The zip contains a small project which show how to create PDF and preview them
- The fist is very simple, just few lines of text
- The second is a long list with image, table, page footer, text color, background color....
- The third use differents standard fonts and load a font from a file and display arabic characters
To create a PDF :
- Create an instance of pdfCreator and initialize it
- Create page
- Create content
- Write on the content (text, image, rect)
- Close content
- Add page to PDF
- repeat 2 to 6
- write PDF to stream or file
spsp
Attachments
Last edited: