Print Page | Close Window

Firemonkey: RenderPageToDC

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2988
Printed Date: 01 Mar 26 at 6:50AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Firemonkey: RenderPageToDC
Posted By: alexdmatveev
Subject: Firemonkey: RenderPageToDC
Date Posted: 09 Oct 14 at 1:50PM
Hello,

does anybody know a way to render a PDF page to Firemonkey TImage?

in Delphi DCL I go this way:
   FDebenu.RenderPageToDC(72, 1, imCanvas.Canvas.Handle);

but in FMX I have no direct access to Image's Device Context... 

pls show me the way.

Thanks a lot.



Replies:
Posted By: alexdmatveev
Date Posted: 09 Oct 14 at 1:56PM
Possible solution:

procedure TfrmPdfFormEditor.RenderDocument(page: Integer);
var
  ms: TMemoryStream;
begin
  ms := TMemoryStream.Create;
  FDebenu.RenderPageToStream(72, page, 0, ms);
  ms.Position := 0;
  imCanvas.Bitmap.LoadFromStream(ms);
  ms.Free;
end;

Works for me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk