Print Page | Close Window

Display a page from a loaded PDF

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=1043
Printed Date: 22 Nov 24 at 7:18PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Display a page from a loaded PDF
Posted By: ZarkoGajic
Subject: Display a page from a loaded PDF
Date Posted: 25 Mar 09 at 11:41AM

Hi,

What would be the easiest way (using Delphi) to display (on some canvas/component) a single page from a loaded document.

Basically I'm looking for some kind of "preview" functionality / per document page.

-zarko



-------------
-zarko gajic



Replies:
Posted By: Ingo
Date Posted: 25 Mar 09 at 3:15PM
Hi Zarko!

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, ExtCtrls, jpeg, QuickPDF0712;

// . . .

var
  Form1: TForm1;
  fstring, s      : String;
  page, pagecount : Integer;
  QP              : TQuickPDF0712;
  Test_Stream     : Tmemorystream;
  jpg             : TJpegImage;

implementation

{$R *.DFM}

// . . .

procedure Pages(fap: String);
begin

   jpg         := TJpegImage.create;
   Test_Stream := Tmemorystream.Create;

   QP  := TQuickPDF0712.Create;  
   try
      QP.UnlockKey('YourKeyShouldBeHere');
      QP.LoadFromFile(fstring);
      If ( QP.Encrypted > 0 ) Then
         QP.Unencrypt;
      QP.RenderPageToStream(72,1,1,test_stream);
   finally
      QP.Free;
   end;
   test_stream.Seek(0,0);
   jpg.LoadFromStream (test_stream);
   Form1.image1.Picture.Assign(jpg);
   test_stream.Clear;
end;

Cheers, Ingo


Posted By: ZarkoGajic
Date Posted: 25 Mar 09 at 3:30PM
Ingo,
 
This looks fantastic!!
 
Thanks much!
 
 


-------------
-zarko gajic


Posted By: Ingo
Date Posted: 26 Mar 09 at 2:31AM
Hi!

I've posted my sample with few more
explaining words here:
http://www.quickpdf.org/forum/forum_posts.asp?TID=1044
I hope it's understandable for all.

Cheers, Ingo




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