PDFLib Package (Pure Ring library for generating PDF files)

36 views
Skip to first unread message

Mahmoud Fayed

unread,
May 18, 2026, 2:00:36 PMMay 18
to The Ring Programming Language
Hello

PDFLib Package (Pure Ring library for generating PDF files)


PDFLib is a pure Ring implementation for generating PDF 1.4 files with no external dependencies. Output is compatible with most PDF viewers including Adobe Acrobat, Foxit Reader, and web browsers.

Install:

ringpm install pdflib from ringpackages

features:

  • Page management — multiple pages, sizes (A4, Letter, Legal, etc.), portrait/landscape orientation, margins
  • Text — 14 PDF standard fonts (no font files needed; supplied by every PDF viewer), sizes, colors, left/center/right alignment
  • Paragraphs — word-wrapping with configurable line height and alignment
  • Arabic / Unicode text — any TTF can be loaded and embedded; full shaping and RTL pipeline for Arabic; direct glyph mapping for Latin extensions, Greek, Cyrillic, and CJK; complex scripts (Devanagari, Thai, etc.) are not supported
  • Shapes — rectangles, circles, ellipses, lines, polygons; stroke, fill, or both
  • Tables — headers, alternating row colors, borders, explicit or auto column widths, Arabic-aware cell rendering
  • Lists — bullet lists and numbered lists
  • Charts — bar charts and pie charts with legends
  • Images — JPEG (DCTDecode), PNG (FlateDecode, all color types), BMP (24-bit); pure Ring parsers, no C library required
  • Page numbers — configurable format and position
  • Headers / Footers — per-document text with alignment
  • Watermarks — rotated text at arbitrary angle
  • Graphics state — save/restore, line width, cap, join, dash patterns
  • Document properties — title, author, subject, keywords, creator
Screen Shot:

pdflib.png

Greetings,
Mahmoud

Mansour Ayouni

unread,
May 18, 2026, 4:11:41 PMMay 18
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

A huge amount of work !
I enjoyed reading the pdfwriter.ring file. I did not know it is actually possible to create PDF directly without a C or C++ library.

All the best,
Mansour

--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ring-lang/b2a44e7d-630c-4ed5-b724-fcb6eeaded23n%40googlegroups.com.

Mahmoud Fayed

unread,
May 18, 2026, 5:17:33 PMMay 18
to The Ring Programming Language
Hello Mansour

>> "A huge amount of work ! I enjoyed reading the pdfwriter.ring file. I did not know it is actually possible to create PDF directly without a C or C++ library."

You are welcome :D
Different types of files could be generated directly from Ring using file processing functions & knowing the file structure & binary representation
We used to use C/C++ libraries for different reasons
(1) The C/C++ libraries already exist (i.e. they are already developed & tested) so using them save time
(2) Using C/C++ libraries could be necessary for specific libraries to get acceptable performance (for example video/images processing)

But in general, many useful libraries could be written in Ring itself and satisfy the needs of many applications.

Our Recommended Approached?
==> BOTH OF THEM, i.e. we provide C/C++ extensions & Also pure Ring libraries because each way comes with it's advantages.

Greetings,
Mahmoud

Youssef Saeed

unread,
May 18, 2026, 5:56:38 PMMay 18
to The Ring Programming Language
Hello Mahmoud,

Thank you so much for sharing such a powerful library.

Best regards,
Youssef

Mahmoud Fayed

unread,
May 18, 2026, 6:07:15 PMMay 18
to The Ring Programming Language
Hello Youssef

>> "Thank you so much for sharing such a powerful library."

You are welcome :D

Greetings,
Mahmoud

Bert Mariani

unread,
May 18, 2026, 7:00:28 PMMay 18
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud

Lots of fantastic packages that you are creating !!

Regards
Bert Mariani

--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.

Mahmoud Fayed

unread,
May 18, 2026, 7:34:04 PMMay 18
to The Ring Programming Language
Hello Bert

>> "Lots of fantastic packages that you are creating !!"

Thank you very much :D

Greetings,
Mahmoud
Reply all
Reply to author
Forward
0 new messages