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!
How to set the pdf-viewer-preferences |
Post Reply |
Author | |
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
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 |
|
Shotgun Tom
Senior Member Joined: 14 Aug 09 Location: Phoenix, AZ Status: Offline Points: 53 |
Post Options
Thanks(0)
|
Nice one, Ingo... Thanks!
Tom
|
|
mortendc
Beginner Joined: 08 Oct 14 Location: Denamrk Status: Offline Points: 9 |
Post Options
Thanks(0)
|
Hi Ingo
Great, thanks a lot for helping out! Kind regards Morten |
|
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