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.

 

November 20, 2024

Localization and Language Switching in FastReport VCL

FastReport VCL supports 40 languages for interface localization and allows you to change the language on the fly through menus or code, without recompilation.
November 01, 2024

New Features of the FastReport VCL Editor

We are considering new features of the report editor: extension lines, highlighting of intersecting objects, updated report and data trees.
October 30, 2024

Using Styles When Creating Reports in FastReport VCL

The article discusses one of the new features of FastReport VCL — the use of styles and style sheets.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2024 Fast Reports Inc.