Print Page | Close Window

I want to make Zoom in my 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=1673
Printed Date: 04 Apr 26 at 8:04PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: I want to make Zoom in my viewer
Posted By: Giuseppe
Subject: I want to make Zoom in my viewer
Date Posted: 13 Dec 10 at 10:04AM
I make a PdfViewer.
I want make a zoom, with quickpdf method : "DARenderPageToDC" and i've to create two sidebar, (right and bottom) for sliding zoom windows on the work page. 
This is a code....but howto i release qp handler for new visualization? I use a workaround: i copy file. 

int Handle = qp.DAOpenFileReadOnly(nameapp, null);
int PageCount = qp.DAGetPageCount(Handle);
int PageRefNo = qp.DAFindPage(Handle, PageNo);
 int Zoom = zoom;
 double widhtDoc = qp.DAGetPageWidth(Handle, PageRefNo);
 double heightDoc = qp.DAGetPageHeight(Handle, PageRefNo);
 double pageWidth = widhtDoc / Zoom;
 double pageHeight = heightDoc / Zoom;
  int dpi = 100;
 Bitmap b = new Bitmap(Convert.ToInt32(pageWidth * dpi), Convert.ToInt32(pageHeight * dpi));
   using (Graphics g = Graphics.FromImage(b)) {
      IntPtr dc = g.GetHdc();
       qp.DARenderPageToDC(Handle, PageRefNo, dpi, (int)dc);
       g.ReleaseHdc(dc);
       GraphicsUnit gUnit = GraphicsUnit.Point;
        g.PageUnit = gUnit;
    }
 pcbx.Image = b;
 pcbx.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
  //I can't release handling image and i make a copy file
 if (File.Exists(appfile)) File.Delete(appfile);
   File.Copy(appfile2, appfile);
 pcbx.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

Another question: 

SetTextExtractionWordGap not work!!!

infact i try more times for test this functionality but "ExtractFilePageText" return partial words, however i found another workaround....



Replies:
Posted By: AndrewC
Date Posted: 21 Jan 11 at 1:54PM
You need to call the    QP.DACloseFile(Handle); function to release the qp file.

Put this just after you have called DARenderPageToDC() somewhere.


Also SetTextExtractionWordGap ?  What is the problem with the ExtractFilePageText function.  Do you have an example that you can upload.  I have personally found that Option 3 works better than Option 4.






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