Jump to content

Recommended Posts

Posted (edited)

I would like to present, the UDF for Debenu PDF Viewer SDK

 

You can also find more info here:

Debenu Quick PDF UDF

In order to download the current version of the UDF, vist download section.

 

  Reveal hidden contents

In order to download the current version of the UDF, download the attached file:

 Previously downloaded 113 times

actualy look here:

 

Edited by mLipok
new version, link to download section

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Sorry for the residual information in the opening post.

Download Links:

http://www.debenu.com/products/development/debenu-pdf-viewer-sdk/trial/

http://www.debenu.com/products/development/debenu-pdf-viewer-sdk/updates/

Licence key you can find for example:

  Quote

"c:\Program Files (x86)\Debenu\PDF Viewer SDK\TRIAL_LICENSE_KEY.TXT"

 

How to use my UDF:

my script: DPViewer_Example.au3   shows How To use it.

#Tidy_Parameters=/sort_funcs /reel
#include "DPViewer.au3"
#include "Color.au3"

Global Enum _
        $g__eQPDF_MUNITS_Default = 0, _
        $g__eQPDF_MUNITS_Milimeters, _
        $g__eQPDF_MUNITS_Inches

; Parameters for SetOrigin
Global Enum _
        $g__eQPDF_SORIGIN_BottomLeft = 0, _
        $g__eQPDF_SORIGIN_TopLeft, _
        $g__eQPDF_SORIGIN_TopRight, _
        $g__eQPDF_SORIGIN_BottomRight

;~ _DPVS_StartUp()
_Example_MakeFullGui()

; #FUNCTION# ====================================================================================================================
; Name ..........: _DPVS_ButtonStamp
; Description ...: Additional Button to Add some stamp to the PDF
; Syntax ........: _DPVS_ButtonStamp([$sText = Default[, $iLeft = Default[, $iTop = Default[, $iWidth = Default[, $iHeight = Default]]]]])
; Parameters ....: $sText               - [optional] a string value. Default is Default.
;                  $iLeft               - [optional] an integer value. Default is Default.
;                  $iTop                - [optional] an integer value. Default is Default.
;                  $iWidth              - [optional] an integer value. Default is Default.
;                  $iHeight             - [optional] an integer value. Default is Default.
; Return values .: None
; Author ........: mLipok
; Modified ......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func _DPVS_ButtonStamp($sText = Default, $iLeft = Default, $iTop = Default, $iWidth = Default, $iHeight = Default)
    If $iTop = Default Then $iTop = WinGetPos(_DPVS__GUI())[3] - $iHeight - 30
    Local Static $idButton_Make_a_STAMP = Default
    If $idButton_Make_a_STAMP = Default Then
        GUISwitch(_DPVS__GUI())
        $idButton_Make_a_STAMP = GUICtrlCreateButton($sText, $iLeft, $iTop, $iWidth, $iHeight)
    EndIf
    Return $idButton_Make_a_STAMP
EndFunc   ;==>_DPVS_ButtonStamp

Func _Example_MakeFullGui()
    Local $hWnd = _DPVS__GUI('PDF', 100, 10, 800, 700)
    WinSetOnTop(_DPVS__GUI(), '', 1)
    GUISetState(@SW_SHOW)

    _DPVS_ButtonBack("Back", 10, Default, 100, 30)
    _DPVS_ButtonForward("Forward", 120, Default, 100, 30)
    _DPVS_ButtonHome("Home", 230, Default, 100, 30)
    _DPVS_ButtonOpen("Open", 340, Default, 100, 30)
    _DPVS_ButtonSave("Save", 450, Default, 100, 30)
    _DPVS_ButtonClose("Close", 560, Default, 100, 30)
    _DPVS_ButtonStamp("Stamp", 670, Default, 100, 30)

    ; Show GUI
    GUISetState(@SW_SHOW)

    ; create Debenu Viewer Object
;~  Local $oDPVS = ObjCreate('DPVACTIVEX.Viewer')
    Local $oDPVS = _DPVS_ObjCreate()

    ; ENTER YOUR LICENCE KEY HERE
    Local $sLicenceKey = ''
    ; I (mLipok) use MyLicenceKey.txt file to prevent accidentally placed my license key in a public forum.
    If FileExists(@ScriptDir & '\MyLicenceKey.txt') Then $sLicenceKey = FileRead(@ScriptDir & '\MyLicenceKey.txt')

    _DPVS_LicenceKey($oDPVS, $sLicenceKey)
    Local $aColor[3] = [0x80, 0x90, 0xff]
    $oDPVS.BackgroundColor = _ColorSetCOLORREF($aColor)
