#1 2012-05-09 14:11:15

renato
Member
Registered: 2010-06-21
Posts: 5

[Question]worth a cheese - How to rotate page?or paragraph rotated?

Arnald,

i need to print a text rotated or paragraph on X,Y of a page.

Example:
-> Need to print a paragraph on X = 105mm, Y = 148,5mm of a page. But i need to print rotated on 180 degrees.

I try to rotate canvas:

        mode := GetGraphicsMode(PDFDocumentGdi.VCLCanvas.Handle);
        GetWorldTransform(PDFDocumentGdi.VCLCanvas.Handle, XformOLD);
        SetGraphicsMode(PDFDocumentGdi.VCLCanvas.Handle, GM_ADVANCED);

        XForm.eM11 := Cos(DegToRad(angle));
        XForm.eM12 := Sin(DegToRad(angle));
        XForm.eM21 := -Sin(DegToRad(angle));
        XForm.eM22 := Cos(DegToRad(angle));
        XForm.eDx  := PDFPage.PageWidth;
        XForm.eDy  := PDFPage.PageHeight;

        SetWorldTransform(PDFDocumentGdi.VCLCanvas.Handle, Xform);
        SetGraphicsMode(PDFDocumentGdi.VCLCanvas.Handle, mode);

The page rotation occurs normally, but the position of the text is not printed on 105 and 148.5.

Can you help me?

tnks

Offline

#2 2012-05-09 14:18:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: [Question]worth a cheese - How to rotate page?or paragraph rotated?

Take a look at how rotation is handled within EMF enumeration and PDF generation.

This is the same technique you have to use here.

Offline

Board footer

Powered by FluxBB