delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
500 Users Online NOW
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi



Loremo - the 1.5 liter car coming in 2009




Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (0)


RAVE Export Device for EMF, WMF and BitmapsGo to Julian Ziersch's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
Product:
Delphi 6.x (or higher)
Category:
Reporting
Skill Level:
Scoring:
Last Update:
09/02/2003
Search Keys:
delphi delphi3000 article borland vcl code-snippet RAVE EMF WMF BMP JPEG JPG PDF Export Render Device TRvRenderCanvas Printer Save GetCanvas DocBegin DocEnd XI2D YI2D RenderPage
Times Scored:
3
Visits:
4004
Uploader: Julian Ziersch
Company: wpCubed GmbH
Reference: wptools.de
 
Question/Problem/Abstract:
How to implement a generic RAVE render device
Answer:



While developing wPDF V2.10 I came across the problem to
create EMF files from RAVE reporter which ships with Delphi 7 PRO.
The goal was to provide a PDF export filter which renders
embedded metafiles as vectors and also offers a bit more than the
standard PDF export.
Sending a metafile to the wPDF engine would do the task, but how to
get this metafile from RAVE?  My search in the manual and
documentation was not quite successful so I found myself digging
in the classes and properties listed in the object explorer.
This took a while, and the result were only a few lines of code.

To create metafiles from RAVE you need to create a device which
inherits from
  TRvRenderCanvas

You need to override the
function GetCanvas : TCanvas;
to retrieve the canvas to draw to. For example a metafile canvas.

The procedures DocBegin and DocEnd have to be used to initialize the
output of the document, PageBegin and PageEnd should be used to
initialize and finalize (or save) the current page.

Well - that was is already, except for the functions which calculate
the x and y position. They can be implemented like this:

function TRvRenderGraphic.XI2D(Pos: Double): Integer;
begin
  Result := Round(Pos * FResolutionX);
end;

function TRvRenderGraphic.YI2D(Pos: Double): Integer;
begin
  Result := Round(Pos * FResolutionY);
end;

I hope this short overview is helpful.

You can download a free EMF and JPEG export device including
full source-code at www.wptools.de (section "Free Stuff").
You can also check out the demo of the universal PDF printing component
wPDF V2.10 which now supports RAVE, RB, QR, FR,
the word processor WPTools (of course), THTMLView, WPForm
and even the Developer Express Printing Suite.

Julian Ziersch
wpCubed GmbH





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment













 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
D. Souchard
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)