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 > Sample Code
  New Posts New Posts RSS Feed - How to set the pdf-viewer-preferences
  FAQ FAQ  Forum Search   Register Register  Login Login

How to set the pdf-viewer-preferences

 Post Reply Post Reply
Author
Message
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3103
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Topic: How to set the pdf-viewer-preferences
    Posted: 16 Apr 10 at 9:16PM
Hi!

The following code is out of a complete app.
There is a window where you can make all settings...
So in the code checkbox-values are used.
But this doesn't matter to you - you shall see how to call
the functions ;-)

The code is in Delphi but this should be no prob
for a developer ;-)

Cheers, Ingo


   QP  := TQuickPDF718.Create;
   try
      Save_Cursor   := Screen.Cursor;
      Screen.Cursor := crHourglass;    // Show hourglass cursor
      QP.UnlockKey('...');
      QP.LoadFromFile(Edit1.text);
      
      If QP.EncryptionStatus > 0 Then
         QP.Decrypt;

//-------------------------------------------
      if cbhtb.Checked = True Then
         QP.SetViewerPreferences(1,1)  // Hide toolbar
        Else
         QP.SetViewerPreferences(1,0);
      if cbhmb.Checked = True Then
         QP.SetViewerPreferences(2,1)  // Hide menubar
        Else
         QP.SetViewerPreferences(2,0);
      if cbhwui.Checked = True Then
         QP.SetViewerPreferences(3,1)  // Hide windows user interface
        Else
         QP.SetViewerPreferences(3,0);
      if cbrwfps.Checked = True Then
         QP.SetViewerPreferences(4,1)  // Resize window to first page size
        Else
         QP.SetViewerPreferences(4,0);
      if cbcw.Checked = True Then
         QP.SetViewerPreferences(5,1)  // Center window
        Else
         QP.SetViewerPreferences(5,0);
      if cbddt.Checked = True Then
         QP.SetViewerPreferences(6,1)  // Display document title
        Else
         QP.SetViewerPreferences(6,0);

      if cbseite.Checked = False Then
      begin
         if cbfwindow.Checked = True Then
            QP.SetOpenActionDestination(1, -1) // -1 for Fit in window
           Else
            QP.SetOpenActionDestination(1, 100);
         if cbfwidth.Checked = True Then
            QP.SetOpenActionDestination(1, -2) // -2 for Fit in Width
           Else
            QP.SetOpenActionDestination(1, 100);
         if cbzoom.Checked = True Then
            QP.SetOpenActionDestination(1, 100);// Display first page with 100%
      end;
      if cbseite.Checked = True Then
      begin
         if cbfwindow.Checked = True Then
            QP.SetOpenActionDestination(SpinEdit1.Value, -1) // -1 for Fit in window
           Else
            QP.SetOpenActionDestination(SpinEdit1.Value, 100);
         if cbfwidth.Checked = True Then
            QP.SetOpenActionDestination(SpinEdit1.Value, -2) // -2 for Fit in Width
           Else
            QP.SetOpenActionDestination(SpinEdit1.Value, 100);
         if cbzoom.Checked = True Then
            QP.SetOpenActionDestination(SpinEdit1.Value, 100);// Display first page with 100%
      end;
      QP.SaveToFile(Edit1.Text);
//-------------------------------------------
   finally
      QP.Free;
      Screen.Cursor := Save_Cursor;
   end;

   ShowMessage('Complete...');
 

Edited by Ingo - 19 Apr 10 at 6:23AM
Back to Top
Shotgun Tom View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 Aug 09
Location: Phoenix, AZ
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote Shotgun Tom Quote  Post ReplyReply Direct Link To This Post Posted: 17 Apr 10 at 4:45PM
Nice one, Ingo... Thanks!
 
Tom
Back to Top
mortendc View Drop Down
Beginner
Beginner


Joined: 08 Oct 14
Location: Denamrk
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote mortendc Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jun 15 at 3:08PM
Hi Ingo

Great, thanks a lot for helping out!

Kind regards 

Morten
 


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