The reason is as follows: AlivePdf is written with curved hands. In general, do not use the lineTo function. Instead, there is a drawLine function in the latest version. It is not buggy. Drawing with the moveTo-lineTo buggy constantly (for example, when you try to draw a dashed line, it will be displayed with different line widths, different long lines, different widths of gaps). And also keep in mind: for some reason, a strange library is posted on the AlivePdf website - that is, the functions they write that they are implemented are not implemented in the downloadable library. I found a library with implemented functions on a github by one craftsman. In general, google and do not build until you find a library with all the documented functions implemented.