#1 Re: PDF Engine » PDF text clipping not working » 2016-06-30 13:55:14

Thank you for the fast reply. My revision is '1.18.2760'.

#2 PDF Engine » PDF text clipping not working » 2016-06-29 11:42:19

SotircaMihai
Replies: 2

We have a generic library to print (either to printer, pdf, eml...) and use windows api DrawText to write text. If the specified rectangle width is smaller than the needed width the text is not clipped. If we use the DT_WORDBREAK format then the clipping is done.

ex: (font - Arial size 8)

fPDF := TPdfDocumentGDI.Create;
fPDF.EmbeddedTTF := True;
fPDF.DefaultPaperSize := psA4;
fPDF.PDFA1 := True;

vText := 'This is a random text!';
vRect.Left := 50;
vRect.Top := 200;
vRect.Right := 350;
vRect.Bottom := 216;
vFormat := DT_EXTERNALLEADING or DT_NOPREFIX or DT_LEFT;

DrawText(fPDF.VCLCanvas.Handle, pChar(vText), Length(vText), vRect, vFormat )

woks fine, but if i reduce the rectangle width (vRect.Right := 65;) it doesn't!

Board footer

Powered by FluxBB