B4A Class [B4X] PDF Generator - B4X Cross Platform - Class 100% B4X Code

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

1673250547389.png

1672644892353.png

1672644909961.png

1704277206392.png




spsp
 

Attachments

  • 1672644870818.png
    1672644870818.png
    7.1 KB · Views: 1,356
  • 1672644931064.png
    1672644931064.png
    48.8 KB · Views: 2,975
  • pdfgen.zip
    284.4 KB · Views: 931
Last edited:

hatzisn

Expert
Licensed User
Longtime User
I need some help to achieve this.

Hi, did you have any luck on succeeding adding utf8 support in your class?
 
Top