PRIM_PDF (PRIM_PDF)
PDF Generator
Ancestors - Object (PRIM_OBJT)
Details
A PDF generator component is used to create PDF reports.
Includes an Autotable subcomponent to facilitate creating preformatted tables.
Example
Creating a simple PDF report.
Define_Com Class(#PRIM_PDF) Name(#pdf) UnitM(mm) PageFormat(A4) PageOrientation(Portrait)
Define Field(#CreationDate) Type(*DATETIME)
#pdf.start
#pdf.setDocumentProperties Title('My PDF report') Author('John Smith') Creator('My Company, Inc') Keywords('Weekly report')
#CreationDate := #CreationDate.Now
#pdf.setCreationDate Datetime(#CreationDate)
#pdf.setFont Font('Times') Style(Italic)
#pdf.setFontSize Size(14)
#pdf.text Text('Hello world!') Left(10) Top(10)
#pdf.addPage
#pdf.text Text('This line is on the second page') Left(10) Top(10)
#pdf.save Filename('MyReport.pdf')
Properties
Name | Description |
|---|---|
ComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT) | |
ComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT) | |
ComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT) | |
Generic space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT) | |
ComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT) | |
ComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT) | |
Name identifies the component Inherited from Object (PRIM_OBJT) | |
Owner owns this component Inherited from Object (PRIM_OBJT) | |
The format of the page | |
Orientation of the page | |
The component instance to which this instance is attached. The visual container for a control or the collector of a set of child instances Inherited from Object (PRIM_OBJT) | |
Measurement unit to be used when coordinates are specified |
Events
Name | Description |
|---|---|
CreateInstance is signalled when an instance of a component is created Inherited from PRIM_PDF (PRIM_PDF) | |
DestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from PRIM_PDF (PRIM_PDF) |
Methods
Name | Description |
|---|---|
Adds an image to the PDF document Bitmap, ImageFileFormat, Left, Top, Width, Height, ImageCompression, Rotation | |
Adds and transfers focus to new page in PDF document | |
Adds a circle to the PDF document CenterX, CenterY, Radius, FillStyle | |
Creates an instance of a PDF AutoTable Result | |
Draws a line on the current page Left, Top, Right, Bottom | |
Adds a rectangle to the PDF document Left, Top, Width, Height, FillStyle | |
Adds a rectangle with rounded corners to the PDF document Left, Top, Width, Height, RadiusX, RadiusY, FillStyle | |
Saves the PDF document Filename | |
Sets the PDF document's creation date Datetime | |
Sets the display mode options Zoom, Layout | |
Sets properties of the PDF document Title, Author, Creator, Keywords | |
Sets the stroke color for upcoming elements Color | |
Sets the fill color for upcoming elements Color | |
Sets text font face, variant for upcoming text elements Font, Style | |
Sets font size for upcoming text elements Size | |
Sets the dash pattern for upcoming lines Pattern, Phase | |
Sets the line width for upcoming lines Width | |
Sets the text color for upcoming elements Color | |
Starts the PDF document | |
Adds text to the page Text, Left, Top |