This is a Delphi demonstration program using the losLab PDFlibPas library, 
mainly showcasing various functions of PDF document creation and manipulation, 
with a particular focus on text layout, image processing, and PDF printing technologies.

Function Flow

Step1 Button
Create an A5-sized PDF document
Set the top-left corner as the origin and use millimeters as the unit of measurement
Add multiple TrueType fonts (TimesNewRoman, Helvetica, Arial)
Draw colored text in different fonts on the first page
Add simple text to the second page
Save the PDF as a file and memory stream

Step2 Button
Load previously created PDF from memory stream
Load bitmap image (Image1.bmp)
Add image to the second page of the PDF
Save updated PDF

Step3 Button
Load previous PDF document
Calculate text-related parameters: TextHeight (text height), LineCount (number of lines), etc.
Demonstrate handling multi-line text
Use DrawWrappedText method for automatic line wrapping
Display content after automatic line wrapping
Save result as new PDF file

Step4 Button
Split long text into two parts (Text1 and Text2)
Calculate available space on first page (AvailableHeight)
Draw first part of text on first page 
Create new page to draw second part of text 
Achieve cross-page display effect 
Automatically open generated PDF file

Step5 Print Test 
Load created PDFs 
Create custom printer 
Set A5 paper size and portrait orientation 
Configure print options and execute print

Step6 Basic Examples
Showcase font features, text drawing, and image processing Display list of system-installed fonts Render PDF pages as images for display in TImage control
Use memory streams (TMemoryStream) to handle PDFs
Support multiple fonts and special characters like Polish characters 
Implement automatic line wrapping across pages 
Handle image loading, scaling, embedding 
Provide functionality for printing PDFs