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 - Test syntax coloring
  FAQ FAQ  Forum Search   Register Register  Login Login

Test syntax coloring

 Post Reply Post Reply
Author
Message
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Topic: Test syntax coloring
    Posted: 23 Apr 15 at 7:52AM
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
    If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted'
    Local $oQP
    If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then
        $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password)
        ; _QPDF_LastErrorCode($oQP)
        Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '')
        Local $sPDF_Destination = ''
        If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir)
        Local $aPageFileList[$iTotalPages + 1]
        $aPageFileList[0] = $iTotalPages

        For $n = 1 To $iTotalPages
            $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf"
            $aPageFileList[$n] = $sPDF_Destination
            $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n)
        Next
        Return SetError(0, 0, $aPageFileList)

    Else
        Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0)

    EndIf
EndFunc   ;==>_QPDF_FileSplitEachPage



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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 23 Apr 15 at 7:53AM
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
    If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted'
    Local $oQP
    If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then
        $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password)
        ; _QPDF_LastErrorCode($oQP)
        Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '')
        Local $sPDF_Destination = ''
        If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir)
        Local $aPageFileList[$iTotalPages + 1]
        $aPageFileList[0] = $iTotalPages

        For $n = 1 To $iTotalPages
            $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf"
            $aPageFileList[$n] = $sPDF_Destination
            $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n)
        Next
        Return SetError(0, 0, $aPageFileList)

    Else
        Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0)

    EndIf
EndFunc   ;==>_QPDF_FileSplitEachPage
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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 23 Apr 15 at 7:53AM
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
    If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted'
    Local $oQP
    If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then
        $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password)
        ; _QPDF_LastErrorCode($oQP)
        Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '')
        Local $sPDF_Destination = ''
        If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir)
        Local $aPageFileList[$iTotalPages + 1]
        $aPageFileList[0] = $iTotalPages

        For $n = 1 To $iTotalPages
            $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf"
            $aPageFileList[$n] = $sPDF_Destination
            $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n)
        Next
        Return SetError(0, 0, $aPageFileList)

    Else
        Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0)

    EndIf
EndFunc   ;==>_QPDF_FileSplitEachPage
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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 28 Apr 15 at 1:53AM
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
    If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted'
    Local $oQP
    If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then
        $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password)
        ; _QPDF_LastErrorCode($oQP)
        Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '')
        Local $sPDF_Destination = ''
        If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir)
        Local $aPageFileList[$iTotalPages + 1]
        $aPageFileList[0] = $iTotalPages

        For $n = 1 To $iTotalPages
            $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf"
            $aPageFileList[$n] = $sPDF_Destination
            $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n)
        Next
        Return SetError(0, 0, $aPageFileList)

    Else
        Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0)

    EndIf
EndFunc   ;==>_QPDF_FileSplitEachPage
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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 28 Apr 15 at 1:55AM
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
    If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted'
    Local $oQP
    If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then
        $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password)
        ; _QPDF_LastErrorCode($oQP)
        Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '')
        Local $sPDF_Destination = ''
        If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir)
        Local $aPageFileList[$iTotalPages + 1]
        $aPageFileList[0] = $iTotalPages

        For $n = 1 To $iTotalPages
            $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf"
            $aPageFileList[$n] = $sPDF_Destination
            $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n)
        Next
        Return SetError(0, 0, $aPageFileList)

    Else
        Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0)

    EndIf
EndFunc   ;==>_QPDF_FileSplitEachPage
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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 28 Apr 15 at 1:56AM
Func _QPdf_Example_HelloWorld()

    Local $sFileName = @ScriptDir & "\hello-world.pdf"

    Local $oQP = ObjCreate($__sClassName)

    If __QPdf_UnlockKey($oQP, $__sLicenseKey) = 1 Then

    ;~ $oQP.AddPageLabels(1, 1, 10, '_QPdf_Example_HelloWorld()')

    $oQP.SetOrigin(1);

    $oQP.SetTextSize(20);

    $oQP.DrawText(100, 100, "Hello world from AutoIt")

    If $oQP.SaveToFile($sFileName) = 1 Then

        MsgBox($MB_SYSTEMMODAL, "Info", "File " & $sFileName & " written successfully.")

    Else

        MsgBox($MB_SYSTEMMODAL, "Error", "File " & $sFileName & " could not be written.")

    EndIf

        $aByteArray = $oQP.SaveToVariant()

        MsgBox($MB_SYSTEMMODAL, '$oQP.SaveToVariant()', VarGetType($aByteArray))

        Local $fHandle = FileOpen($sFileName, 16 + 128)

        $aByteArray2 = FileRead($fHandle)

        FileClose($fHandle)

        MsgBox($MB_SYSTEMMODAL, 'Compare results:', $aByteArray = $aByteArray2)

        FileDelete(@ScriptDir & '\aByteArray.txt.')

        FileWrite(@ScriptDir & '\aByteArray.txt.', $aByteArray)

        FileDelete(@ScriptDir & '\aByteArray2.txt.')

        FileWrite(@ScriptDir & '\aByteArray2.txt.', $aByteArray2)

    EndIf

EndFunc ;==>_QPdf_Example_HelloWorld



Edited by mLipok - 28 Apr 15 at 2:25AM
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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 28 Apr 15 at 1:57AM
Func _QPdf_Example_HelloWorld()
    Local $sFileName = @ScriptDir & "\hello-world.pdf"
    Local $oQP = ObjCreate($__sClassName)
    If __QPdf_UnlockKey($oQP, $__sLicenseKey) = 1 Then
;~      $oQP.AddPageLabels(1, 1, 10, '_QPdf_Example_HelloWorld()')
        $oQP.SetOrigin(1);
        $oQP.SetTextSize(20);
        $oQP.DrawText(100, 100, "Hello world from AutoIt")
        If $oQP.SaveToFile($sFileName) = 1 Then
            MsgBox($MB_SYSTEMMODAL, "Info", "File " & $sFileName & " written successfully.")
        Else
            MsgBox($MB_SYSTEMMODAL, "Error", "File " & $sFileName & " could not be written.")
        EndIf
        $aByteArray = $oQP.SaveToVariant()
        MsgBox($MB_SYSTEMMODAL, '$oQP.SaveToVariant()', VarGetType($aByteArray))
        Local $fHandle = FileOpen($sFileName, 16 + 128)
        $aByteArray2 = FileRead($fHandle)
        FileClose($fHandle)
        MsgBox($MB_SYSTEMMODAL, 'Compare results:', $aByteArray = $aByteArray2)

        FileDelete(@ScriptDir & '\aByteArray.txt.')
        FileWrite(@ScriptDir & '\aByteArray.txt.', $aByteArray)
        FileDelete(@ScriptDir & '\aByteArray2.txt.')
        FileWrite(@ScriptDir & '\aByteArray2.txt.', $aByteArray2)

    EndIf
EndFunc   ;==>_QPdf_Example_HelloWorld



Edited by mLipok - 28 Apr 15 at 2:23AM
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
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