Blog

All Blog Posts  |  Next Post  |  Previous Post

TMS FNC Core update: Printing and Design-time Editors

Bookmarks: 

Wednesday, July 28, 2021

Included in the version 2.6 release of the TMS FNC Core package is a print library that is capable of creating files and send them to the printer. And two design-time editors to make it easier to customize the TTMSFNCGraphicsFill and TTMSFNCGraphicsStroke in your FNC products.

TMS FNC Printing

The print library supports creating documents, adding pages and page content such as HTML formatted text, plain text, drawing primitives and images, with practically the same code on all different frameworks.

This has been implemented on three different levels.

The lowest level of implementation for the print library is the use of TMSFNCPrinter, this is done in a similar way as TPrinter is used on VCL, Lazarus, FMX Windows and MacOS. With TMSFNCPrinter there is now support for FMX Android and iOS and for TMS WEB Core.

The difference with TPrinter is that the drawing should be defined in the OnDrawContent procedure. 

uses
  …, FMX.TMSFNCPrinters, FMX.TMSFNCGraphicsTypes;

procedure Click(Sender:TObject);
begin

  TMSFNCPrinter.OnDrawContent :=

  procedure
  begin
    TMSFNCPrinter.Graphics.Font.Color := gcBlue;
    TMSFNCPrinter.Graphics.Font.Size := 40;
    TMSFNCPrinter.Graphics.DrawText(0, 20, TMSFNCPrinter.PageWidth, 100, 'Hello', False, gtaCenter, gtaCenter);

    TMSFNCPrinter.Graphics.Fill.Color := gcRed;
    TMSFNCPrinter.Graphics.DrawEllipse(100,200, TMSFNCPrinter.PageWidth - 100, 300);

    TMSFNCPrinter.Graphics.DrawBitmap(50,400,TMSFNCPrinter.PageWidth - 50, TMSFNCPrinter.PageHeight - 50, Image1.Bitmap, True, True);

    TMSFNCPrinter.EndDoc;
  end;

  TMSFNCPrinter.BeginDoc;
end; 

TMS Software Delphi  Components

On top of the TMSFNCPrinter, there is the TMSFNCGraphicsPrintIO component, which gives the ability to further define the layout of the document with a header, footer and page number and to add certain FNC components.

TMS Software Delphi  Components

The TTMSFNCRichEditorPrintIO and TTMSFNCGridPrintIO are added In the TMS FNC UI PackThese components have some additional properties to make the export of the TTMSFNCRichEditor or TTMSFNCGrid even more customizable.



Design-time Editors

Working with FNC controls should be fast and simple. And for that reason we're adding two new design-time editors in TMS FNC Core.

These help with setting the properties for the TTMSFNCGraphicsFill and TTMSFNCGraphicsStroke.

TMS Software Delphi  Components



Gjalt Vanhouwaert


Bookmarks: 

This blog post has not received any comments yet.



Add a new comment:
Author:
Email:
  You will receive a confirmation mail with a link to validate your comment, so please use a valid email address.
 
Comment:
 
 

All fields are required.
 



All Blog Posts  |  Next Post  |  Previous Post