How to draw text in PDF by curves

2017-02-27

Nowadays, copying of a text from documents is spread and it is being developed. PDF document uses embedded fonts in documents and serves to protect them from copying. However, not all fonts can be embedded in a document as some of them have a copyright. If you are developing a document for printing and cutting plotter, fonts of the curves is the best solution.

FastReport.Net provides an opportunity to convert a text into vector objects when exporting to PDF, i.e. the fonts of the curves are formed by means of the report generator.

Let us review what the TrueType fonts (TTF) are. These fonts store appearance of symbols in a vector form, which allows scaling without loss of quality or distortion. A symbol is constructed from segments of curves, while the curves are created with the help of required points. To construct a segment only two points are needed, whereas for the construction of the curve there should be more than two points - the beginning - point and the end - point, and points to form an arc, which lies beyond the curve. It should be mentioned, that curves are constructed according to mathematical method for drawing curves created by Bézier. Therefore, two types of points are stored: the ones, that lie on curves (interval) and the auxiliary ones, which lie outside the curves. The points are connected in series to form a contour symbol. Certain characters consist of several contours. For instance, letter C consists of three contours. The first one is the outer loop and the rest ones are internal. By default, the external contour is always painted over, and the inside one depends on the order of the circumvention of the external contour points.

FastReport.Net uses the same principles to build characters. It guarantees full compliance with the text of the report and the converted text while exporting to PDF.

How to use the function of converting texts into vector objects?

When exporting to PDF, choose “Settings tab”, turn off “PDF/A compliance” option and enable the option "Text in curves":

Now, when exporting to PDF, you will get non-copied text, which does not differ from the original one.

Let me illustrate two pieces of PDF: the first with TTF fonts, the second – with a text, drawn with the help of FastReport curves.

 1.

2.

This study reveals no significant difference between these two examples.

In conclusion, it should be mentioned, that the size of a PDF file with fonts of the curves is much bigger than the size of a file for export without this option. For example, without a text consisted of curves the size of a file is 3,391,275 bytes, whereas the size of the same file with the text of the curves is 55,153,426 bytes. So, one needs to choose between new features and possibilities offered by the new option and substantially larger file size.

 

August 12, 2024

How to build and install the Postgres plugin in FastReport .NET

This article describes how to connect to the database using the FastReport .NET plugin for the report designer from Visual Studio via the NuGet server.
August 08, 2024

How to install FastReport .NET and its components on Windows

Step-by-step instructions for online and manual installation via the FastReport registration code.NET and its components in Windows.
July 26, 2024

Updating HTMLObject as a plugin for FastReport .NET

Detailed instructions for using the new HTMLObject plugin, which uses splitting DOM HTML into FastReport report objects.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314

© 1998-2024 Fast Reports Inc.