Print Page | Close Window

own viewer

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=1537
Printed Date: 17 Oct 25 at 6:42AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: own viewer
Posted By: hloch
Subject: own viewer
Date Posted: 11 Aug 10 at 9:10AM
Please help,

I would like to try use QuickPDF ActiveX in my app as PDF viewer.
How to do it? I can not found any example for this situation.
I use Delphi/C++Builder.
I can LoadFIle with
QP->LoadFromFile(WideString(OpenDialog1->FileName));
but what to do next?

Thank you very much




Replies:
Posted By: Ingo
Date Posted: 11 Aug 10 at 9:34AM
Hi hloch!

Why you didn't use the search-function above (with the advanced option)?
Here are two helpful links for you:
http://www.quickpdf.org/forum/a-pdf-viewer-built-using-powerbasic-and-quick-pdf_topic1050.html
http://www.quickpdf.org/forum/pdf-view_topic329.html

Normally it goes this way:
Get each page - convert pagecontent to stream - convert stream to jpeg - load the jpeg into an imagecomponent - ...

Cheers and welcome here,
Ingo



Posted By: hloch
Date Posted: 11 Aug 10 at 1:43PM
O.K. I can render to Image or PaintBox now, but tell me how to use SetViewerPreferences?
I really dont understand how work QuickPDF library. I thought that I can use it as visual component for preview PDF files with Toolbars for zoom, moving, etc. ?

Thank you


Posted By: Ingo
Date Posted: 11 Aug 10 at 2:14PM
Hi!

"SetViewerPreferences" has nothing to do with YOUR pdf-viewer.
SetViewerPreferences on a loaded document before SaveToFile will manipulate a pdf-reader while displaying your document.
With
SetViewerPreferences for example it's possible to determine that your document shall be opened on the third page and that the reader-menu shall be hidden.
If you've done the SaveToFile and opened the document with a pdf-reader the starting page will be the third one and the menu will be hidden.

Cheers, Ingo



Posted By: hloch
Date Posted: 11 Aug 10 at 2:16PM
aha. o.k.



Posted By: hloch
Date Posted: 12 Aug 10 at 2:45PM
And please tell me how to render into stream when I used ActiveX. Is it possible and how?
In manual is information for RenderPageToStream: This function is only available in the Delphi edition.



Posted By: Ingo
Date Posted: 12 Aug 10 at 9:07PM
Hi!

You can try something similar to the following code:

   try
      QP.UnlockKey('...');
      QP.LoadFromFile(ipfliste[di]); //fneu);
      pmax := QP.PageCount;
      Form1.Label1.Caption := title;
      QP.CombineLayers;
      test_stream := TMemoryStream.Create;
      QP.RenderPageToStream(zoom,page,1,test_stream,1,0);
      Form1.Show;
   finally
      QP.Free; 
   end;

   Form1.Repaint;

   try
      test_stream.Seek(0,0);
      jpg := TJPEGImage.Create;
      jpg.LoadFromStream (test_stream);
      Form1.Image1.Picture.Assign(jpg);
      Form1.Caption := title;
      Form1.Label1.Caption := 'Document 1 of ' + IntToStr(rcount);
      Form1.Label3.Caption := 'Page 1 of ' + IntToStr(pmax);

   finally
      Form1.Show;
      test_stream.Free;
      jpg.Free;
      result := 0;
   end;

I don't use ActiveX. If you wanna use it
you should change from RenderPageToStream
to RenderPageToFile.

As file you can choose jpeg or bmp for example
and this image you can display in your image component.

Here is the online reference:
http://www.quickpdflibrary.com/help/quickpdf/FunctionGroups.php

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