Print Page | Close Window

Example - AutoIt - Debenu PDF Viewer SDK

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: Sample Code
Forum Description: Share Debenu Quick PDF Library sample code with other forum members
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2913
Printed Date: 23 Apr 24 at 2:31PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Example - AutoIt - Debenu PDF Viewer SDK
Posted By: mLipok
Subject: Example - AutoIt - Debenu PDF Viewer SDK
Date Posted: 05 Jun 14 at 12:38PM
AutoIt Example for Debenu PDF Viewer SDK:
{this is very similar to VisualBasic so I think it is useful}

#Region QuickPDF Include
#include <MsgBoxConstants.au3>
#include <FileConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <File.au3>
#include <WinAPIFiles.au3>
#EndRegion QuickPDF Include

Example(FileOpenDialog('Select PDF File','c:\','PDF File (*.pdf)'))

Func Example($sPDF_FileFullPath)

; Create ActivX object
Local $oQPV = ObjCreate('DPVACTIVEX.Viewer')
$oQPV.LibraryPath = @ScriptDir & '\DebenuPDFLibraryDLL1014.dll'
$oQPV.RendererPath = @ScriptDir & '\DebenuPDFRendererDLL1014.dll'
$oQPV.LicenseKey = 'ENTER YOUR KEY HERE'
$oQPV.ScrollbarsEnabled = True
$oQPV.ToolbarEnabled = True
$oQPV.OpenFile($sPDF_FileFullPath)
$oQPV.SetZoom(1)
$oQPV.GotoPage(1)

; Create a simple GUI for our output
GUICreate("Embedded Web control Test", 800, 600, (@DesktopWidth - 800) / 2, (@DesktopHeight - 600) / 2, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
GUICtrlCreateObj($oQPV, 10, 10, 780, 500)
$oQPV.ZoomFitPage()
Local $idButton_Back = GUICtrlCreateButton("Back", 10, 520, 100, 30)
Local $idButton_Forward = GUICtrlCreateButton("Forward", 120, 520, 100, 30)
Local $idButton_Home = GUICtrlCreateButton("Home", 230, 520, 100, 30)

GUISetState(@SW_SHOW) ;Show GUI

; Loop until the user exits.
Local $iMsg
While 1
$iMsg = GUIGetMsg()

Select
Case $iMsg = $GUI_EVENT_CLOSE
ExitLoop
Case $iMsg = $idButton_Back
$oQPV.PrevPage()
Case $iMsg = $idButton_Forward
$oQPV.NextPage()
Case $iMsg = $idButton_Home
$oQPV.GotoPage(1)

EndSelect

WEnd
$oQPV = '' ; CleanUp

GUIDelete()
EndFunc   ;==>Example

Cheers
mLipok




-------------
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600



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