Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Display a page from a loaded PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Display a page from a loaded PDF

 Post Reply Post Reply
Author
Message
ZarkoGajic View Drop Down
Beginner
Beginner
Avatar

Joined: 18 Mar 09
Location: Croatia
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote ZarkoGajic Quote  Post ReplyReply Direct Link To This Post Topic: Display a page from a loaded PDF
    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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ZarkoGajic View Drop Down
Beginner
Beginner
Avatar

Joined: 18 Mar 09
Location: Croatia
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote ZarkoGajic Quote  Post ReplyReply Direct Link To This Post Posted: 25 Mar 09 at 3:30PM
Ingo,
 
This looks fantastic!!
 
Thanks much!
 
 
-zarko gajic
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store