;~  $oDPVS.Refresh()

;~  $oDPVS.DQPLSetGDIPlusOptions(3, 1)
;~  $oDPVS.DQPLSetGDIPlusOptions(3, 1)
;~  $oDPVS.DQPLSetGDIPlusOptions(10, 1)

    ; some set up
    $oDPVS.ScrollbarsEnabled = True
;~  $oDPVS.ZoomFitWidth()
;~  $oDPVS.ToolbarEnabled = True

    _DPVS_CtrlObjCreate($oDPVS)

;~  ObjEvent($oDPVS, '_DPVS_EVENT_', 'DPVACTIVEX.Viewer')
;~  ObjEvent($oDPVS, '_DPVS_EVENT_', 'DPVACTIVEX.Viewer Control')
;~  ObjEvent($oDPVS, '_DPVS_EVENT_', 'DPVACTIVEX.Viewer Control')
    ObjEvent($oDPVS, '_DPVS_EVENT_')

    ; Loop until the user exits.
    Local $iMsg
    AdlibRegister(_DPVS_Viewer_Adlib())
    _DPVS_OnExit()
    $g__bEventConsoleNotification = True

    Local $sPDF_FileFullPath = '', $aFileList
    While 1
        $iMsg = GUIGetMsg()

        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $iMsg = _DPVS_ButtonBack()
                $oDPVS.PrevPage()
            Case $iMsg = _DPVS_ButtonForward()
                $oDPVS.NextPage()
            Case $iMsg = _DPVS_ButtonHome()
                $oDPVS.GotoPage(1)
            Case $iMsg = _DPVS_ButtonOpen()
                $sPDF_FileFullPath = FileOpenDialog('Select PDF File', @ScriptDir, 'PDF File (*.pdf)')
                If @error Then

                Else
                    _DPVS_OpenFile($oDPVS, $sPDF_FileFullPath)
                    _DPVS__GUI_ChangeTitle(StringRegExp($sPDF_FileFullPath, '(?i).+\\(.*\.pdf)', 3)[0])
;~                  MsgBox(0, "$oDPVS.SearchPDFText('e')", $oDPVS.SearchPDFText('e'))
;~                  MsgBox(0, "$oDPVS.NextSearchResult()", $oDPVS.NextSearchResult())
;~                  MsgBox(0, "$oDPVS.NextSearchResult()", $oDPVS.NextSearchResult())
;~                  MsgBox(0, "$oDPVS.PrevSearchResult()", $oDPVS.PrevSearchResult())
                EndIf

            Case $iMsg = _DPVS_ButtonSave()
                $oDPVS.CompressContent()
                $sPDF_FileFullPath = _DPVS_SaveToFile($oDPVS)

                If Not @error Then
                    _DPVS__GUI_ChangeTitle(StringRegExp($sPDF_FileFullPath, '(?i).+\\(.*\.pdf)', 3)[0])
                EndIf
            Case $iMsg = _DPVS_ButtonClose()
                $oDPVS.CloseFile()
                $oDPVS.RefreshDocument()

            Case $iMsg = _DPVS_ButtonStamp()
;~              _Make_a_STAMP($oDPVS, 20, 45, 'MY OFFICE' & @CRLF & 'My Name', '20-09-2014', '12:07', 1, 'my ID #')
                $oDPVS.DQPLSetOrigin($g__eQPDF_SORIGIN_TopLeft);
                $oDPVS.DQPLSetMeasurementUnits($g__eQPDF_MUNITS_Milimeters)
                $oDPVS.DQPLNormalizePage(0)
                _Make_a_STAMP($oDPVS, 20, 10, 'My Organization Name ' & @CRLF & 'My Name', '20-09-2014', '12:07', 1, 'my ID #')
                $oDPVS.ZoomOut()
                $oDPVS.ZoomIn()
        EndSelect

    WEnd
    $oDPVS = '' ; CleanUp

    GUIDelete()
EndFunc   ;==>_Example_MakeFullGui

