Rotating Text

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Rotating Text

Postby IDEAL Software Support » Tue Nov 23, 2004 5:25 pm

Hello!

Is it possible to rotate text at a non-rectangular angle ( i.e not
90, 180 or 270 degrees).

I would like to put something like a watermark underneath my reports
that says "Evaluation only" in light gray and 45° angle.

Any Idea (vpe Enhanced)?

Thanks in Advance

Regards from Berlin
Frank Dietrich
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Watermarks

Postby IDEAL Software Support » Tue Nov 23, 2004 5:26 pm

VPE only supports rotation of images and text in 0, 90, 180 and 270 degrees.

However, for a watermark of a different angle, we recommend to use a
bitmap or metafile (WMF or EMF) as a background on each page. Since VPE
has a very intelligent image cache, this will neither stress memory
consumption nor performance.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Postby IDEAL Software Support » Tue Nov 23, 2004 5:26 pm

Thanks! Yes an image would have been the next approach. It just
would have been much more easy with plain text.
Also a Bitmap does not look too good when it comes to finer
resolutions. So I'll see if I can produce a WMF or EMF for that.

Then, later, when printing the image I'll use the KEEP_IMAGE-flag as
I want to "chessboard" the image many times over the page.

Regards
Frank Dietrich
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Postby IDEAL Software Support » Tue Nov 23, 2004 5:28 pm

> So I'll see if I can produce a WMF or EMF for that.

You can achieve that with numerous tools, for example Corel Draw.

>
Then, later, when printing the image I'll use the KEEP_IMAGE-flag as
I want to "chessboard" the image many times over the page.
<

Use the KeepImage flag *always*, the implementation of VPE's cache is
very smart. :-) There is absolutely no reason nor a scenario where we would NOT recommend to use it.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Postby IDEAL Software Support » Tue Nov 23, 2004 5:29 pm

>
> Use the KeepImage flag *always*, the implementation of VPE's cache
> is very smart. :-) There is absolutely no reason nor a scenario
> where we would NOT recommend to use it.
>

Thanks for the tips. Worked very well with the WMF. It's only a few
bytes small and prints very well as it is vector graphics.

It now looks like diagonal "lines" of "For Evaluation only".

This is what we have done in order someone else wants an effect like
that.

1. create an image with some simple text; probably light gray and
save to WMF.

2. call code upon page-Setup, before actually populating the page.
Something like this:

*--------------------------------------*
this.oVPE.RenderPicture(VFREE, VFREE, lcImgFile, PIC_KEEPIMAGE)
lnPictureWidth = this.oVPE.nRenderWidth
lnPictureHeight= this.oVPE.nRenderHeight

*-- now, we do not want to print over the borders of the page
*-- so check how many of the Images we can pack on the page
*-- and center them.
lnRows = int( this.oVPE.PageWidth / lnPictureWidth)
lnColumns = int( this.oVPE.PageHeight / lnPictureHeight)
lnLeft = (this.oVPE.PageWidth - lnPictureWidth*lnColumns) / 2
lnTop = (this.oVPE.PageHeight - lnPictureHeight * lnRows) / 2

this.oVPE.nRight = lnLeft
this.oVPE.nTop = lnTop

for lnRow = 1 to lnRows
this.oVPE.nRight = lnLeft

if lnRow > 1
this.oVPE.nTop = this.oVPE.nBottom
endif

for lnCol = 1 to lnColumns
this.oVPE.Picture(;
VRIGHT, VTOP, -lnPictureWidth, -lnPictureRight,;
lcImgFile, PIC_KEEPIMAGE)

endfor && lnCol...

endfor && lnRow = 1 ...

*------------------------------------*

This is VFP, but should easily translate into other languages (it's
not rocket science anyway ;-) )
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 18 guests