Jan 2, 2023 Replies: 61 Hi, This class cPDF.bas (version 0.6 - 2024-01-03) generate PDF File with limited fonctionnalities (but enough for me) Add pages with different paper size (use constants or custom size) PDF standards font (Courier, Helvetica, Times, Symbol and Zapfdingbats), style (Normal, Bold, Italic, Underline and StrikeThrough), encoding cp1252 draw text : single line of text at position x, y draw text flow with explicit and automatic CR at current x,y position with alignment (left, center, right, justify) Measure text (width and height) Measure multiline text (width and height) draw line draw rectangle draw images (only PNG, all format that can be loaded with xui.loadbitmap) use pdf commands directly save to file with/without compression Source full commented, example for B4J and B4A, I don't use B4I (but should be OK) dependencies : B4XCollections RandomAccessFile Help welcome to add support for : PNG image wih colorspace = 6 JPG image loading font from file spsp Attachments 1672644870818.png 7.1 KB · Views: 1,996 1672644931064.png 48.8 KB · Views: 3,772 pdfgen.zip pdfgen.zip 284.4 KB · Views: 1,588 Last edited: Jan 3, 2024 Click to expand...
Hi, This class cPDF.bas (version 0.6 - 2024-01-03) generate PDF File with limited fonctionnalities (but enough for me) Add pages with different paper size (use constants or custom size) PDF standards font (Courier, Helvetica, Times, Symbol and Zapfdingbats), style (Normal, Bold, Italic, Underline and StrikeThrough), encoding cp1252 draw text : single line of text at position x, y draw text flow with explicit and automatic CR at current x,y position with alignment (left, center, right, justify) Measure text (width and height) Measure multiline text (width and height) draw line draw rectangle draw images (only PNG, all format that can be loaded with xui.loadbitmap) use pdf commands directly save to file with/without compression Source full commented, example for B4J and B4A, I don't use B4I (but should be OK) dependencies : B4XCollections RandomAccessFile Help welcome to add support for : PNG image wih colorspace = 6 JPG image loading font from file spsp
hatzisn Expert Licensed User Longtime User May 23, 2025 #61 spsp said: I need some help to achieve this. Click to expand... Hi, did you have any luck on succeeding adding utf8 support in your class?
spsp said: I need some help to achieve this. Click to expand... Hi, did you have any luck on succeeding adding utf8 support in your class?
Almora Well-Known Member Licensed User Longtime User May 19, 2026 #62 hatzisn said: Hi, did you have any luck on succeeding adding utf8 support in your class? Click to expand... this is an important problem..
hatzisn said: Hi, did you have any luck on succeeding adding utf8 support in your class? Click to expand... this is an important problem..