; #FUNCTION# ====================================================================================================================
; Name ..........: _Make_a_STAMP
; Description ...: make a stamp in an opened document
; Syntax ........: _Make_a_STAMP(Byref $oDPVS, $iLeft, $iTop, $sOrganizationName, $sDate, $sTime, $iNoOfAttachments, $sSignID)
; Parameters ....: $oDPVS               - [in/out] reference to the ActiveX object
;                  $iLeft               - An integer value.
;                  $iTop                - An integer value.
;                  $sOrganizationName   - A string value.
;                  $sDate               - A string value.
;                  $sTime               - A string value.
;                  $iNoOfAttachments    - An integer value.
;                  $sSignID             - A string value.
; Return values .: None
; Author ........: mLipok
; Modified ......:
; Remarks .......: You should open document before you use this function
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func _Make_a_STAMP(ByRef $oDPVS, $iLeft, $iTop, $sOrganizationName, $sDate, $sTime, $iNoOfAttachments, $sSignID)
    Local $iStampWidth = 75, $iStampHeight = 35
    $iLeft = Number($iLeft)
    $iTop = Number($iTop)
    $oDPVS.DQPLSetOrigin($g__eQPDF_SORIGIN_TopLeft);
    $oDPVS.DQPLSetMeasurementUnits($g__eQPDF_MUNITS_Milimeters)
    $oDPVS.DQPLSetTransparency(20)
    $oDPVS.DQPLSetLineWidth(1)
    $oDPVS.DQPLSetLineColor(1, 0, 0)
    $oDPVS.DQPLDrawBox($iLeft, $iTop, $iStampWidth, $iStampHeight, 0)
    Local $iIDFont = $oDPVS.DQPLAddTrueTypeFont('Arial {1250}', 0)
    $oDPVS.DQPLSelectFont($iIDFont)
    $oDPVS.DQPLSetTextSize(10)
    $oDPVS.DQPLSetTextAlign(1)
    $oDPVS.DQPLDrawWrappedText($iLeft + 2, $iTop + 5, $iStampWidth - 4, $sOrganizationName)
    $oDPVS.DQPLSetTextSize(11)
    $oDPVS.DQPLDrawWrappedText($iLeft + 2, $iTop + 25, $iStampWidth - 4, 'received: ' & $sDate & '  time: ' & $sTime)
    $oDPVS.DQPLDrawWrappedText($iLeft + 2, $iTop + 30, $iStampWidth - 4, '# of Attach.: ' & $iNoOfAttachments & '    Sign #: ' & $sSignID)
EndFunc   ;==>_Make_a_STAMP

Remeber to change this:

Local $sLicenceKey = 'ENTER YOUR LICENCE KEY HERE'

to proper licence key (can be used evalutation)

Edited by mLipok
fixed: "c:Program Files (x86)DebenuPDF Viewer SDKTRIAL_LICENSE_KEY.TXT"

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 7 months later...
Posted (edited)

I publish today a new version v.0.2.

The main change is to add an event handler for followed events:

void zoomChanged( Double zoom);
Fired when current zoom is changed. Zoom value is passed in percent / 100. For example:
0.5 = 50%.

void vScrollbarChanged( Long max, Long value);
Fired when internal Vertical Scrollbar properties change, these values can be used to set external Vertical Scrollbars.

void hScrollbarChanged( Long max, Long value);
Fired when internal Vertical Scrollbar properties change, these values can be used to set external Vertical Scrollbars.

void pageChanged( Long currentPage);
Fired when current page has changed.

void pageCountChanged( Long pageCount);
Fired when current page count has changed. Usually after opening new Document.

void FocusGained( Long pOldWnd)
Fired when DPVS gains input focus and provides handle to focus loosing window.

void FocusLost( Long pNewWnd)
Fired when DPVS looses input focus and provides handle to focus gaining window.

void pageMouseDown( Long pageNum, Double xPos, Double xPos);
Fired when mouse button is pressed while hovering over PDF page. Provides page number and position transformed to PDF coordinates.

void pageMouseUp( Long pageNum, Double xPos, Double xPos);
Fired when mouse button is released while hovering over PDF page. Provides page number and position transformed to PDF coordinates.

void pageMouseMove( Long pageNum, Double xPos, Double xPos);
Fired when mouse pointer is moving over PDF page. Provides page number and position transformed to PDF coordinates.

 

You can find it in download section:

 

Edited by mLipok
change quote to code=text

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

trial key don't work.
I added the key and the key file name as follow:

