Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Can I use Quick PDF as a viewer in my Delphi Application?

Question

Can I use Quick PDF as a viewer in my Delphi application and be able to render PDF content to a Device Context?

Answer

Yes, Quick PDF Library can be used to add PDF viewing capabilities to Delphi applications. I have included some sample code below which demonstrates how to do this using the DARenderPageToDC function. If you haven't written in application using Quick PDF Library and Delphi yet, this getting started guide should help.

var
  fh, ph, SelectedPage, DPI: Integer;
begin
  with PDFLibrary do
  begin
    fh := DAOpenFileReadOnly(OpenDialogPDF.FileName, '');
    ph := DAFindPage(fh, SelectedPage);
    DAViewImage.Picture.Bitmap.Width := Round(DAGetPageWidth(fh, ph));
    DAViewImage.Picture.Bitmap.Height := Round(DAGetPageHeight(fh, ph));
    DARenderPageToDC(fh, ph, DPI, DAViewImage.Canvas.Handle);
    DACloseFile(fh);
  end;
end.

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum