B4J Question How Add Rotate on Java-fPDF library

pcicom

Member
Licensed User
Longtime User
How add rotate function to java-fpdf library

LINK --> https://www.b4x.com/android/forum/threads/java-fpdf-library-create-pdf-files-in-b4a.75113/#content

rotate funcion code in JAVA is

java:
import java.lang.Math;

public void rotate(double angle, double x = -1, double y = -1) {
    if (x == -1) {
        x = this.x;
    }
    if (y == -1) {
        y = this.y;
    }
    if (this.angle != 0) {
        this._out("Q");
    }
    this.angle = angle;
    if (angle != 0) {
        angle *= Math.PI / 180;
        double c = Math.cos(angle);
        double s = Math.sin(angle);
        double cx = x * this.k;
        double cy = (this.h - y) * this.k;
        this._out(String.format("q %.5f %.5f %.5f %.5f %.2f %.2f cm 1 0 0 1 %.2f %.2f cm", c, s, -s, c, cx, cy, -cx, -cy));
    }
}
 
Top