Local $sLicenceKey = 'j................................y'
If FileExists(@ScriptDir & '\TRIAL_LICENSE_KEY.TXT') Then $sLicenceKey = FileRead(@ScriptDir & '\TRIAL_LICENSE_KEY.TXT')

what I made wrong?
Thanks

Edited by 0ldMan
Posted

First:

little imp

please uncomment  this:

;~ _DPVS_StartUp()
_Example_MakeFullGui()

 

Second:

Totally I forgot to add a description that you have to copy this following files:

DebenuPDFViewerCtrl1114.ocx
DebenuPDFRendererDLL1114.dll
DebenuPDFLibraryDLL1114.dll

to @ScriptDir 

 

Question:

Are these two points above solved the problem?

 

Summary:
I am in the course of preparing the documentation.
Within a few days I release the next version of this UDF.

 

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Thanks for your replay.

TRIAL_LICENSE_KEY.TXT, dlls and ocx was already into the script dir, uncommented the line  "_DPVS_StartUp()".

I got again the message:

"Please ensure that you have provided a valid trial or commercial license key in the library property of this activex control......"

 

Posted (edited)

Please edit this post

  On 5/3/2015 at 12:43 AM, 0ldMan said:

trial key don't work.
I added the key and the key file name as follow:

Local $sLicenceKey = 'j.........y'
If FileExists(@ScriptDir & '\TRIAL_LICENSE_KEY.TXT') Then $sLicenceKey = FileRead(@ScriptDir & '\TRIAL_LICENSE_KEY.TXT')

what I made wrong?
Thanks

​and remove your license key, regardless of whether it is a Trial License code.

 

Question:

What contains this file @ScriptDir & '\TRIAL_LICENSE_KEY.TXT' ?

If you just copy them from "program files", then this is the issue.

This file can not contains any other content then only key.
So if it content is like:

This trial license key will provide support until maj 20, 2015
j............y

then this is wrong because If you use:

  Quote

Local $sLicenceKey = 'j.....................y'
If FileExists(@ScriptDir & '\TRIAL_LICENSE_KEY.TXT') Then $sLicenceKey = FileRead(@ScriptDir & '\TRIAL_LICENSE_KEY.TXT')

then the second line completely overwrites variable assignment, from the preceding line.

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Solved, now it works fine!

The original TRIAL_LICENSE_KEY.TXT content was:
This trial license key will provide support until maj 20, 2015
j............y
empty line

Modified to:
j............y
Without any trail empty line!

$sLicenceKey must contain the trial key:
Local $sLicenceKey = 'j.....................y'

Changed MyLicenseKey.txt to TRIAL_LICENSE_KEY.TXT:
If FileExists(@ScriptDir & '\TRIAL_LICENSE_KEY.TXT') Then $sLicenceKey = FileRead(@ScriptDir & '\TRIAL_LICENSE_KEY.TXT')

The main window hides the OpenFile window, to avoid this, comment this line:
;~ WinSetOnTop(_DPVS_GUI(), '', 1)

Thanks

Posted

Please come back later, with further comments as to the UDF.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Some questions...

Is there a property to set the print button?

Is there a property to jump to last page?

is there a property to show the total pages number?

Thamks

Posted
  On 5/4/2015 at 11:12 PM, 0ldMan said:

Some questions...

Is there a property to set the print button?

Is there a property to jump to last page?

is there a property to show the total pages number?

Thamks

Viewer is somewhat addition to the library QuickPDF Library, some of the functions carried out by the Library.
Look in my sign for QuickPDF link.

 

A:1.
​Not exactly property but can be done.
$oDPVS.DQPLPrintPages($sPrinterName,'1-10',$vOptions)

http://www.debenu.com/docs/pdf_library_reference/PrintPages.php


A:2. 

$oDPVS.GotoLastPage()

  Quote

void GotoLastPage(void)
Navigates to the last page of the document.

A:3

$oDPVS.DQPLPageCount()

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Which to my previous post I decided to add the appropriate code to the example script.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 2 weeks later...
Posted (edited)

I just publish new version 2015/05/18  v0.3:

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 1 year later...
Posted

Hi mLipok,

I've still got version 0.2 for the "Debenu PDF Viewer SDK - ActiveX component" at the following link:

Could you double check for it?

Thanks a lot,

Posted

Ah... I see.
Will update it this night.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@newbuzz I just added this missing file.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...