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!
PDF view |
Post Reply |
Author | |
cpri
Team Player Joined: 17 Feb 06 Location: Netherlands Status: Offline Points: 28 |
Post Options
Thanks(0)
Posted: 23 Feb 06 at 2:15AM |
I want to use quickpdf as a viewer. So I started with a very simple viewer. The idea is to build a VCL component that can do all the viewing things I want. So first here's is my very basic code for viewing pdf's In the future I will post my extentions to this code. procedure TForm1.Button1Click(Sender: TObject); begin end; end;
|
|
cpri
Team Player Joined: 17 Feb 06 Location: Netherlands Status: Offline Points: 28 |
Post Options
Thanks(0)
|
I updated the code. I also made the image look more like a page. For me it works fine. If you have any suggestions, commands or additions please let me know
unit pdfview; interface type Tpage =record TQuickPDFViewer = class(Tscrollbox) procedure set_LoadFile(const FileName: string); end; { TQuickPDFViewer } constructor TQuickPDFViewer.create(Aowner: Tcomponent); destructor TQuickPDFViewer.destroy; //I need this because I have some trouble with scrolling procedure TQuickPDFViewer.HandleMessage(var Msg: TMsg; end; procedure TQuickPDFViewer.makePages; image.Top :=0; for i:=0 to page.Number do image.Canvas.Brush.Color :=clgray; for i:=0 to page.Number-1 do end; procedure TQuickPDFViewer.Print; QP.PrintDocument(defaultprinter,firstpage,lastpage,0); procedure TQuickPDFViewer.setFirstPage(const Value: integer); procedure TQuickPDFViewer.setLastPage(const Value: integer); end; procedure TQuickPDFViewer.set_LoadFile(const FileName: string); procedure TQuickPDFViewer.show; end; end. |
|
ECPVFR
Beginner Joined: 17 May 06 Location: Germany Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Hello Christian,
today I tested Your "TQuickPDFViewer" component and it works well. The only problem is: if I'm loading PDF docs with two or more pages, it is VERY SLOW (30 - 60 seconds for FOUR pages...). Do You have an idea why it takes so much time?? |
|
Best Regards,
Volker |
|
cpri
Team Player Joined: 17 Feb 06 Location: Netherlands Status: Offline Points: 28 |
Post Options
Thanks(0)
|
Sorry I can't help you I tested it with documents with a lot of pages and I found no problem what so ever
|
|
cpri
Team Player Joined: 17 Feb 06 Location: Netherlands Status: Offline Points: 28 |
Post Options
Thanks(0)
|
Hello I took a look at your problem, and I think it's due to the memory. In the code a image is created with the size of the complete pdf. So if you have a lot of pages you need a lot of memory. My viewer isn't optimized for that. If you need to view a lot of pages thge best thing you can do is make sections. Something like the prev_Section main_Section and next_Section. The main_section contains an image (only one page) with the page you are looking at the prev_section contains the previous page and the next_section conatins the next page. Every time you scroll up or down the sections are updated with the right pages. By using more secrions you can do the rendering to image in the background. Because the programs I made doesn't have to deal with a lot of pages I didn't optimize the viewer for that. But every one who has ideas to make this viewer better please be my guest and update the viewer to your own needs. |
|
ECPVFR
Beginner Joined: 17 May 06 Location: Germany Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Hi cpri,
thanks, I realized the 'problem' when testing with large PDF files (2-15 pages) containing images. At the project I need the viewer for: Every PDF has only one page and contains NO images. For this use Your viewer is excellent! |
|
Best Regards,
Volker |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store